add --hildon and --no-hildon options
This commit is contained in:
parent
d81f5dac7a
commit
d0ff662b05
1 changed files with 19 additions and 0 deletions
19
setup.py
19
setup.py
|
|
@ -65,10 +65,14 @@ class Options:
|
|||
pass
|
||||
|
||||
options = Options()
|
||||
options.hildon = False
|
||||
options.qt = True
|
||||
options.xdg = True
|
||||
|
||||
args = list(sys.argv)
|
||||
if '--hildon' in args and '--no-hildon' in args:
|
||||
print '--hildon and --no-hildon options are incompatible'
|
||||
sys.exit(1)
|
||||
if '--qt' in args and '--no-qt' in args:
|
||||
print '--qt and --no-qt options are incompatible'
|
||||
sys.exit(1)
|
||||
|
|
@ -76,6 +80,13 @@ if '--xdg' in args and '--no-xdg' in args:
|
|||
print '--xdg and --no-xdg options are incompatible'
|
||||
sys.exit(1)
|
||||
|
||||
if '--hildon' in args:
|
||||
options.hildon = True
|
||||
args.remove('--hildon')
|
||||
elif '--no-hildon' in args:
|
||||
options.hildon = False
|
||||
args.remove('--no-hildon')
|
||||
|
||||
if '--qt' in args:
|
||||
options.qt = True
|
||||
args.remove('--qt')
|
||||
|
|
@ -91,14 +102,20 @@ elif '--no-xdg' in args:
|
|||
args.remove('--no-xdg')
|
||||
sys.argv = args
|
||||
|
||||
hildon_scripts = ('masstransit',)
|
||||
qt_scripts = ('qboobmsg', 'qhavesex', 'qvideoob', 'weboob-config-qt')
|
||||
scripts = os.listdir('scripts')
|
||||
|
||||
if not options.hildon:
|
||||
scripts = set(scripts) - set(hildon_scripts)
|
||||
if options.qt:
|
||||
build_qt()
|
||||
else:
|
||||
scripts = set(scripts) - set(qt_scripts)
|
||||
|
||||
hildon_packages = (
|
||||
'weboob.applications.masstransit',
|
||||
)
|
||||
qt_packages = (
|
||||
'weboob.applications.qboobmsg',
|
||||
'weboob.applications.qboobmsg.ui',
|
||||
|
|
@ -111,6 +128,8 @@ qt_packages = (
|
|||
)
|
||||
packages = find_packages()
|
||||
|
||||
if not options.hildon:
|
||||
packages = set(packages) - set(hildon_packages)
|
||||
if not options.qt:
|
||||
packages = set(packages) - set(qt_packages)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue