def log_date_time_string(self): """Return the current time formatted for logging.""" now = time.time() year, month, day, hh, mm, ss, x, y, z = time.localtime(now) s = "%02d/%3s/%04d %02d:%02d:%02d" % (day, self.monthname[month], year, hh, mm, ss) return s
def log_date_time_string(self): """Return the current time formatted for logging.""" now = time.time() year, month, day, hh, mm, ss, x, y, z = time.localtime(now) s = "%02d/%3s/%04d %02d:%02d:%02d" % ( day, self.monthname[month], year, hh, mm, ss) return s
def add_block(self, block, work, server): """ Adds a new block. server must be the server the work is coming from """ with self.lock: hook_start = plugins.Hook('plugins.lp.add_block.start') hook_start.notify(self, block, work, server) self.blocks[block]={} self.blocks[block]['_time'] = time.localtime() self.bitHopper.lp_callback.new_block(work, server) self.blocks[block]["_owner"] = None self.lastBlock = block hook_end = plugins.Hook('plugins.lp.add_block.end') hook_end.notify(self, block, work, server)
def add_block(self, block, work, server): """ Adds a new block. server must be the server the work is coming from """ with self.lock: hook_start = plugins.Hook('plugins.lp.add_block.start') hook_start.notify(self, block, work, server) self.blocks[block] = {} self.blocks[block]['_time'] = time.localtime() self.bitHopper.lp_callback.new_block(work, server) self.blocks[block]["_owner"] = None self.lastBlock = block hook_end = plugins.Hook('plugins.lp.add_block.end') hook_end.notify(self, block, work, server)