mς %U²Ic@s„dZdklZdZdZdZd$d%d&d'd(d)d*gZd+d,d-d.d/d0gZd1d2d3d4d5d6gZd"„Zeƒd#S(7sΥTest program for MimeWriter module. The test program was too big to comfortably fit in the MimeWriter class, so it's here in its own file. This should generate Barry's example, modulo some quotes and newlines. (s MimeWriters–INTERFACE Seller-1; TYPE Seller = OBJECT DOCUMENTATION "A simple Seller interface to test ILU" METHODS price():INTEGER, END; sIclass Buyer: def __setup__(self, maxprice): self._maxprice = maxprice def __main__(self, kos): """Entry point upon arrival at a new KOS.""" broker = kos.broker() # B4 == Barry's Big Bass Business :-) seller = broker.lookup('Seller_1.Seller', 'B4') if seller: price = seller.price() print 'Seller wants $', price, '... ' if price > self._maxprice: print 'too much!' else: print "I'll take it!" else: print 'no seller found here' sy# instantiate a buyer instance and put it in a magic place for the KOS # to find. __kp__ = Buyer() __kp__.__setup__(500) t InterpretertpythonsInterpreter-Versions1.3s Owner-Names Barry WarsawsOwner-Rendezvoussbwarsaw@cnri.reston.va.ussHome-KSSskss.cnri.reston.va.ust Identifiershdl://cnri.kss/my_first_knowbots Launch-DatesMon Feb 12 16:39:03 EST 1996s Metadata-Typetcomplexs Metadata-Keyt connectiontAccesss read-onlysConnection-DescriptionsBarry's Big Bass Businesss Connection-IdtB4sConnection-Directiontclientsgeneric-interfaces"Generic Interface for All Knowbotss generic-kpcCsΊdk}t|iƒ} | iddƒ| iddƒ| iddƒ| iddƒ| id d d'gd dƒ}|idƒ| iƒ}|iddƒ|iƒ} | iddƒ| iddƒt| i dƒƒ}x(t D] \} }|id| |ƒqηW|iƒ~ |iƒ} x(tD] \} }| id| |ƒq+W| i dƒ}|itƒ~ |iƒ}|i dd(d)gƒ}t|ƒ}x(tD] \} }|id| |ƒq₯W|i dƒ|iƒ| iƒ}|iddƒ|iƒ}|id d!ƒ|i d"ƒ}|itƒ|iƒ| iƒ} | id#d$ƒ| id%d&ƒ| iƒ}|id d$ƒ|i d"ƒ}|itƒ| iƒ| iƒdS(*NtFromsbwarsaw@cnri.reston.va.ustDatesMon Feb 12 17:21:48 EST 1996tToskss-submit@cnri.reston.va.uss MIME-Versions1.0tknowbott 801spam999tversions0.1tprefixis-This is a multi-part message in MIME format. sknowbot-metadatat 802spam999sKP-Metadata-Typetsimples KP-Accesss read-onlysmessage/rfc822sKPMD-sKP-stext/islsmessage/external-bodys access-typetURLshdl://cnri.kss/generic-knowbots knowbot-codet 803spam999sKP-Module-NametBuyerKPs text/plainsKP-Main-Moduletmains knowbot-statet 804spam999(sversions0.1(s access-typeR(Rshdl://cnri.kss/generic-knowbot(tsyst MimeWritertstdoutttoplevelt addheadertstartmultipartbodytftwritetnextparttmdtmd1t startbodytmtSIMPLE_METADATAtkeytvaluet flushheaderstmd2tCOMPLEX_METADATAtSELLERtmd3tEXTERNAL_METADATAtlastparttcodetbuyertBUYERtstatetsttSTATE(RR-RR.R*R1R"R%RRR0R$R'R ((t1/data/zmath/lib/python2.4/test/test_MimeWriter.pyRPsh                        N(Rspython(sInterpreter-Versions1.3(s Owner-Names Barry Warsaw(sOwner-Rendezvoussbwarsaw@cnri.reston.va.us(sHome-KSSskss.cnri.reston.va.us(Rshdl://cnri.kss/my_first_knowbot(s Launch-DatesMon Feb 12 16:39:03 EST 1996(s Metadata-Typescomplex(s Metadata-KeyR(Rs read-only(sConnection-DescriptionsBarry's Big Bass Business(s Connection-IdR(sConnection-DirectionR(s Metadata-Typescomplex(s Metadata-Keysgeneric-interface(Rs read-only(sConnection-Descriptions"Generic Interface for All Knowbots(s Connection-Ids generic-kp(sConnection-DirectionR( t__doc__RR)R/R2R#R(R+R(R)R2R(RR/R#RR+((R3t?s     Z