Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python2
- # To use: Place in same folder as collection.json and run in terminal
- import json
- SAFE_STORES = ['GOG', 'Humble Store', 'IndieGameStand', 'ShinyLoot']
- data = json.load(file('collection.json'))
- desura_only, desura_other = [], []
- for row in data.values():
- stores = [x['shop'] for x in row['details']]
- stores.sort()
- if 'Desura' not in stores:
- continue # Not Desura
- skip = False
- for store in SAFE_STORES:
- if store in stores:
- skip = True
- if skip:
- continue
- if stores == ['Desura']:
- desura_only.append(row['title'])
- elif stores == ['Desura', 'other']:
- desura_other.append(row['title'])
- desura_only.sort()
- desura_other.sort()
- def print_list(heading, names):
- print "%s:\n\t%s" % (heading, '\n\t'.join(names))
- print_list('Desura only', desura_only)
- print "\n"
- print_list('Desura or Groupees', desura_other)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement