1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-14 20:23:54 +03:00

python: samba.param: Port param module to Python 3

Port Python bindings of samba.param module to
Python3-compatible form.

Because native Python file objects are officially
no longer backed by FILE*, API of some _dump()
functions is changed. File argument is now
optional and contains only name of file. Stdout
is default if no file name is specified. Otherwise
opening and closing files is done on C layer
instead of Python.

Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
Lumir Balhar
2016-12-10 13:55:43 +01:00
committed by Andrew Bartlett
parent 035e6dce4f
commit 31cef92cd3
4 changed files with 88 additions and 51 deletions

View File

@@ -102,15 +102,14 @@ class cmd_testparm(Command):
else:
if section_name is not None or parameter_name is not None:
if parameter_name is None:
lp[section_name].dump(sys.stdout, lp.default_service,
verbose)
lp[section_name].dump(verbose)
else:
lp.dump_a_parameter(sys.stdout, parameter_name, section_name)
lp.dump_a_parameter(parameter_name, section_name)
else:
if not suppress_prompt:
self.outf.write("Press enter to see a dump of your service definitions\n")
sys.stdin.readline()
lp.dump(sys.stdout, verbose)
lp.dump(verbose)
if valid:
return
else: