Beispiel #1
0
 def fill_queue(self):
     with self.db_lock:
         print("Filling Queue!!!!!")
         db = DBConnector()
         orders = db.get_all_buy_orders()
         for item, number, maxfloat, maxprice in orders:
             self.urlq.put(item, timeout=10)
Beispiel #2
0
 def run(self):
     while not self.stopped.wait(10):
         with self.client.db_lock:
             db = DBConnector()
             buyorders = db.get_all_buy_orders()
             print("Buyorders fetched")
             for item, number, maxfloat, maxprice in buyorders:
                 if number >= 1:
                     listings = db.get_listing_for_url(item)
                     fitting = [x for x in listings if
                                x.total_price <= float(maxprice) and x.paintwear <= float(maxfloat)]
                     for item in fitting:
                         print("BUYING ITEM!!!!!!!!!!!!!!!")
                         saved = db.save_bought_item(item, maxfloat)
                         if not saved:
                             print("COULD NOT BE SAVED!!!")
Beispiel #3
0
 def fetch_listings_for_deals(self):
     with self.db_lock:
         db = DBConnector()
         orders = db.get_all_buy_orders()
         for item, number, maxfloat, maxprice in orders:
             print(self.receive_filtered_listings(item, maxprice, maxfloat, maxnum=100))