Example #1
0
 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
Example #2
0
 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
Example #3
0
 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)
Example #4
0
 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)