Commit 09d28305 authored by Christophe Benz's avatar Christophe Benz

do not use optparse since it does not allow foreign options

parent 12cc7cd0
......@@ -22,7 +22,6 @@ from __future__ import with_statement
from setuptools import find_packages, setup
import glob
from optparse import OptionParser
import os
import subprocess
import sys
......@@ -62,12 +61,35 @@ def install_xdg():
os.system('xdg-icon-resource install --size 64 --novendor %s' % filepath)
option_parser = OptionParser()
option_parser.add_option('--xdg', action='store_true', default=True, help='Install desktop files and icons')
option_parser.add_option('--no-xdg', action='store_false', dest='xdg', help='Don\'t install desktop files and icons')
option_parser.add_option('--qt', action='store_true', default=True, help='Install Qt applications')
option_parser.add_option('--no-qt', action='store_false', dest='qt', help='Don\'t install Qt applications')
options, sys.argv = option_parser.parse_args(sys.argv)
class Options:
options = Options()
options.qt = True
options.xdg = True
args = list(sys.argv)
if '--qt' in args and '--no-qt' in args:
print '--qt and --no-qt options are incompatible'
if '--xdg' in args and '--no-xdg' in args:
print '--xdg and --no-xdg options are incompatible'
if '--qt' in args:
options.qt = True
elif '--no-qt' in args:
options.qt = False
if '--xdg' in args:
options.xdg = True
elif '--no-xdg' in args:
options.xdg = False
sys.argv = args
qt_scripts = ('qboobmsg', 'qhavesex', 'qvideoob', 'weboob-config-qt')
scripts = os.listdir('scripts')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment