本文整理汇总了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])
示例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)]
示例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)]
示例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)