commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r7073 - trunk/gnue-common/src/setup


From: jamest
Subject: [gnue] r7073 - trunk/gnue-common/src/setup
Date: Wed, 2 Mar 2005 08:21:43 -0600 (CST)

Author: jamest
Date: 2005-03-02 08:21:42 -0600 (Wed, 02 Mar 2005)
New Revision: 7073

Modified:
   trunk/gnue-common/src/setup/GSetup.py
Log:
first attempt at making GSetup less gnue specific


Modified: trunk/gnue-common/src/setup/GSetup.py
===================================================================
--- trunk/gnue-common/src/setup/GSetup.py       2005-03-02 11:37:28 UTC (rev 
7072)
+++ trunk/gnue-common/src/setup/GSetup.py       2005-03-02 14:21:42 UTC (rev 
7073)
@@ -158,7 +158,7 @@
 # =============================================================================
 
 class GSetup:
-  
+    
   # ---------------------------------------------------------------------------
   # Abstract methods: setup.py scripts generally override these
   # ---------------------------------------------------------------------------
@@ -212,35 +212,35 @@
         print "building translations"
         if os.system ("cd po && make update-po gmo") != 0:
           sys.exit (1)
-
-    else:
-      # on non posix systems just run msgfmt on existing .po files
-      if os.path.isdir ('po'):
-        # msgfmt.py
-        argv0_path = os.path.dirname(os.path.abspath(sys.executable))
-        sys.path.append(argv0_path + "\\tools\\i18n")
-      
-        msgfmtOK = 0
-        try:
-          import msgfmt
-          msgfmtOK = 1
-        except:
+
+    else:
+      # on non posix systems just run msgfmt on existing .po files
+      if os.path.isdir ('po'):
+        # msgfmt.py
+        argv0_path = os.path.dirname(os.path.abspath(sys.executable))
+        sys.path.append(argv0_path + "\\tools\\i18n")
+      
+        msgfmtOK = 0
+        try:
+          import msgfmt
+          msgfmtOK = 1
+        except:
           pass
-      
-        if msgfmtOK == 1:
-          # pygettext.py exist in Python, but no msgmerge, so
-          # just create a placeholder...
-          potfile = open('po/'+ self.package +'.pot', 'w')
-          potfile.write("#placeholder")
+      
+        if msgfmtOK == 1:
+          # pygettext.py exist in Python, but no msgmerge, so
+          # just create a placeholder...
+          potfile = open('po/'+ self.package +'.pot', 'w')
+          potfile.write("#placeholder")
           potfile.close()
-
+
           # build translations
-          print "building translations"
-          for f in os.listdir('po'):
-            if f[-3:] == '.po':
-              print f
-              msgfmt.make ('po/'+f, 'po/'+f[:-3]+'.gmo')
-              msgfmt.MESSAGES = {}
+          print "building translations"
+          for f in os.listdir('po'):
+            if f[-3:] == '.po':
+              print f
+              msgfmt.make ('po/'+f, 'po/'+f[:-3]+'.gmo')
+              msgfmt.MESSAGES = {}
 
     # -------------------------------------------------------------------------
 
@@ -283,16 +283,21 @@
     # set global variable
     _setup = self
 
+    setup_params = {"cmdclass_sdist": sdist,
+                    "cmdclass_build": build,
+                    "cmdclass_install": install,
+                    "suffix_var" : 'GNUE_VERSION_SUFFIX'
+                   }
+
+    _setup.set_params (setup_params)
+    
     # handle version suffix
     try:
-      suffix = os.environ['GNUE_VERSION_SUFFIX']
+      suffix = os.environ[setup_params['suffix_var']]
     except KeyError:
       suffix = ""
 
-    setup_params = {}
 
-    _setup.set_params (setup_params)
-
     # find out all packages
     if not setup_params.has_key ("packages"):
       packages = []
@@ -326,6 +331,6 @@
            data_files       = setup_params ["data_files"],
 
            # Override certain command classes with our own ones
-           cmdclass = {"sdist": sdist,
-                       "build": build,
-                       "install": install})
+           cmdclass = {"sdist":   setup_params["cmdclass_sdist"],
+                       "build":   setup_params["cmdclass_build"],
+                       "install": setup_params["cmdclass_install"]})





reply via email to

[Prev in Thread] Current Thread [Next in Thread]