[gnue] r9935 - trunk/gnue-common/src/base

[email protected]
Newsgroups gmane.comp.cms.gnue.cvs
Message-ID <[email protected]>
Author: reinhard
Date: 2009-10-06 08:21:45 -0500 (Tue, 06 Oct 2009)
New Revision: 9935

Modified:
   trunk/gnue-common/src/base/setup.py
   trunk/gnue-common/src/base/version.py
Log:
Some minor improvements hinted by pylint.


Modified: trunk/gnue-common/src/base/setup.py
===================================================================
--- trunk/gnue-common/src/base/setup.py	2009-10-06 13:01:35 UTC (rev 9934)
+++ trunk/gnue-common/src/base/setup.py	2009-10-06 13:21:45 UTC (rev 9935)
@@ -155,7 +155,7 @@
 # Global Setup instance
 # -----------------------------------------------------------------------------
 
-_setup = None
+SETUP = None
 
 # =============================================================================
 # Create a source distribution
@@ -183,7 +183,7 @@
         Run the sdist command.
         """
 
-        _setup.build_files('sdist')
+        SETUP.build_files('sdist')
         distutils.command.sdist.sdist.run(self)
 
 
@@ -212,7 +212,7 @@
 
         distutils.command.sdist.sdist.make_release_tree(self, base_dir, files)
         self.__process_templates(base_dir)
-        _setup.build_svnrev(os.path.join(base_dir, 'src', 'svnrev.py'))
+        SETUP.build_svnrev(os.path.join(base_dir, 'src', 'svnrev.py'))
 
 
     # -------------------------------------------------------------------------
@@ -310,13 +310,13 @@
         """
 
         if not os.path.isfile("PKG-INFO"):         # downloaded from SVN?
-            _setup.build_files('build')
+            SETUP.build_files('build')
 
         distutils.command.build.build.run(self)
 
         if not os.path.isfile("PKG-INFO"):
-            _setup.build_svnrev(os.path.join(self.build_lib, 'gnue',
-                  _setup.name[5:].lower(), 'svnrev.py'))
+            SETUP.build_svnrev(os.path.join(self.build_lib, 'gnue',
+                  SETUP.name[5:].lower(), 'svnrev.py'))
 
 
 # =============================================================================
@@ -391,7 +391,7 @@
         Run the install command.
         """
 
-        _setup.check_dependencies()
+        SETUP.check_dependencies()
 
         self.__outputs = []
 
@@ -404,7 +404,7 @@
                     dst = os.path.join(self.install_data, 'share', 'locale',
                             fname[:-4], 'LC_MESSAGES')
                     self.mkpath(dst)
-                    dst = os.path.join(dst, _setup.name + '.mo')
+                    dst = os.path.join(dst, SETUP.name + '.mo')
                     self.copy_file(src, dst)
                     self.__outputs.append(dst)
 
@@ -572,8 +572,8 @@
         """
 
         # Set global variable.
-        global _setup
-        _setup = self
+        global SETUP
+        SETUP = self
 
         # Decprecated method to set parameters in a dictionary.
         if self.__class__.__dict__.has_key('set_params'):

Modified: trunk/gnue-common/src/base/version.py
===================================================================
--- trunk/gnue-common/src/base/version.py	2009-10-06 13:01:35 UTC (rev 9934)
+++ trunk/gnue-common/src/base/version.py	2009-10-06 13:21:45 UTC (rev 9935)
@@ -262,6 +262,19 @@
 # =============================================================================
 
 if __name__ == '__main__':
-    version = Version(1, 5, 'beta', 3, None)
-    print version.get_version()
-    print version.get_hexversion()
+
+    # -------------------------------------------------------------------------
+    # Version class
+    # -------------------------------------------------------------------------
+
+    def __test_version():
+        version = Version(1, 5, 'beta', 3, None)
+        print version.get_version()
+        print version.get_hexversion()
+
+
+    # -------------------------------------------------------------------------
+    # Call all tests
+    # -------------------------------------------------------------------------
+
+    __test_version()
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.