You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
494 B

  1. import os
  2. import json
  3. def load(asset):
  4. direct = os.getcwd()
  5. path = '{}{sep}Assets{sep}{}'.format(direct,asset + '.txt',**{'sep':os.sep})
  6. return json.loads(open(path,'r').read())
  7. def save(asset,asset_name):
  8. direct = os.getcwd()
  9. path = '{}{sep}Assets{sep}{}'.format(direct,asset_name + '.txt',**{'sep':os.sep})
  10. file = open(path,'w')
  11. file.write(json.dumps(asset, sort_keys=True,indent=4, separators=(',', ': ')))
  12. print('Saved as: {}'.format(asset_name))
  13. return