本文整理匯總了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