Created
September 4, 2016 12:14
-
-
Save anonymous/4ea6a6c8762188d2031d9a229fe77389 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/python | |
import yaml | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument("name", help="name of the world to export") | |
args = parser.parse_args() | |
world = args.name | |
with open('/home/server/plugins/Multiverse-Core/worlds.yml', 'r') as f: | |
doc = yaml.load(f) | |
txt = doc["worlds"][world] | |
print txt | |
target = open('/home/server/exports/' + world + '.yml', 'w') | |
target.write(yaml.dump(txt)) | |
target.close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment