s4-python-samba: Fix few cosmetics
authorKamen Mazdrashki <kamenim@samba.org>
Tue, 28 Sep 2010 22:09:09 +0000 (01:09 +0300)
committerKamen Mazdrashki <kamenim@samba.org>
Sat, 2 Oct 2010 22:24:55 +0000 (01:24 +0300)
- we have sys module already imported
- _glue module is part of samba package so be more precise how to import

source4/scripting/python/samba/__init__.py

index fb71110600c2961d4dfc2eedaeb86c9222b70678..f698b9a6a6748d79b1f38daacb64122fc0e5aa31 100644 (file)
@@ -92,7 +92,7 @@ class Ldb(_Ldb):
         self.register_samba_handlers()
 
         # TODO set debug
-        def msg(l,text):
+        def msg(l, text):
             print text
         #self.set_debug(msg)
 
@@ -215,7 +215,7 @@ class Ldb(_Ldb):
         """
         for changetype, msg in self.parse_ldif(ldif):
             assert changetype == ldb.CHANGETYPE_NONE
-            self.add(msg,controls)
+            self.add(msg, controls)
 
     def modify_ldif(self, ldif, controls=None):
         """Modify database based on a LDIF string.
@@ -312,7 +312,6 @@ def ensure_external_module(modulename, location):
     try:
         __import__(modulename)
     except ImportError:
-        import sys
         if _in_source_tree():
             sys.path.insert(0, 
                 os.path.join(os.path.dirname(__file__),
@@ -322,7 +321,7 @@ def ensure_external_module(modulename, location):
             sys.modules[modulename] = __import__(
                 "samba.external.%s" % modulename, fromlist=["samba.external"])
 
-import _glue
+from samba import _glue
 version = _glue.version
 interface_ips = _glue.interface_ips
 set_debug_level = _glue.set_debug_level