예제 #1
0
 def _start_work(self, device):
     try:
         self.parent.server.start_work(self._excavator_algorithm,
                                       device,
                                       benchmarking=self.benchmarking)
     except (socket.error, socket.timeout):
         raise miner.MinerNotRunning('could not connect to excavator')
예제 #2
0
 def current_speeds(self):
     try:
         workers = [self.parent.server.device_speeds(device)
                    for device in self._devices]
     except (socket.error, socket.timeout):
         raise miner.MinerNotRunning('could not connect to excavator')
     else:
         def total_speed(algorithm):
             return sum([worker[algorithm] for worker in workers
                         if algorithm in worker])
         return [total_speed(algorithm)
                 for algorithm in self._excavator_algorithm.split('_')]