def save(self, width='100%', height='100%'):
""" Write the XML string to **filename**. """
test = False
import io
# Fix height and width
self['height'] = height
self['width'] = width
if sys.version_info[0] == 2:
test = type(self.filename) == types.FileType or type(self.filename) == types.InstanceType
elif sys.version_info[0] == 3:
test = type(self.filename) == io.TextIOWrapper
if test:
self.write(self.filename)
else:
fileobj = io.open(str(self.filename), mode='w', encoding='utf-8')
self.write(fileobj)
fileobj.close()
############################################################################
评论列表
文章目录