2 From: bwarsaw@cnri.reston.va.us
3 Date: Mon Feb 12 17:21:48 EST 1996
4 To: kss-submit@cnri.reston.va.us
6 Content-Type: multipart/knowbot;
10 This is a multi-part message in MIME format.
13 Content-Type: multipart/knowbot-metadata;
18 Content-Type: message/rfc822
19 KP-Metadata-Type: simple
22 KPMD-Interpreter: python
23 KPMD-Interpreter-Version: 1.3
24 KPMD-Owner-Name: Barry Warsaw
25 KPMD-Owner-Rendezvous: bwarsaw@cnri.reston.va.us
26 KPMD-Home-KSS: kss.cnri.reston.va.us
27 KPMD-Identifier: hdl://cnri.kss/my_first_knowbot
28 KPMD-Launch-Date: Mon Feb 12 16:39:03 EST 1996
31 Content-Type: text/isl
32 KP-Metadata-Type: complex
33 KP-Metadata-Key: connection
35 KP-Connection-Description: Barry's Big Bass Business
37 KP-Connection-Direction: client
42 DOCUMENTATION "A simple Seller interface to test ILU"
48 Content-Type: message/external-body;
50 URL="hdl://cnri.kss/generic-knowbot"
52 Content-Type: text/isl
53 KP-Metadata-Type: complex
54 KP-Metadata-Key: generic-interface
56 KP-Connection-Description: Generic Interface for All Knowbots
57 KP-Connection-Id: generic-kp
58 KP-Connection-Direction: client
64 Content-Type: multipart/knowbot-code;
69 Content-Type: text/plain
70 KP-Module-Name: BuyerKP
73 def __setup__(self, maxprice):
74 self._maxprice = maxprice
76 def __main__(self, kos):
77 """Entry point upon arrival at a new KOS."""
79 # B4 == Barry's Big Bass Business :-)
80 seller = broker.lookup('Seller_1.Seller', 'B4')
82 price = seller.price()
83 print 'Seller wants $', price, '... '
84 if price > self._maxprice:
89 print 'no seller found here'
94 Content-Type: multipart/knowbot-state;
100 Content-Type: text/plain
103 # instantiate a buyer instance and put it in a magic place for the KOS
106 __kp__.__setup__(500)