def doWriteCoins(self, arg): """ Action method. """ for coin in arg: if not coins_db.exist(coin): coins_db.insert(coin) if coin["tm"] > utime.datetime_to_sec1970(self.download_offset): self.download_offset = utime.sec1970_to_datetime_utc(coin["tm"])
def doWriteCoins(self, *args, **kwargs): """ Action method. """ for coin in args[0]: if not coins_db.exist(coin): coins_db.insert(coin) if coin['tm'] > utime.datetime_to_sec1970(self.download_offset): self.download_offset = utime.sec1970_to_datetime_utc(coin['tm'])
def doRetrieveCoins(self, arg): """ Action method. """ query = { 'method': 'get_many', 'index': 'time_mined', 'limit': self.download_limit, 'start': utime.datetime_to_sec1970(self.download_offset), 'end': utime.utcnow_to_sec1970(), } for idurl in self.connected_accountants: p2p_service.SendRetrieveCoin(idurl, query)
def doRetreiveCoins(self, arg): """ Action method. """ query = { "method": "get_all", "index": "time", "limit": self.download_limit, "start": utime.datetime_to_sec1970(self.download_offset), "end": utime.utcnow_to_sec1970(), } for idurl in self.connected_accountants: p2p_service.SendRetreiveCoin(idurl, query)