本文整理汇总了Python中tegaki.character.Character.read_string方法的典型用法代码示例。如果您正苦于以下问题:Python Character.read_string方法的具体用法?Python Character.read_string怎么用?Python Character.read_string使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tegaki.character.Character
的用法示例。
在下文中一共展示了Character.read_string方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testReadXMLBZ2String
# 需要导入模块: from tegaki.character import Character [as 别名]
# 或者: from tegaki.character.Character import read_string [as 别名]
def testReadXMLBZ2String(self):
file = os.path.join(self.currdir, "data", "character.xml.bz2")
file = open(file)
string = file.read()
file.close()
char = Character()
char.read_string(string, bz2=True)
self._testReadXML(char)
示例2: testWriteXMLFile
# 需要导入模块: from tegaki.character import Character [as 别名]
# 或者: from tegaki.character.Character import read_string [as 别名]
def testWriteXMLFile(self):
char = self._getCharacter()
io = StringIO.StringIO()
char.write(io)
new_char = Character()
new_char.read_string(io.getvalue())
self.assertEquals(char, new_char)
示例3: testReadXMLString
# 需要导入模块: from tegaki.character import Character [as 别名]
# 或者: from tegaki.character.Character import read_string [as 别名]
def testReadXMLString(self):
file = os.path.join(self.currdir, "data", "character.xml")
f = open(file)
buf = f.read()
f.close()
char = Character()
char.read_string(buf)
self._testReadXML(char)
示例4: _convert_character
# 需要导入模块: from tegaki.character import Character [as 别名]
# 或者: from tegaki.character.Character import read_string [as 别名]
def _convert_character(data):
# converts a BLOB into an object
char = Character()
char.read_string(base64.b64decode(data), gzip=True)
return char