Skip to content

Instantly share code, notes, and snippets.

Created September 4, 2016 12:14
Show Gist options
  • Save anonymous/4ea6a6c8762188d2031d9a229fe77389 to your computer and use it in GitHub Desktop.
Save anonymous/4ea6a6c8762188d2031d9a229fe77389 to your computer and use it in GitHub Desktop.
#!/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