changeset 58:6732437eb2ac MySQLdb

Minor tidy of whitespace and extra import
author kylev
date Sat, 28 Feb 2009 08:03:32 +0000
parents 9ea2b0e9302e
children 5db99d9be0fb
files setup_posix.py
diffstat 1 files changed, 11 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/setup_posix.py	Sat Feb 28 04:06:44 2009 +0000
+++ b/setup_posix.py	Sat Feb 28 08:03:32 2009 +0000
@@ -1,9 +1,10 @@
-from ConfigParser import SafeConfigParser
-
-# This dequote() business is required for some older versions
-# of mysql_config
+import os
+import sys
 
 def dequote(s):
+    """This dequote() business is required for some older versions of
+    mysql_config.
+    """
     if s[0] in "\"'" and s[0] == s[-1]:
         s = s[1:-1]
     return s
@@ -12,9 +13,7 @@
     return "-%s" % f
 
 def mysql_config(what):
-    from os import popen
-    
-    f = popen("%s --%s" % (mysql_config.path, what))
+    f = os.popen("%s --%s" % (mysql_config.path, what))
     data = f.read().strip().split()
     ret = f.close()
     if ret:
@@ -26,14 +25,13 @@
 mysql_config.path = "mysql_config"
 
 def get_config():
-    import os, sys
     from setup_common import get_metadata_and_options, enabled, create_release_file
 
     metadata, options = get_metadata_and_options()
 
     if 'mysql_config' in options:
         mysql_config.path = options['mysql_config']
-        
+
     extra_objects = []
     static = enabled(options, 'static')
     if enabled(options, 'embedded'):
@@ -51,7 +49,7 @@
 
     library_dirs = [ dequote(i[2:]) for i in libs if i.startswith(compiler_flag("L")) ]
     libraries = [ dequote(i[2:]) for i in libs if i.startswith(compiler_flag("l")) ]
-    
+
     removable_compile_args = [ compiler_flag(f) for f in "ILl" ]
     extra_compile_args = [ i.replace("%", "%%") for i in mysql_config("cflags")
                            if i[:2] not in removable_compile_args ]
@@ -62,16 +60,16 @@
         include_dirs = [ dequote(i[2:])
                          for i in mysql_config('cflags')
                          if i.startswith(compiler_flag('I')) ]
-    
+
     if static:
         extra_objects.append(os.path.join(
             library_dirs[0],'lib%s.a' % client))
-        
+
     name = "MySQL-python"
     if enabled(options, 'embedded'):
         name = name + "-embedded"
     metadata['name'] = name
-    
+
     define_macros = [
         ('version_info', metadata['version_info']),
         ('__version__', metadata['version']),
@@ -91,4 +89,3 @@
 
 if __name__ == "__main__":
     print """You shouldn't be running this directly; it is used by setup.py."""
-