Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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