@select(archive) @untangle('fred.pak') @untangle('joe.pak')This mechanism is required to support include files, since a top level document is incomplete otherwise.
Note that the inserted code is not woven! In fact, the tangler never sees it, it simply supplies the sink object.
512: #line 718 "input_frame.ipk" 513: def untangle(self,name): 514: if not self.current_tangler: 515: raise 'untangle without active tangler' 516: f = open(name) 517: data = f.readlines() 518: f.close() 519: self.current_tangler.sink.writeline('@select(output("'+name+'"))') 520: for line in data: 521: l = string.rstrip(line) 522: if len(l): 523: if l[0]=='@': l = '@'+l 524: self.inpt.tangler.sink.writeline(l) 525: self.current_tangler.sink.writeline('@select(None)') 526: self.current_tangler.weaver.begin_small() 527: self.current_tangler.weaver.writeline('Included '+name+', '+str(len(data))+' lines.') 528: self.current_tangler.weaver.end_small() 529: self.current_tangler.weaver.line_break() 530: