diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-04-21 12:06:04 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-04-21 12:06:04 +0200 |
commit | f128bfd44988a4db90222e7d5af5ab94337a065d (patch) | |
tree | 8f3c4042b7ccfcc618ff4f09ee4dd9b0db11070d /source4/librpc | |
parent | 6f60a6e71aa9b734ec80865f598ff302d45f2bf3 (diff) | |
download | samba-f128bfd44988a4db90222e7d5af5ab94337a065d.tar.gz samba-f128bfd44988a4db90222e7d5af5ab94337a065d.tar.bz2 samba-f128bfd44988a4db90222e7d5af5ab94337a065d.zip |
Add str() for policy_handles.
Pair programmed with Jelmer
Diffstat (limited to 'source4/librpc')
-rw-r--r-- | source4/librpc/ndr/py_misc.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source4/librpc/ndr/py_misc.c b/source4/librpc/ndr/py_misc.c index b56c355fc3..5d5b881b38 100644 --- a/source4/librpc/ndr/py_misc.c +++ b/source4/librpc/ndr/py_misc.c @@ -115,7 +115,16 @@ static PyObject *py_policy_handle_repr(PyObject *py_self) { struct policy_handle *self = py_talloc_get_ptr(py_self); char *uuid_str = GUID_string(NULL, &self->uuid); - PyObject *ret = PyString_FromFormat("policy_handle('%s', %d)", uuid_str, self->handle_type); + PyObject *ret = PyString_FromFormat("policy_handle(%d, '%s')", self->handle_type, uuid_str); + talloc_free(uuid_str); + return ret; +} + +static PyObject *py_policy_handle_str(PyObject *py_self) +{ + struct policy_handle *self = py_talloc_get_ptr(py_self); + char *uuid_str = GUID_string(NULL, &self->uuid); + PyObject *ret = PyString_FromFormat("%d, %s", self->handle_type, uuid_str); talloc_free(uuid_str); return ret; } @@ -124,6 +133,7 @@ static void py_policy_handle_patch(PyTypeObject *type) { type->tp_init = py_policy_handle_init; type->tp_repr = py_policy_handle_repr; + type->tp_str = py_policy_handle_str; } #define PY_POLICY_HANDLE_PATCH py_policy_handle_patch |