moneyguru /

Full commit
# Created By: Virgil Dupras
# Created On: 2009-12-30
# Copyright 2012 Hardcoded Software (
# This software is licensed under the "BSD" License as described in the "LICENSE" file, 
# which should be included with this package. The terms are also available at 

from optparse import OptionParser
import json

from hscommon.plat import ISOSX

def main(ui, dev):
    if ui not in ('cocoa', 'qt'):
        ui = 'cocoa' if ISOSX else 'qt'
    build_type = 'Dev' if dev else 'Release'
    print("Configuring moneyGuru for UI {0} ({1})".format(ui, build_type))
    conf = {
        'ui': ui,
        'dev': dev,
    json.dump(conf, open('conf.json', 'w'))

if __name__ == '__main__':
    usage = "usage: %prog [options]"
    parser = OptionParser(usage=usage)
    parser.add_option('--ui', dest='ui',
        help="Type of UI to build. 'qt' or 'cocoa'. Default is determined by your system.")
    parser.add_option('--dev', action='store_true', dest='dev', default=False,
        help="If this flag is set, will configure for dev builds.")
    (options, args) = parser.parse_args()