diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2011-09-13 01:27:50 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2011-09-13 03:51:13 +0200 |
commit | 0ee22a2dec1716e0d5c0a6aee612f635800af5ef (patch) | |
tree | aafed35c9f424a95da86652740a33b31f2bc6076 /source4/scripting/python/samba/getopt.py | |
parent | df1d3dc777b48bc9bc10f3eb44dec90db490a899 (diff) | |
download | samba-0ee22a2dec1716e0d5c0a6aee612f635800af5ef.tar.gz samba-0ee22a2dec1716e0d5c0a6aee612f635800af5ef.tar.xz samba-0ee22a2dec1716e0d5c0a6aee612f635800af5ef.zip |
s4-python: Fix some formatting issues.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Tue Sep 13 03:51:13 CEST 2011 on sn-devel-104
Diffstat (limited to 'source4/scripting/python/samba/getopt.py')
-rw-r--r-- | source4/scripting/python/samba/getopt.py | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/source4/scripting/python/samba/getopt.py b/source4/scripting/python/samba/getopt.py index 671142b552e..0ab1e9e46f1 100644 --- a/source4/scripting/python/samba/getopt.py +++ b/source4/scripting/python/samba/getopt.py @@ -21,7 +21,8 @@ __docformat__ = "restructuredText" -import optparse, os +import optparse +import os from samba.credentials import ( Credentials, DONT_USE_KERBEROS, @@ -44,7 +45,8 @@ class SambaOptions(optparse.OptionGroup): type=int, metavar="DEBUGLEVEL", help="debug level", callback=self._set_debuglevel) self.add_option("--option", action="callback", - type=str, metavar="OPTION", help="set smb.conf option from command line", + type=str, metavar="OPTION", + help="set smb.conf option from command line", callback=self._set_option) self.add_option("--realm", action="callback", type=str, metavar="REALM", help="set the realm name", @@ -53,7 +55,7 @@ class SambaOptions(optparse.OptionGroup): self._lp = LoadParm() def get_loadparm_path(self): - """Return the path to the smb.conf file specified on the command line. """ + """Return path to the smb.conf file specified on the command line.""" return self._configfile def _load_configfile(self, option, opt_str, arg, parser): @@ -73,7 +75,7 @@ class SambaOptions(optparse.OptionGroup): self._lp.set(a[0], a[1]) def get_loadparm(self): - """Return a loadparm object with data specified on the command line. """ + """Return loadparm object with data specified on the command line.""" if self._configfile is not None: self._lp.load(self._configfile) elif os.getenv("SMB_CONF_PATH") is not None: @@ -124,7 +126,8 @@ class CredentialsOptions(optparse.OptionGroup): help="Use Kerberos", callback=self._set_kerberos) self.add_option("", "--ipaddress", metavar="IPADDRESS", action="callback", type=str, - help="IP address of server", callback=self._set_ipaddress) + help="IP address of server", + callback=self._set_ipaddress) self.creds = Credentials() def _parse_username(self, option, opt_str, arg, parser): @@ -171,6 +174,7 @@ class CredentialsOptions(optparse.OptionGroup): return self.creds + class CredentialsOptionsDouble(CredentialsOptions): """Command line options for specifying credentials of two servers.""" def __init__(self, parser): @@ -180,13 +184,16 @@ class CredentialsOptionsDouble(CredentialsOptions): callback=self._set_simple_bind_dn2, type=str, help="DN to use for a simple bind") self.add_option("--password2", metavar="PASSWORD2", action="callback", - help="Password", type=str, callback=self._set_password2) + help="Password", type=str, + callback=self._set_password2) self.add_option("--username2", metavar="USERNAME2", action="callback", type=str, - help="Username for second server", callback=self._parse_username2) + help="Username for second server", + callback=self._parse_username2) self.add_option("--workgroup2", metavar="WORKGROUP2", action="callback", type=str, - help="Workgroup for second server", callback=self._parse_workgroup2) + help="Workgroup for second server", + callback=self._parse_workgroup2) self.add_option("--no-pass2", action="store_true", help="Don't ask for a password for the second server") self.add_option("--kerberos2", metavar="KERBEROS2", |