Python: Difference between revisions
From SambaWiki
(add some details about the Python support) |
|||
(11 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
[[Python/Debugging|Debugging]] |
|||
We're currently using our own Python binary (``smbpython``) which is linked against the Python libraries and includes built-in bindings for several Samba libraries. It also sets up the path Python uses to find Python modules automatically when you are running it from inside of the Samba source directory. |
|||
⚫ | |||
Using the system-provided Python should also be possible in the future, but will require the following changes when doing so: |
|||
== LDB == |
|||
* We need to set sys.path somehow so python can find our modules when running inside of the source tree |
|||
* We need to build .so version of the Samba Python modules |
|||
LDB is the database engine used in Samba4. For further information see [http://ldb.samba.org/]. |
|||
The latter requires some changes to the build system, so it may be useful to wait until we've switched to an alternative build system. |
|||
Installing in debian/ubuntu: |
|||
⚫ | |||
apt-get install python-ldb |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
== samba.tests == |
|||
[[Writing_Python_Tests|Tests written in Python]] should be under this namespace. This includes both unit and integration tests. |
|||
== samba.dcerpc == |
|||
All RPC protocols have python bindings avaiable generated by [[PIDL]] and exposed as '''samba.dcerpc.''protocol''''' |
|||
⚫ | |||
There is some other modules, we need to describe them there. |
|||
=Python3= |
|||
Samba and the libraries [[TDB]] [https://talloc.samba.org talloc] [[LDB|ldb]] have both Python and [[Python3]] modules. |
|||
More detail on the progress to shipping [[Python3|Samba with Python3]] is on that page |
|||
* ldb |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ |
Latest revision as of 07:24, 26 January 2018
Available modules
LDB
LDB is the database engine used in Samba4. For further information see [1].
Installing in debian/ubuntu:
apt-get install python-ldb
tdb
samba.registry
samba.param (loadparm)
samba.credentials
samba.tests
Tests written in Python should be under this namespace. This includes both unit and integration tests.
samba.dcerpc
All RPC protocols have python bindings avaiable generated by PIDL and exposed as samba.dcerpc.protocol
...
There is some other modules, we need to describe them there.
Python3
Samba and the libraries TDB talloc ldb have both Python and Python3 modules.
More detail on the progress to shipping Samba with Python3 is on that page