def testName(self): found = False for item in btcnet_info.get_pools(): if item.name == 'test_pool': found = True self.assertTrue(found)
def data(): response = {} response['current'] = ', '.join([s.name for s in get_current_servers()]) response['mhash'] = get_hashrate() response['diffs'] = dict([(coin.name, float(coin.difficulty)) for coin in btcnet_info.get_coins() if coin.difficulty]) response['sliceinfo'] = None response['servers'] = list(transform_data(btcnet_info.get_pools())) response['user'] = None return Response(json.dumps(response), mimetype='text/json')
def data(): response = {} response['current'] = ', '.join([s.name for s in get_current_servers()]) response['mhash'] = get_hashrate() response['diffs'] = '' response['sliceinfo'] = None response['servers'] = list(transform_data(btcnet_info.get_pools())) response['user'] = None return Response(json.dumps(response), mimetype='text/json')
def data(): response = {} response["current"] = ", ".join([s.name for s in get_current_servers()]) response["mhash"] = get_hashrate() response["diffs"] = "" response["sliceinfo"] = None response["servers"] = list(transform_data(btcnet_info.get_pools())) response["user"] = None return Response(json.dumps(response), mimetype="text/json")
def rebuild_servers(): """ The function the rebuilds the set of servers """ try: global Servers servers = btcnet_info.get_pools().copy() for filter_f in filters: servers = filter_f(servers) Servers = list(servers) except ValueError as Error: logging.warn(Error) except Exception as Error: logging.error(traceback.format_exc())
def worker(): #Check if this is a form submission handle_worker_post(flask.request.form) #Get a list of currently configured workers pools_workers = {} for pool in btcnet_info.get_pools(): if pool.name is None: logging.debug('Ignoring a Pool. If no pools apear on /worker please update your version of btcnet_info') continue pools_workers[pool.name] = bitHopper.Configuration.Workers.get_worker_from(pool.name) return flask.render_template('worker.html', pools = pools_workers)
def testValid(self): def test_in_list(list_s): for item in list_s: if item.name == 'test_pool': return True return False from bitHopper.Logic.ServerLogic import filters import btcnet_info servers = list(btcnet_info.get_pools()) assert test_in_list(servers) for filter_f in bitHopper.Logic.ServerLogic.filters: servers = list(filter_f(servers)) assert test_in_list(servers)
def worker(): #Check if this is a form submission handle_worker_post(flask.request.form) #Get a list of currently configured workers pools_workers = {} for pool in btcnet_info.get_pools(): if pool.name is None: logging.debug( 'Ignoring a Pool. If no pools apear on /worker please update your version of btcnet_info' ) continue pools_workers[ pool.name] = bitHopper.Configuration.Workers.get_worker_from( pool.name) return flask.render_template('worker.html', pools=pools_workers)