#!/usr/bin/python | |
import sys | |
import json | |
obj = json.load(sys.stdin) | |
def fix_save_path(p): | |
p = p.replace('\\', '/') | |
if p[1:3] == ':/': | |
p = '/mnt/' + p[0] + '/' + p[3:] | |
if not p.endswith('/'): | |
p += '/' | |
return p | |
obj["qBt-savePath"] = fix_save_path(obj["qBt-savePath"]) | |
obj["save_path"] = fix_save_path(obj["save_path"]) | |
if "mapped_files" in obj: | |
for n, p in enumerate(obj["mapped_files"]): | |
obj["mapped_files"][n] = p.replace('\\', '/') | |
sys.stdout.write(json.dumps(obj, indent=2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
ivan commentedMay 27, 2016
•
edited
https://ludios.org/windows-to-linux-notes/ links to this