[pygobject: 11/23] setup.py: simplify sys.platform != 'win32' detection and error reporting



commit 286364ed39953e942e24d5911519bcac2f90975a
Author: Dieter Verfaillie <dieterv optionexplicit be>
Date:   Wed Nov 3 09:05:59 2010 +0100

    setup.py: simplify sys.platform != 'win32' detection and error reporting
    
    Signed-off-by: Dieter Verfaillie <dieterv optionexplicit be>

 setup.py |   29 +++++++++--------------------
 1 files changed, 9 insertions(+), 20 deletions(-)
---
diff --git a/setup.py b/setup.py
index 54937bb..cd27456 100755
--- a/setup.py
+++ b/setup.py
@@ -30,20 +30,13 @@ from dsextras import GLOBAL_MACROS, GLOBAL_INC, get_m4_define, getoutput, \
                      PkgConfigExtension, TemplateExtension, \
                      BuildExt, InstallLib, InstallData
 
-if '--yes-i-know-its-not-supported' in sys.argv:
-    sys.argv.remove('--yes-i-know-its-not-supported')
-else:
-    print '*'*70
-    print 'Building PyGObject using distutils is NOT SUPPORTED.'
-    print "It's mainly included to be able to easily build win32 installers"
-    print "You may continue, but only if you agree to not ask any questions"
-    print "To build PyGObject in a supported way, read the INSTALL file"
-    print
-    print "Build fixes are of course welcome and should be filed in bugzilla"
-    print '*'*70
-    input = raw_input('Not supported, ok [y/N]? ')
-    if not input.startswith('y'):
-        raise SystemExit("Aborted")
+
+if sys.platform != 'win32':
+    msg =  '*' * 68 + '\n'
+    msg += '* Building PyGObject using distutils is only supported on windows. *\n'
+    msg += '* To build PyGObject in a supported way, read the INSTALL file.    *\n'
+    msg += '*' * 68
+    raise SystemExit(msg)
 
 MIN_PYTHON_VERSION = (2, 6, 0)
 
@@ -61,12 +54,8 @@ PYGOBJECT_SUFFIX_LONG = 'gtk-' + PYGOBJECT_SUFFIX
 GLOBAL_INC += ['gobject']
 GLOBAL_MACROS += [('PYGOBJECT_MAJOR_VERSION', MAJOR_VERSION),
                   ('PYGOBJECT_MINOR_VERSION', MINOR_VERSION),
-                  ('PYGOBJECT_MICRO_VERSION', MICRO_VERSION)]
-
-if sys.platform == 'win32':
-    GLOBAL_MACROS.append(('VERSION', '\\"%s\\"' % VERSION))
-else:
-    raise SystemExit("Error: distutils build only supported on windows")
+                  ('PYGOBJECT_MICRO_VERSION', MICRO_VERSION),
+                  ('VERSION', '\\"%s\\"' % VERSION)]
 
 if sys.version_info[:3] < MIN_PYTHON_VERSION:
     raise SystemExit("Python %s or higher is required, %s found" % (



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]