summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-08-01 21:00:09 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-08-01 21:00:09 +0200
commit1c94f3e95da5b520ee631670a30f96e487f12ac8 (patch)
tree0e6533be81e69123ba2a33406fd3336b892eaaad /source4/scripting
parentfff006bd84fc3fd1d9fdd22e3c20110285b2c144 (diff)
downloadsamba-1c94f3e95da5b520ee631670a30f96e487f12ac8.tar.gz
samba-1c94f3e95da5b520ee631670a30f96e487f12ac8.tar.bz2
samba-1c94f3e95da5b520ee631670a30f96e487f12ac8.zip
Use new style python classes.
(This used to be commit 2a39aae0cef310a79427feb1b85f6794ea36849a)
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/samba/provision.py8
-rw-r--r--source4/scripting/python/samba/samba3.py14
-rw-r--r--source4/scripting/python/samba/samr.py8
-rw-r--r--source4/scripting/python/samba/tests/dcerpc/bare.py1
-rw-r--r--source4/scripting/python/samba/tests/dcerpc/registry.py1
-rw-r--r--source4/scripting/python/samba/tests/dcerpc/rpcecho.py2
-rw-r--r--source4/scripting/python/samba/tests/provision.py2
-rw-r--r--source4/scripting/python/samba/tests/samba3.py1
-rw-r--r--source4/scripting/python/subunit/__init__.py2
9 files changed, 27 insertions, 12 deletions
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py
index 6dd9f3b8bd..4f7fbfc6e6 100644
--- a/source4/scripting/python/samba/provision.py
+++ b/source4/scripting/python/samba/provision.py
@@ -53,7 +53,7 @@ class InvalidNetbiosName(Exception):
super(InvalidNetbiosName, self).__init__("The name '%r' is not a valid NetBIOS name" % name)
-class ProvisionPaths:
+class ProvisionPaths(object):
def __init__(self):
self.shareconf = None
self.hklm = None
@@ -77,7 +77,8 @@ class ProvisionPaths:
self.fedoradsinf = None
self.fedoradspartitions = None
-class ProvisionNames:
+
+class ProvisionNames(object):
def __init__(self):
self.rootdn = None
self.domaindn = None
@@ -92,7 +93,8 @@ class ProvisionNames:
self.sitename = None
self.smbconf = None
-class ProvisionResult:
+
+class ProvisionResult(object):
def __init__(self):
self.paths = None
self.domaindn = None
diff --git a/source4/scripting/python/samba/samba3.py b/source4/scripting/python/samba/samba3.py
index c1340b7760..0e0c29dac8 100644
--- a/source4/scripting/python/samba/samba3.py
+++ b/source4/scripting/python/samba/samba3.py
@@ -308,7 +308,7 @@ class ShareInfoDatabase(TdbDatabase):
return secdesc
-class Shares:
+class Shares(object):
"""Container for share objects."""
def __init__(self, lp, shareinfo):
self.lp = lp
@@ -371,7 +371,7 @@ def decode_acb(text):
return ret
-class SAMUser:
+class SAMUser(object):
"""Samba 3 SAM User.
:note: Unknown or unset fields are set to None.
@@ -421,7 +421,8 @@ class SAMUser:
return False
return self.__dict__ == other.__dict__
-class SmbpasswdFile:
+
+class SmbpasswdFile(object):
"""Samba 3 smbpasswd file reader."""
def __init__(self, file):
self.users = {}
@@ -482,7 +483,7 @@ TDBSAM_FORMAT_STRING_V2 = "dddddddBBBBBBBBBBBBddBBBwwdBwwd"
TDBSAM_USER_PREFIX = "USER_"
-class LdapSam:
+class LdapSam(object):
"""Samba 3 LDAP passdb backend reader."""
def __init__(self, url):
self.ldap_url = ldap_url
@@ -605,7 +606,7 @@ def shellsplit(text):
return ret
-class WinsDatabase:
+class WinsDatabase(object):
"""Samba 3 WINS database reader."""
def __init__(self, file):
self.entries = {}
@@ -643,7 +644,8 @@ class WinsDatabase:
def close(self): # for consistency
pass
-class Samba3:
+
+class Samba3(object):
"""Samba 3 configuration and state data reader."""
def __init__(self, libdir, smbconfpath):
"""Open the configuration and data for a Samba 3 installation.
diff --git a/source4/scripting/python/samba/samr.py b/source4/scripting/python/samba/samr.py
index 314f78b8ad..62a7c6eb3d 100644
--- a/source4/scripting/python/samba/samr.py
+++ b/source4/scripting/python/samba/samr.py
@@ -97,7 +97,8 @@ def call_fn(fn, pipe, args):
return result;
-class SamrHandle:
+
+class SamrHandle(object):
def __init__(self, pipe, handle):
@@ -137,6 +138,7 @@ class SamrHandle:
call_fn(dcerpc.dcerpc_samr_SetSecurity, self.pipe, r)
+
class ConnectHandle(SamrHandle):
def EnumDomains(self):
@@ -212,6 +214,7 @@ class ConnectHandle(SamrHandle):
call_fn(dcerpc.dcerpc_samr_SetBootKeyInformation, self.pipe, r)
+
class DomainHandle(SamrHandle):
def QueryDomainInfo(self, level = 2):
@@ -517,6 +520,7 @@ class DomainHandle(SamrHandle):
call_fn(dcerpc.dcerpc_samr_TestPrivateFunctionsDomain, self.pipe, r)
+
class UserHandle(SamrHandle):
def DeleteUser(self):
@@ -576,6 +580,7 @@ class UserHandle(SamrHandle):
call_fn(dcerpc.dcerpc_samr_TestPrivateFunctionsUser, self.pipe, r)
+
class GroupHandle(SamrHandle):
def QueryGroupInfo(self, level):
@@ -608,6 +613,7 @@ class GroupHandle(SamrHandle):
dcerpc.uint32_array_getitem(r.data_out.rids.unknown, x))
for x in range(r.data_out.rids.count)]
+
class AliasHandle(SamrHandle):
def DeleteDomAlias(self):
diff --git a/source4/scripting/python/samba/tests/dcerpc/bare.py b/source4/scripting/python/samba/tests/dcerpc/bare.py
index fae699a249..cd939b8098 100644
--- a/source4/scripting/python/samba/tests/dcerpc/bare.py
+++ b/source4/scripting/python/samba/tests/dcerpc/bare.py
@@ -22,6 +22,7 @@ from samba.dcerpc import ClientConnection
from unittest import TestCase
from samba.tests import cmdline_loadparm
+
class BareTestCase(TestCase):
def test_bare(self):
# Connect to the echo pipe
diff --git a/source4/scripting/python/samba/tests/dcerpc/registry.py b/source4/scripting/python/samba/tests/dcerpc/registry.py
index 81133ff641..526b2340cc 100644
--- a/source4/scripting/python/samba/tests/dcerpc/registry.py
+++ b/source4/scripting/python/samba/tests/dcerpc/registry.py
@@ -21,6 +21,7 @@ from samba.dcerpc import winreg
import unittest
from samba.tests import RpcInterfaceTestCase
+
class WinregTests(RpcInterfaceTestCase):
def setUp(self):
self.conn = winreg.winreg("ncalrpc:", self.get_loadparm(),
diff --git a/source4/scripting/python/samba/tests/dcerpc/rpcecho.py b/source4/scripting/python/samba/tests/dcerpc/rpcecho.py
index 96bb3923a6..12638e2397 100644
--- a/source4/scripting/python/samba/tests/dcerpc/rpcecho.py
+++ b/source4/scripting/python/samba/tests/dcerpc/rpcecho.py
@@ -22,6 +22,7 @@ from samba.ndr import ndr_pack, ndr_unpack
import unittest
from samba.tests import RpcInterfaceTestCase
+
class RpcEchoTests(RpcInterfaceTestCase):
def setUp(self):
self.conn = echo.rpcecho("ncalrpc:", self.get_loadparm())
@@ -56,6 +57,7 @@ class RpcEchoTests(RpcInterfaceTestCase):
def test_server_name(self):
self.assertEquals(None, self.conn.server_name)
+
class NdrEchoTests(unittest.TestCase):
def test_info1_push(self):
x = echo.info1()
diff --git a/source4/scripting/python/samba/tests/provision.py b/source4/scripting/python/samba/tests/provision.py
index 76c10145f0..352357f694 100644
--- a/source4/scripting/python/samba/tests/provision.py
+++ b/source4/scripting/python/samba/tests/provision.py
@@ -87,7 +87,7 @@ class FindNssTests(unittest.TestCase):
self.assertEquals("ha", findnss(x, ["bloe", "bla"]))
-class Disabled:
+class Disabled(object):
def test_setup_templatesdb(self):
raise NotImplementedError(self.test_setup_templatesdb)
diff --git a/source4/scripting/python/samba/tests/samba3.py b/source4/scripting/python/samba/tests/samba3.py
index 175aa90497..1755cbdcf0 100644
--- a/source4/scripting/python/samba/tests/samba3.py
+++ b/source4/scripting/python/samba/tests/samba3.py
@@ -153,6 +153,7 @@ class WinsDatabaseTestCase(unittest.TestCase):
def tearDown(self):
self.winsdb.close()
+
class SmbpasswdTestCase(unittest.TestCase):
def setUp(self):
self.samdb = SmbpasswdFile(os.path.join(DATADIR, "smbpasswd"))
diff --git a/source4/scripting/python/subunit/__init__.py b/source4/scripting/python/subunit/__init__.py
index ac3d0c3a40..406cd8765b 100644
--- a/source4/scripting/python/subunit/__init__.py
+++ b/source4/scripting/python/subunit/__init__.py
@@ -376,7 +376,7 @@ def run_isolated(klass, self, result):
return result
-class SubunitTestRunner:
+class SubunitTestRunner(object):
def __init__(self, stream=sys.stdout):
self.stream = stream