def __init__(self, filename=None, create=False, random_seed=None, last_played=None, readonly=False, height=None):
        """
        :param filename: path to the root dir of the level
        :param create: bool or hexstring/int: wether to create the level. If bool, only False is allowed.
            Hex strings or ints must reflect a valid PE world version as '\x02' or 5.
        :return:
        """
        if not os.path.isdir(filename):
            filename = os.path.dirname(filename)

        # Can we rely on this to know which version of PE was used to create the world?
        # Looks like that 1+ world can also have a storage version equal to 4...
        if not create:
            self.dat_world_version = open(os.path.join(filename, 'level.dat')).read(1)
            if ord(self.dat_world_version) >= 5:
                self.world_version = '1.plus'
                self.Height = 256
            else:
                self.world_version = 'pre1.0'
                self.Height = 128

            logger.info('PE world verion found: %s (%s)' % (self.world_version, repr(self.dat_world_version)))
        else:
            self.world_version = create
            if height is not None:
                self.Height = height
            logger.info('Creating PE world version %s (%s)' % (self.world_version, repr(self.dat_world_version)))

        self.filename = filename
        self.worldFile = PocketLeveldbDatabase(filename, self, create=create, world_version=self.world_version, dat_world_version=self.dat_world_version)

        self.world_version = self.worldFile.world_version
        self.readonly = readonly
        self.loadLevelDat(create, random_seed, last_played)

        self.worldFolder = AnvilWorldFolder(filename)
        workFolderPath2 = self.worldFolder.getFolderPath("##MCEDIT.TEMP2##")
        if os.path.exists(workFolderPath2):
            shutil.rmtree(workFolderPath2, True)
        self.fileEditsFolder = AnvilWorldFolder(workFolderPath2)
        self.editFileNumber = 1

        :param filename: path to the root dir of the level
        :param create: bool or hexstring/int: wether to create the level. If bool, only False is allowed.
            Hex strings or ints must reflect a valid PE world version as '' or 5.
        :return:
        
pymclevel/leveldbpocket.py