@@ -75,19 +75,34 @@ def run(self):
7575 self .run_re_planning ()
7676 return
7777
78+ # getting auction items from api by
79+ # openprocurement_client.sync.ResourceFeeder
7880 for item in self .feeder .get_resource_items ():
7981 # magic goes here
82+ # munch auction item fields specified in API_EXTRA['opt_fields']
8083 feed = FeedItem (item )
84+ # running __call__ method of core.DatabridgeManager, which returns
85+ # instance of core.Planning, initialized with current instance of
86+ # AuctionsDataBridge and feed object if value of
87+ # procurementMethodType field in feed object was registered during
88+ # entry_points loading, else returns None
8189 planning = self .mapper (feed )
82- if not planning :
90+ if not planning : # if procurementMethodType is not registered
8391 continue
92+ # calling __iter__ method of core.Planning's instance
93+ # got from previous step
8494 for cmd , item_id , lot_id in planning :
8595 if lot_id :
8696 LOGGER .info ('Lot {} of tender {} selected for {}' .format (
8797 lot_id , item_id , cmd ))
8898 else :
8999 LOGGER .info ('Tender {} selected for {}' .format (item_id ,
90100 cmd ))
101+ # calling __call__ method of core.Planning's instance which
102+ # prepares all needed arguments and returns result of
103+ # gevent.subprocess.check_call function, which runs certain
104+ # auction worker, depending on value of procurementMethodType of
105+ # feed object
91106 planning (cmd , item_id , lot_id = lot_id )
92107
93108 def run_re_planning (self ):
0 commit comments