-
Notifications
You must be signed in to change notification settings - Fork 49
/
configure.py
executable file
·33 lines (29 loc) · 1.13 KB
/
configure.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python3
# Created By: Virgil Dupras
# Created On: 2011-06-18
# Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPL v3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/gplv3_license
from argparse import ArgumentParser
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 PdfMasher for UI {0} ({1})".format(ui, build_type))
conf = {
'ui': ui,
'dev': dev,
}
json.dump(conf, open('conf.json', 'w'))
if __name__ == '__main__':
parser = ArgumentParser()
parser.add_argument('--ui', dest='ui',
help="Type of UI to build. 'qt' or 'cocoa'. Default is determined by your system.")
parser.add_argument('--dev', action='store_true', dest='dev', default=False,
help="If this flag is set, will configure for dev builds.")
args = parser.parse_args()
main(args.ui, args.dev)