Created
May 19, 2023 14:01
-
-
Save Atlas48/a483994ef65f7e6b9c38a8e67ebe6f99 to your computer and use it in GitHub Desktop.
converts a json config dump from rclone, into the ini format used to store config data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rc_json2cfg.py v1 | |
# WTFPL v2+ (It's simple enough that you could probably write it yourself.) | |
# converts a json config dump from rclone, into the ini format used to store config data | |
from json import load as json_load | |
try: | |
with open("rclonecfg.json", 'r') as f: | |
o=json_load(f) | |
except FileNotFoundError: | |
print("rclonecfg.json not found, edit file and try again.") | |
exit(1) | |
for kk, vv in o.items(): | |
print("[%s]"%kk) | |
for k,v in vv.items(): | |
print("%s=%s"%(k,v)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment