当前位置: 首页>>代码示例>>Python>>正文


Python ByteReader.skipBytes方法代码示例

本文整理汇总了Python中mmfparser.bytereader.ByteReader.skipBytes方法的典型用法代码示例。如果您正苦于以下问题:Python ByteReader.skipBytes方法的具体用法?Python ByteReader.skipBytes怎么用?Python ByteReader.skipBytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mmfparser.bytereader.ByteReader的用法示例。


在下文中一共展示了ByteReader.skipBytes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: read

# 需要导入模块: from mmfparser.bytereader import ByteReader [as 别名]
# 或者: from mmfparser.bytereader.ByteReader import skipBytes [as 别名]
    def read(self, reader):
        # reader.openEditor()
        debug = self.settings.get('debug', False)
        java = self.settings.get('java', False)
        flash = self.settings.get('flash', False)
        old = self.settings.get('old', False)

        if debug:
            path = reader.readString()
            reader = ByteReader(open(path, 'rb'))
            reader.skipBytes(4)
    
        if java:
            numberOfItems = reader.readShort()
            itemsToRead = reader.readShort()
            if flash:
                itemClass = FlashSound
            elif old:
                itemClass = OldSound
            else:
                itemClass = JavaSound
        else:
            itemsToRead = reader.readInt()
            if old:
                itemClass = OldSound
            else:
                itemClass = SoundItem

        compressed = not debug
            
        self.items = [self.new(itemClass, reader, compressed = compressed)
            for _ in xrange(itemsToRead)]
        
        self.names = dict([(item.name, item) for  item in self.items])
开发者ID:Matt-Esch,项目名称:anaconda,代码行数:36,代码来源:soundbank.py

示例2: read

# 需要导入模块: from mmfparser.bytereader import ByteReader [as 别名]
# 或者: from mmfparser.bytereader.ByteReader import skipBytes [as 别名]
    def read(self, reader):
        debug = self.settings.get('debug', False)
        old = self.settings.get('old', False)
        if debug:
            path = reader.readString()
            reader = ByteReader(open(path, 'rb'))
            reader.skipBytes(4)

        numberOfItems = reader.readInt()
        
        if old:
            klass = OldFont
        else:
            klass = FontItem
        
        self.items = [self.new(klass, reader)
            for _ in xrange(numberOfItems)]
开发者ID:Matt-Esch,项目名称:anaconda,代码行数:19,代码来源:fontbank.py

示例3: read

# 需要导入模块: from mmfparser.bytereader import ByteReader [as 别名]
# 或者: from mmfparser.bytereader.ByteReader import skipBytes [as 别名]
    def read(self, reader):
        java = self.settings.get('java', False)
        debug = self.settings.get('debug', False)
        
        if debug:
            path = reader.readString()
            reader = ByteReader(open(path, 'rb'))
            reader.skipBytes(4)
        
        if java:
            totalReferences = reader.readShort()
            numberOfItems = reader.readShort()
            itemClass = JavaMusic
        else:
            numberOfItems = reader.readInt()
            itemClass = MusicFile

        self.items = [self.new(itemClass, reader)
            for _ in xrange(numberOfItems)]
开发者ID:Matt-Esch,项目名称:anaconda,代码行数:21,代码来源:musicbank.py

示例4: read

# 需要导入模块: from mmfparser.bytereader import ByteReader [as 别名]
# 或者: from mmfparser.bytereader.ByteReader import skipBytes [as 别名]
    def read(self, reader):
        debug = self.settings.get('debug', False)
        old = self.settings.get('old', False)
        if debug:
            path = self.readString(reader)
            reader = ByteReader(open(path, 'rb'))
            reader.skipBytes(4)

        numberOfItems = reader.readInt()
        
        if old:
            klass = OldFont
        else:
            klass = FontItem
        
        offset = 0
        if self.settings['build'] >= 284 and not debug:
            offset = -1

        self.items = []
        for _ in xrange(numberOfItems):
            item = self.new(klass, reader)
            item.handle += offset
            self.items.append(item)
开发者ID:carriercomm,项目名称:anaconda,代码行数:26,代码来源:fontbank.py


注:本文中的mmfparser.bytereader.ByteReader.skipBytes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。