home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 April / PCWorld_2001-04_cd.bin / Software / TemaCD / webclean / !!!python!!! / BeOpen-Python-2.0.exe / TEST_MIMEWRITER / text0005.txt < prev    next >
Encoding:
Text File  |  1998-06-11  |  605 b   |  20 lines

  1. class Buyer:
  2.     def __setup__(self, maxprice):
  3.         self._maxprice = maxprice
  4.  
  5.     def __main__(self, kos):
  6.         """Entry point upon arrival at a new KOS."""
  7.         broker = kos.broker()
  8.         # B4 == Barry's Big Bass Business :-)
  9.         seller = broker.lookup('Seller_1.Seller', 'B4')
  10.         if seller:
  11.             price = seller.price()
  12.             print 'Seller wants $', price, '... '
  13.             if price > self._maxprice:
  14.                 print 'too much!'
  15.             else:
  16.                 print "I'll take it!"
  17.         else:
  18.             print 'no seller found here'
  19.  
  20.