Hi everyone. <div><br></div><div>I am reading a python library code and found something i can not understand. Please help!</div><div><br></div><div><div>class Envelope(object):</div><div><br></div><div> def __init__(self,ta_info):</div>
<div> self.ta_info = ta_info</div><div><br></div><div><br></div><div> def writefilelist(self,ta_list,tofile):</div><div> for filename in ta_list:</div><div> fromfile = botslib.botsopendata(filename, 'rb',self.ta_info['charset'])</div>
<div> shutil.copyfileobj(fromfile,tofile)</div><div> fromfile.close()</div><div><br></div><div> def convertfilelist(self,ta_list):</div><div> return [botslib.botsgetabspathdata(filename) for filename in ta_list]</div>
<div><br></div><div><br></div><div><br></div><div>class myxmlenvelop(Envelope):</div><div> def __init__(self,ta_info,ta_list):</div><div> ''' class for (test) xml envelope. There is no standardised XML-envelope!</div>
<div> writes a new XML-tree; uses places-holders for XML-files to include; real enveloping is done by ElementTree's include'''</div><div> self.ta_info = ta_info</div><div> self._openoutenvelope()</div>
<div> #~ self.out.put({'BOTSID':'root','xmlns:xi':"<a href="http://www.w3.org/2001/XInclude">http://www.w3.org/2001/XInclude</a>"}) #works, but attribute is not removed bij ETI.include</div>
<div> self.<span class="Apple-style-span" style="background-color: rgb(51, 102, 255);">out</span>.put({'BOTSID':'root'})</div><div> ta_list = self.convertfilelist(ta_list)</div><div> for filename in ta_list:</div>
<div> self.<span class="Apple-style-span" style="background-color: rgb(51, 102, 255);">out</span>.put({'BOTSID':'root'},{'BOTSID':'{<a href="http://www.w3.org/2001/XInclude}include">http://www.w3.org/2001/XInclude}include</a>','parse':"xml",'href':filename})</div>
<div> self.out.envelopewrite(self.out.root</div><div><br></div><div><br></div><div>Please check the blue highlighted part, I don't understand how the object get the property?</div><div><br></div><div><br></div>
<div>Jim</div></div>