minermedic/miners/helper.py
def parse_worker_string(miner, worker):

    """
    Parses a worker string and returns the coin address and worker ID

    Returns:
        String, String
    """

    worker_part_count = worker.count(".") + 1

    if worker_part_count > 1:
        if worker_part_count == 2:
            coin_address, worker = worker.split('.')
        else:
            worker_parts = worker.split('.')
            coin_address = worker_parts[0]
            worker = worker_parts[worker_part_count - 1]
    else:
        coin_address = worker

    if coin_address is not None:
        if miner.coin_address is None or len(miner.coin_address) == 0:
            miner.coin_address = coin_address
        elif miner.coin_address != coin_address:
            miner.coin_address = coin_address

    if worker is not None:
        if miner.worker_name is None or len(miner.worker_name) == 0:
            miner.worker_name = worker
        elif miner.worker_name != worker:
            miner.worker_name = worker

    return coin_address, worker

    Parses a worker string and returns the coin address and worker ID

    Returns:
        String, String
    
Parses a worker string and returns the coin address and worker ID
Parses a worker string and returns the coin address and worker ID
def parse_worker_string(miner, worker):
    worker_part_count = worker.count(".") + 1
    if worker_part_count > 1:
        if worker_part_count == 2:
            coin_address, worker = worker.split('.')
        else:
            worker_parts = worker.split('.')
            coin_address = worker_parts[0]
            worker = worker_parts[worker_part_count - 1]
    else:
        coin_address = worker
    if coin_address is not None:
        if miner.coin_address is None or len(miner.coin_address) == 0:
            miner.coin_address = coin_address
        elif miner.coin_address != coin_address:
            miner.coin_address = coin_address
    if worker is not None:
        if miner.worker_name is None or len(miner.worker_name) == 0:
            miner.worker_name = worker
        elif miner.worker_name != worker:
            miner.worker_name = worker
    return coin_address, worker
def parse_worker_string ( miner , worker ) : worker_part_count = worker . count ( "." ) + 1 if worker_part_count > 1 : if worker_part_count == 2 : coin_address , worker = worker . split ( '.' ) else : worker_parts = worker . split ( '.' ) coin_address = worker_parts [ 0 ] worker = worker_parts [ worker_part_count - 1 ] else : coin_address = worker if coin_address is not None : if miner . coin_address is None or len ( miner . coin_address ) == 0 : miner . coin_address = coin_address elif miner . coin_address != coin_address : miner . coin_address = coin_address if worker is not None : if miner . worker_name is None or len ( miner . worker_name ) == 0 : miner . worker_name = worker elif miner . worker_name != worker : miner . worker_name = worker return coin_address , worker
Parses a worker string and returns the coin address and worker ID
Parses a worker string and returns the coin address and worker ID
"""
    Parses a worker string and returns the coin address and worker ID

    Returns:
        String, String
    """
None
miner
worker