Beispiel #1
0
def listfiles_local(state, obj):
    files = []
    if "payload" in obj and "blocks" in obj["payload"]:
        for block in obj["payload"]["blocks"]:
            for transaction in block["transactions"]:
                files.append({
                    "name": transaction["name"],
                    "size": transaction["size"],
                    "downloaded": transaction["downloaded"]
                })
    state["files"]["local"] = files
    util.colorjson(files)
    return 0
Beispiel #2
0
def listfiles_remote(state, obj):
    files = []
    if "payload" in obj and "roots" in obj["payload"]:
        for root in obj["payload"]["roots"]:
            for block in root["blocks"]:
                for transaction in block["transactions"]:
                    files.append({
                        "owner": root["owner"],
                        "name": transaction["name"],
                        "size": transaction["size"],
                        "downloaded": transaction["downloaded"]
                    })
    state["files"]["remote"] = files
    util.colorjson(files)
    return 0
Beispiel #3
0
def roguedump(state, obj):
    util.colorjson(obj)
    return 0
Beispiel #4
0
def bmining(state, obj):
    util.colorjson(obj)
    return 0
Beispiel #5
0
def peeroffline(state, obj):
    util.colorjson(obj)
    return 0
Beispiel #6
0
def badvertise(state, obj):
    util.colorjson(obj)
    return 0
Beispiel #7
0
def tshare(state, obj):
    util.colorjson(obj)
    return 0
Beispiel #8
0
def jobfinalize(state, obj):
    util.colorjson(obj)
    return 0
Beispiel #9
0
def jobdone(state, obj):
    util.colorjson(obj)
    return 0
Beispiel #10
0
def jobadd(state, obj):
    util.colorjson(obj)
    return 0
Beispiel #11
0
def message(state, obj):
    state["messages"].append(obj)
    util.colorjson(obj)
    return 0
Beispiel #12
0
def listpeers(state, obj):
    state["peers"] = obj
    util.colorjson(obj)
    return 0
Beispiel #13
0
def versiondump(state, obj):
    util.colorjson(obj)
    return 0