コード例 #1
0
 def updateAll(self):
     prices = get_db('prices')
     for key in newitems:
         newitem = newitems[key]
         prices[str(key)] = repr((newitem.itemId, newitem.lowPrice, newitem.highPrice, newitem.active, newitem.title))
     prices.sync()
     prices.close()
コード例 #2
0
 def updateAll(self,items):
     pricecheck = get_db('pricecheck')
     pricecheck.clear()
     for key in items:
         pc = items[key]
         pricecheck[str(key)] = repr(pc.content)
     pricecheck.sync()
     pricecheck.close()
コード例 #3
0
 def getAll(self):
     prices=get_db('prices')
     items={}
     for key in prices:
         (itemId,lowPrice, highPrice, active, title) = eval(prices[key])
         newitem = PricedItem(itemId, lowPrice, highPrice, active, title)
         items[key] = newitem
     prices.close()
     return items
コード例 #4
0
 def getAll(self):
     items={}
     pricecheck = get_db('pricecheck')
     for key in pricecheck:
         content = eval(pricecheck[key])
         pc = PriceCheck(int(key), content)
         items[key] = pc
     pricecheck.close()
     return items
コード例 #5
0
 def getAll(self):    
     venddb = get_db('vendlog')
     logitems=eval(venddb['log'])
     vendlog=[]
     for item in logitems:
         (type, actionTime, itemId, quantity, price) = item
         entry = VendLog(itemId, type, actionTime, quantity, price)
         vendlog.append(entry)
     itemdb.close()
     venddb.close()
     return vendlog
コード例 #6
0
ファイル: getprices.py プロジェクト: Remuranun/pyro-bot
 def start(self):
     self.allKeys=get_db("items").keys()
     print self.allKeys
     self.currentIndex = len(self.allKeys) - 10
     self.items={}
     self.client.addEvent(lambda: self.nextPriceCheck(), 0.25)
コード例 #7
0
 def deleteItem(self, itemId):
     prices = get_db('prices')
     if str(itemId) in prices:
         del prices[str(itemId)]
     prices.sync()
     prices.close()
コード例 #8
0
 def addItem(self, itemId, lowPrice, highPrice, active=True, title='' ):
     prices = get_db('prices')
     prices[str(itemId)] = repr((itemId, lowPrice, highPrice, active, title))
     prices.sync()
     prices.close()
コード例 #9
0
 def __init__(self, itemId):
     itemdb=get_db('items')
     self.itemId = itemId
     self.name = itemdb[str(itemId)][2]
     itemdb.close()
コード例 #10
0
ファイル: getprices.py プロジェクト: Remuranun/pyro-bot
 def start(self):
     self.allKeys = get_db("items").keys()
     print self.allKeys
     self.currentIndex = len(self.allKeys) - 10
     self.items = {}
     self.client.addEvent(lambda: self.nextPriceCheck(), 0.25)