A newbie question about some code
Jim Qiu
bluefisher80 at gmail.com
Mon May 18 05:18:52 EDT 2009
Hi everyone.
I am reading a python library code and found something i can not understand.
Please help!
class Envelope(object):
def __init__(self,ta_info):
self.ta_info = ta_info
def writefilelist(self,ta_list,tofile):
for filename in ta_list:
fromfile = botslib.botsopendata(filename,
'rb',self.ta_info['charset'])
shutil.copyfileobj(fromfile,tofile)
fromfile.close()
def convertfilelist(self,ta_list):
return [botslib.botsgetabspathdata(filename) for filename in
ta_list]
class myxmlenvelop(Envelope):
def __init__(self,ta_info,ta_list):
''' class for (test) xml envelope. There is no standardised
XML-envelope!
writes a new XML-tree; uses places-holders for XML-files to
include; real enveloping is done by ElementTree's include'''
self.ta_info = ta_info
self._openoutenvelope()
#~ self.out.put({'BOTSID':'root','xmlns:xi':"
http://www.w3.org/2001/XInclude"}) #works, but attribute is not removed
bij ETI.include
self.out.put({'BOTSID':'root'})
ta_list = self.convertfilelist(ta_list)
for filename in ta_list:
self.out.put({'BOTSID':'root'},{'BOTSID':'{
http://www.w3.org/2001/XInclude}include','parse':"xml",'href':filename})
self.out.envelopewrite(self.out.root
Please check the blue highlighted part, I don't understand how the object
get the property?
Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090518/be2c7576/attachment.html>
More information about the Python-list
mailing list