@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.
390: #line 586 "input_frame.ipk" 391: def untangle(self,name): 392: if not self.tangler: 393: raise 'untangle without active tangler' 394: f = open(name) 395: data = f.readlines() 396: f.close() 397: self.tangler.sink.writeline('@select(output("'+name+'"))') 398: for line in data: 399: l = string.rstrip(line) 400: if len(l): 401: if l[0]=='@': l = '@'+l 402: self.inpt.tangler.sink.writeline(l) 403: self.tangler.sink.writeline('@select(None)') 404: self.tangler.weaver.begin_small() 405: self.tangler.weaver.writeline('Included '+name+', '+str(len(data))+' lines.') 406: self.tangler.weaver.end_small() 407: self.tangler.weaver.line_break() 408: