How to use the rfc3339.strtotimestamp function in rfc3339

To help you get started, we’ve selected a few rfc3339 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ConorWilliams / rsinc / rsinc / rclone.py View on Github external
command + track.rclone_flags, stdout=subprocess.PIPE
    )
    list_of_dicts = ujson.load(result.stdout)

    command = ["rclone", "hashsum", hash_name, path]
    result = subprocess.Popen(command, stdout=subprocess.PIPE)
    hashes = {}

    for file in result.stdout:
        decode = file.decode(RCLONE_ENCODING).strip()
        tmp = decode.split("  ", 1)
        hashes[tmp[1]] = tmp[0]

    out = Flat(path)
    for d in list_of_dicts:
        time = strtotimestamp(d["ModTime"])
        hashsize = str(d["Size"])

        hash = hashes.get(d["Path"], None)
        if hash is not None:
            hashsize += hash
        else:
            print(red("ERROR:"), "can't find", d["Path"], "hash")
            continue

        out.update(d["Path"], hashsize, time)

    return out

rfc3339

Format dates according to the RFC 3339.

ISC
Latest version published 5 years ago

Package Health Score

49 / 100
Full package analysis