예제 #1
0
    def testName(self):
        found = False
        for item in btcnet_info.get_pools():
            if item.name == 'test_pool':
                found = True

        self.assertTrue(found)
예제 #2
0
 def testName(self):
     found = False
     for item in btcnet_info.get_pools():
         if item.name == 'test_pool':
             found = True
     
     self.assertTrue(found)
예제 #3
0
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') 
예제 #4
0
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')
예제 #5
0
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")
예제 #6
0
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())
예제 #7
0
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)
예제 #8
0
    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)
예제 #9
0
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())
예제 #10
0
 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)
예제 #11
0
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)