summaryrefslogtreecommitdiff
path: root/python/samba/common.py
AgeCommit message (Collapse)AuthorFilesLines
2025-08-07py/common: add cmp_with_nones() helper functionDouglas Bagnall1-0/+17
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2025-08-07py:common: normalise_int32 checks bit sizeDouglas Bagnall1-1/+4
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2024-05-31python/common: remove verbiage about old python versionsDouglas Bagnall1-13/+2
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-12-15python: pep257: docstring should use double quotesRob van der Linde1-1/+1
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-03-03python/samba/common: Fix typosJoseph Sutton1-2/+2
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-10-02python2 reduction: Merge remaining compat code into commonDavid Mulder1-7/+45
The remaining compat code (get_string, get_bytes, cmp) are useful helper routines which we should simply merge into common (especially since there is some duplication here). Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): David Mulder <dmulder@samba.org> Autobuild-Date(master): Fri Oct 2 14:49:36 UTC 2020 on sn-devel-184
2020-10-02python: Move dsdb_Dn to samdbDavid Mulder1-79/+0
The import dsdb needed for dsdb_Dn causes import errors when trying to import get_bytes/get_string in some places. Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-11-01python: avoid useless work in dsdb_Dn.__cmp__Douglas Bagnall1-2/+0
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <noel.power@suse.com>
2018-10-25python/samba/common: py3 compat raw_inputDouglas Bagnall1-0/+2
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2018-08-24PEP8: fix E226: missing whitespace around arithmetic operatorJoe Guo1-1/+1
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E123: closing bracket does not match indentation of opening ↵Joe Guo1-1/+1
bracket's line Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-04-05selftest: enable py3 for samba.tests.commonJoe Guo1-0/+27
fix dsdb_Dn comparison for Python 3 In Python 3, the builtin `cmp` funtion was dropped. And the `__cmp__` magic method in object is no longer honored, which is replaced by 6 new methods: __eq__, __ne__, __lt__, __le__, __gt__, __ge__. This caused `tests.CommonTests` failed with `py3_compatiable=True`. Fixed by adding the above methods. Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-02-15python: Port samdb module to Python 3 compatible formLumir Balhar1-1/+1
Signed-off-by: Lumir Balhar <lbalhar@redhat.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-02-05python/common: add __cmp__ function to dsdb_Dn similar to parsed_dn_compare()Stefan Metzmacher1-0/+17
Linked attribute values are sorted by objectGUID of the link target. For C code we have parsed_dn_compare() to implement the logic, the same is now available on python dsdb_Dn objects. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13228 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2017-03-13python/dsdb_dn: Add a generic get_bytes method on DNsGarming Sam1-0/+5
Pair-programmed-with: Bob Campbell <bobcampbell@catalyst.net.nz> Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-03-04scripting: Correct parsing of binary DNAndrew Bartlett1-1/+1
The DN is of the form B:8:01020304:DC=samba,DC=example,DC=com. We need to account for the case where the 8 is actually (say) 16, and so not just one character. Andrew Bartlett Signed-off-by: Stefan Metzmacher <metze@samba.org>
2013-03-02Move python modules from source4/scripting/python/ to python/.Jelmer Vernooij1-0/+99
Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sat Mar 2 03:57:34 CET 2013 on sn-devel-104