diff options
| author | Nicolas Clapies <nclapies@entrouvert.com> | 2004-07-29 14:08:31 +0000 |
|---|---|---|
| committer | Nicolas Clapies <nclapies@entrouvert.com> | 2004-07-29 14:08:31 +0000 |
| commit | e8228dc6e7bf5b14b91c5de78934c9c601a9fc7a (patch) | |
| tree | 7ffe3b173bfcb0ea6eed780d43ee4e61c4206c0c /python | |
| parent | 9c435c70966cecdfdee1f7d45c13696c9698486b (diff) | |
| download | lasso-e8228dc6e7bf5b14b91c5de78934c9c601a9fc7a.tar.gz lasso-e8228dc6e7bf5b14b91c5de78934c9c601a9fc7a.tar.xz lasso-e8228dc6e7bf5b14b91c5de78934c9c601a9fc7a.zip | |
update of register name identifier
Diffstat (limited to 'python')
| -rw-r--r-- | python/environs/py_register_name_identifier.c | 9 | ||||
| -rw-r--r-- | python/lasso.py | 82 | ||||
| -rw-r--r-- | python/lassomod.c | 19 | ||||
| -rw-r--r-- | python/protocols/py_register_name_identifier_request.c | 37 | ||||
| -rw-r--r-- | python/protocols/py_register_name_identifier_request.h | 6 | ||||
| -rw-r--r-- | python/protocols/py_register_name_identifier_response.c | 91 | ||||
| -rw-r--r-- | python/protocols/py_register_name_identifier_response.h | 8 |
7 files changed, 68 insertions, 184 deletions
diff --git a/python/environs/py_register_name_identifier.c b/python/environs/py_register_name_identifier.c index 0b57bf89..fa25924d 100644 --- a/python/environs/py_register_name_identifier.c +++ b/python/environs/py_register_name_identifier.c @@ -71,19 +71,18 @@ PyObject *register_name_identifier_getattr(PyObject *self, PyObject *args) { } PyObject *register_name_identifier_new(PyObject *self, PyObject *args) { - PyObject *server_obj, *user_obj; + PyObject *server_obj; LassoRegisterNameIdentifier *register_name_identifier; gint provider_type; - if (CheckArgs(args, "OOI:register_name_identifier_new")) { - if(!PyArg_ParseTuple(args, (char *) "OOi:register_name_identifier_new", - &server_obj, &user_obj, &provider_type)) + if (CheckArgs(args, "OI:register_name_identifier_new")) { + if(!PyArg_ParseTuple(args, (char *) "Oi:register_name_identifier_new", + &server_obj, &provider_type)) return NULL; } else return NULL; register_name_identifier = lasso_register_name_identifier_new(LassoServer_get(server_obj), - LassoUser_get(user_obj), provider_type); return (LassoRegisterNameIdentifier_wrap(register_name_identifier)); diff --git a/python/lasso.py b/python/lasso.py index 76ce1a80..ec8f0cb3 100644 --- a/python/lasso.py +++ b/python/lasso.py @@ -517,16 +517,10 @@ class FederationTerminationNotification(LibFederationTerminationNotification): return FederationTerminationNotification(obj) new = classmethod(new) - def new_from_soap(cls, envelope): - obj = lassomod.federation_termination_notification_new_from_soap(envelope) - return FederationTerminationNotification(obj) - new_from_soap = classmethod(new_from_soap) - - def new_from_query(cls, query): - obj = lassomod.federation_termination_notification_new_from_query(query) - return FederationTerminationNotification(obj) - new_from_query = classmethod(new_from_query) - + def new_from_export(cls, buffer, export_type = 0): + obj = lassomod.federation_termination_notification(buffer, export_type) + return LogoutRequest(obj) + new_from_export = classmethod(new_from_export) class LogoutRequest(LibLogoutRequest): """\brief Blabla @@ -545,8 +539,8 @@ class LogoutRequest(LibLogoutRequest): return LogoutRequest(obj) new = classmethod(new) - def new_from_export(cls, envelope): - obj = lassomod.logout_request_new_from_export(envelope) + def new_from_export(cls, buffer, export_type = 0): + obj = lassomod.logout_request_new_from_export(buffer, export_type) return LogoutRequest(obj) new_from_export = classmethod(new_from_export) @@ -563,30 +557,15 @@ class LogoutResponse(LibLogoutResponse): self._o = _obj LibLogoutResponse.__init__(self, _obj = self._o) - def new_from_request_soap(cls, envelope, providerID, status_code_value): - obj = lassomod.logout_response_new_from_request_soap(envelope, providerID, status_code_value) + def new_from_export(cls, buffer, export_type = 0): + obj = lassomod.logout_response_new_from_export(buffer, export_type) return LogoutResponse(obj) - new_from_request_soap = classmethod(new_from_request_soap) - - def new_from_soap(cls, envelope): - obj = lassomod.logout_response_new_from_soap(envelope) - return LogoutResponse(obj) - new_from_soap = classmethod(new_from_soap) + new_from_export = classmethod(new_from_export) - def new_from_dump(cls, dump): - obj = lassomod.logout_response_new_from_dump(dump) + def new_from_request_export(cls, buffer, export_type, providerID, statusCodeValue): + obj = lassomod.logout_response_new_from_request_export(buffer, export_type, providerID, statusCodeValue) return LogoutResponse(obj) - new_from_dump = classmethod(new_from_dump) - - def new_from_request_query(cls, query, providerID, status_code_value): - obj = lassomod.logout_response_new_from_request_query(query, providerID, status_code_value) - return LogoutResponse(obj); - new_from_request_query = classmethod(new_from_request_query) - - def new_from_query(cls, query): - obj = lassomod.logout_response_new_from_query(query) - return LogoutResponse(obj); - new_from_query = classmethod(new_from_query) + new_from_export = classmethod(new_from_request_export) class NameIdentifierMappingRequest(LibNameIdentifierMappingRequest): @@ -678,15 +657,10 @@ class RegisterNameIdentifierRequest(LibRegisterNameIdentifierRequest): return RegisterNameIdentifierRequest(obj) new = classmethod(new) - def new_from_soap(cls, envelope): - obj = lassomod.register_name_identifier_request_new_from_soap(envelope) - return RegisterNameIdentifierRequest(obj) - new_from_soap = classmethod(new_from_soap) - - def new_from_query(cls, query): - obj = lassomod.register_name_identifier_request_new_from_query(query) + def new_from_export(cls, buffer, export_type = 0): + obj = lassomod.register_name_identifier_request_new_from_export(buffer, export_type) return RegisterNameIdentifierRequest(obj) - new_from_query = classmethod(new_from_query) + new_from_export = classmethod(new_from_export) def rename_attributes_for_encoded_query(self): lassomod.register_name_identifier_request_rename_attributes_for_query(self) @@ -704,30 +678,16 @@ class RegisterNameIdentifierResponse(LibRegisterNameIdentifierResponse): self._o = _obj LibRegisterNameIdentifierResponse.__init__(self, _obj = self._o) - def new_from_request_soap(cls, envelope, providerID, status_code_value): - obj = lassomod.register_name_identifier_response_new_from_request_soap(envelope, providerID, status_code_value) + def new_from_export(cls, buffer, export_type = 0): + obj = lassomod.register_name_identifier_response_new_from_export(buffer, export_type) return RegisterNameIdentifierResponse(obj) - new_from_request_soap = classmethod(new_from_request_soap) - - def new_from_soap(cls, envelope): - obj = lassomod.register_name_identifier_response_new_from_soap(envelope) - return RegisterNameIdentifierResponse(obj) - new_from_soap = classmethod(new_from_soap) + new_from_export = classmethod(new_from_export) - def new_from_dump(cls, dump): - obj = lassomod.register_name_identifier_response_new_from_dump(dump) + def new_from_request_export(cls, buffer, export_type, providerID, statusCodeValue): + obj = lassomod.register_name_identifier_response_new_from_request_export(buffer, export_type, providerID, statusCodeValue) return RegisterNameIdentifierResponse(obj) - new_from_dump = classmethod(new_from_dump) + new_from_export = classmethod(new_from_request_export) - def new_from_request_query(cls, query, providerID, status_code_value): - obj = lassomod.register_name_identifier_response_new_from_request_query(query, providerID, status_code_value) - return RegisterNameIdentifierResponse(obj); - new_from_request_query = classmethod(new_from_request_query) - - def new_from_query(cls, query): - obj = lassomod.register_name_identifier_response_new_from_query(query) - return RegisterNameIdentifierResponse(obj); - new_from_query = classmethod(new_from_query) ################################################################################ # elements diff --git a/python/lassomod.c b/python/lassomod.c index e12a8a04..cc3004a1 100644 --- a/python/lassomod.c +++ b/python/lassomod.c @@ -162,27 +162,20 @@ static PyMethodDef lasso_methods[] = { {"logout_response_new_from_export", logout_response_new_from_export, METH_VARARGS}, /* py_name_identifier_mapping_request.h */ - {"name_identifier_mapping_request_new", name_identifier_mapping_request_new, METH_VARARGS}, - {"name_identifier_mapping_request_new_from_soap", name_identifier_mapping_request_new_from_soap, METH_VARARGS}, - {"name_identifier_mapping_request_new_from_query", name_identifier_mapping_request_new_from_query, METH_VARARGS}, + {"name_identifier_mapping_request_new", name_identifier_mapping_request_new, METH_VARARGS}, +/* {"name_identifier_mapping_request_new_from_export", name_identifier_mapping_request_new_from_export, METH_VARARGS}, */ /* py_name_identifier_mapping_response.h */ - {"name_identifier_mapping_response_new_from_request_soap", name_identifier_mapping_response_new_from_request_soap, METH_VARARGS}, - {"name_identifier_mapping_response_new_from_soap", name_identifier_mapping_response_new_from_soap, METH_VARARGS}, - {"name_identifier_mapping_response_new_from_dump", name_identifier_mapping_response_new_from_dump, METH_VARARGS}, - {"name_identifier_mapping_response_new_from_request_query", name_identifier_mapping_response_new_from_request_query, METH_VARARGS}, - {"name_identifier_mapping_response_new_from_query", name_identifier_mapping_response_new_from_query, METH_VARARGS}, +/* {"name_identifier_mapping_response_new_from_request_export", name_identifier_mapping_response_new_from_request_export, METH_VARARGS}, */ +/* {"name_identifier_mapping_response_new_from_export", name_identifier_mapping_response_new_from_export, METH_VARARGS}, */ /* py_register_name_identifier_request.h */ {"register_name_identifier_request_new", register_name_identifier_request_new, METH_VARARGS}, {"register_name_identifier_request_rename_attributes_for_query", register_name_identifier_request_rename_attributes_for_query, METH_VARARGS}, /* py_register_name_identifier_response.h */ - {"register_name_identifier_response_new_from_request_soap", register_name_identifier_response_new_from_request_soap, METH_VARARGS}, - {"register_name_identifier_response_new_from_soap", register_name_identifier_response_new_from_soap, METH_VARARGS}, - {"register_name_identifier_response_new_from_dump", register_name_identifier_response_new_from_dump, METH_VARARGS}, - {"register_name_identifier_response_new_from_request_query", register_name_identifier_response_new_from_request_query, METH_VARARGS}, - {"register_name_identifier_response_new_from_query", register_name_identifier_response_new_from_query, METH_VARARGS}, + {"register_name_identifier_response_new_from_request_export", register_name_identifier_response_new_from_request_export, METH_VARARGS}, + {"register_name_identifier_response_new_from_export", register_name_identifier_response_new_from_export, METH_VARARGS}, /* py_request.h */ /* {"request_create", request_create, METH_VARARGS}, */ diff --git a/python/protocols/py_register_name_identifier_request.c b/python/protocols/py_register_name_identifier_request.c index e5a484c4..0deba7cf 100644 --- a/python/protocols/py_register_name_identifier_request.c +++ b/python/protocols/py_register_name_identifier_request.c @@ -92,42 +92,29 @@ PyObject *register_name_identifier_request_rename_attributes_for_query(PyObject } else return NULL; - lasso_register_name_identifier_rename_attributes_for_query(LassoRegisterNameIdentifierRequest_get(request_obj)); + lasso_register_name_identifier_request_rename_attributes_for_query(LassoRegisterNameIdentifierRequest_get(request_obj)); Py_INCREF(Py_None); return (Py_None); } -PyObject *register_name_identifier_request_new_from_soap(PyObject *self, PyObject *args) { - const xmlChar *soap_buffer; - - LassoNode *request; +PyObject *register_name_identifier_request_new_from_export(PyObject *self, PyObject *args) { + gchar *soap_buffer; + LassoNode *request; + gint type; - if (CheckArgs(args, "S:register_name_identifier_request_new_from_soap")) { - if(!PyArg_ParseTuple(args, (char *) "s:register_name_identifier_request_new_from_soap", - &soap_buffer)) + if (CheckArgs(args, "SS:register_name_identifier_request_new_from_export")) { + if(!PyArg_ParseTuple(args, (char *) "ss:register_name_identifier_request_new_from_export", + &soap_buffer, &type)) return NULL; } else return NULL; - request = lasso_register_name_identifier_request_new_from_soap(soap_buffer); - - return (LassoRegisterNameIdentifierRequest_wrap(LASSO_REGISTER_NAME_IDENTIFIER_REQUEST(request))); -} - -PyObject *register_name_identifier_request_new_from_query(PyObject *self, PyObject *args) { - const xmlChar *query; - - LassoNode *request; - - if (CheckArgs(args, "S:register_name_identifier_request_new_from_query")) { - if(!PyArg_ParseTuple(args, (char *) "s:register_name_identifier_request_new_from_query", - &query)) - return NULL; + request = lasso_register_name_identifier_request_new_from_export(soap_buffer, type); + if(request==NULL){ + Py_INCREF(Py_None); + return (Py_None); } - else return NULL; - - request = lasso_register_name_identifier_request_new_from_query(query); return (LassoRegisterNameIdentifierRequest_wrap(LASSO_REGISTER_NAME_IDENTIFIER_REQUEST(request))); } diff --git a/python/protocols/py_register_name_identifier_request.h b/python/protocols/py_register_name_identifier_request.h index c62105fa..2d04809a 100644 --- a/python/protocols/py_register_name_identifier_request.h +++ b/python/protocols/py_register_name_identifier_request.h @@ -37,9 +37,9 @@ typedef struct { PyObject *LassoRegisterNameIdentifierRequest_wrap(LassoRegisterNameIdentifierRequest *request); PyObject *register_name_identifier_request_new(PyObject *self, PyObject *args); -PyObject *register_name_identifier_request_rename_attributes_for_query(PyObject *self, PyObject *args); -PyObject *register_name_identifier_request_new_from_soap(PyObject *self, PyObject *args); -PyObject *register_name_identifier_request_new_from_query(PyObject *self, PyObject *args); +PyObject *register_name_identifier_request_new_from_export(PyObject *self, PyObject *args); + +PyObject *register_name_identifier_request_rename_attributes_for_query(PyObject *self, PyObject *args); #endif /* __PYLASSO_PY_REGISTER_NAME_IDENTIFIER_REQUEST_H__ */ diff --git a/python/protocols/py_register_name_identifier_response.c b/python/protocols/py_register_name_identifier_response.c index 7fc8c0da..5547dd17 100644 --- a/python/protocols/py_register_name_identifier_response.c +++ b/python/protocols/py_register_name_identifier_response.c @@ -42,97 +42,46 @@ PyObject *LassoRegisterNameIdentifierResponse_wrap(LassoRegisterNameIdentifierRe /******************************************************************************/ -PyObject *register_name_identifier_response_new_from_request_soap(PyObject *self, PyObject *args) { - const xmlChar *request_soap_dump; - const xmlChar *providerID; - const xmlChar *status_code_value; +PyObject *register_name_identifier_response_new_from_request_export(PyObject *self, PyObject *args) { + gchar *request_export; + gchar *providerID; + gchar *status_code_value; + gint export_type; LassoNode *response = NULL; - if (CheckArgs(args, "SSS:register_name_identifier_response_new_from_request_soap")) { - if(!PyArg_ParseTuple(args, (char *) "sss:register_name_identifier_response_new_from_request_soap", - &request_soap_dump, + if (CheckArgs(args, "SSSS:register_name_identifier_response_new_from_request_export")) { + if(!PyArg_ParseTuple(args, (char *) "ssss:register_name_identifier_response_new_from_request_export", + &request_export, + &export_type, &providerID, &status_code_value)) return NULL; } else return NULL; - response = lasso_register_name_identifier_response_new_from_request_soap(request_soap_dump, - providerID, - status_code_value); + response = lasso_register_name_identifier_response_new_from_request_export(request_export, + export_type, + providerID, + status_code_value); return (LassoRegisterNameIdentifierResponse_wrap(LASSO_REGISTER_NAME_IDENTIFIER_RESPONSE(response))); } -PyObject *register_name_identifier_response_new_from_soap(PyObject *self, PyObject *args) { - const xmlChar *request_soap_dump; +PyObject *register_name_identifier_response_new_from_export(PyObject *self, PyObject *args) { + gchar *request_export; + gint export_type; LassoNode *response = NULL; - if (CheckArgs(args, "S:register_name_identifier_response_new_from_soap")) { - if(!PyArg_ParseTuple(args, (char *) "s:register_name_identifier_response_new_from_soap", - &request_soap_dump)) + if (CheckArgs(args, "SS:register_name_identifier_response_new_from_export")) { + if(!PyArg_ParseTuple(args, (char *) "ss:register_name_identifier_response_new_from_export", + &request_export, &export_type)) return NULL; } else return NULL; - response = lasso_register_name_identifier_response_new_from_soap(request_soap_dump); - - return (LassoRegisterNameIdentifierResponse_wrap(LASSO_REGISTER_NAME_IDENTIFIER_RESPONSE(response))); -} - -PyObject *register_name_identifier_response_new_from_dump(PyObject *self, PyObject *args) { - const xmlChar *dump; - - LassoNode *response = NULL; - - if (CheckArgs(args, "S:register_name_identifier_response_new_from_dump")) { - if(!PyArg_ParseTuple(args, (char *) "s:register_name_identifier_response_new_from_dump", - &dump)) - return NULL; - } - else return NULL; - - response = lasso_register_name_identifier_response_new_from_soap(dump); - - return (LassoRegisterNameIdentifierResponse_wrap(LASSO_REGISTER_NAME_IDENTIFIER_RESPONSE(response))); -} - -PyObject *register_name_identifier_response_new_from_request_query(PyObject *self, PyObject *args) { - const xmlChar *query; - const xmlChar *providerID; - const xmlChar *status_code_value; - - LassoNode *response = NULL; - - if (CheckArgs(args, "SSS:register_name_identifier_response_new_from_request_query")) { - if(!PyArg_ParseTuple(args, (char *) "sss:register_name_identifier_response_new_from_request_query", - &query, - &providerID, - &status_code_value)) - return NULL; - } - else return NULL; - - response = lasso_register_name_identifier_response_new_from_request_query(query, providerID, status_code_value); - - return (LassoRegisterNameIdentifierResponse_wrap(LASSO_REGISTER_NAME_IDENTIFIER_RESPONSE(response))); -} - -PyObject *register_name_identifier_response_new_from_query(PyObject *self, PyObject *args) { - const xmlChar *query; - - LassoNode *response = NULL; - - if (CheckArgs(args, "S:register_name_identifier_response_new_from_request_query")) { - if(!PyArg_ParseTuple(args, (char *) "s:register_name_identifier_response_new_from_request_query", - &query)) - return NULL; - } - else return NULL; - - response = lasso_register_name_identifier_response_new_from_query(query); + response = lasso_register_name_identifier_response_new_from_export(request_export, export_type); return (LassoRegisterNameIdentifierResponse_wrap(LASSO_REGISTER_NAME_IDENTIFIER_RESPONSE(response))); } diff --git a/python/protocols/py_register_name_identifier_response.h b/python/protocols/py_register_name_identifier_response.h index f66d2059..0d6aad5a 100644 --- a/python/protocols/py_register_name_identifier_response.h +++ b/python/protocols/py_register_name_identifier_response.h @@ -36,11 +36,7 @@ typedef struct { #define LassoRegisterNameIdentifierResponse_get(v) (((v) == Py_None) ? NULL : (((LassoRegisterNameIdentifierResponse_object *)(PyObject_GetAttr(v, PyString_FromString("_o"))))->obj)) PyObject *LassoRegisterNameIdentifierResponse_wrap(LassoRegisterNameIdentifierResponse *response); -PyObject *register_name_identifier_response_new_from_request_soap(PyObject *self, PyObject *args); -PyObject *register_name_identifier_response_new_from_soap(PyObject *self, PyObject *args); -PyObject *register_name_identifier_response_new_from_dump(PyObject *self, PyObject *args); -PyObject *register_name_identifier_response_new_from_request_query(PyObject *self, PyObject *args); -PyObject *register_name_identifier_response_new_from_query(PyObject *self, PyObject *args); - +PyObject *register_name_identifier_response_new_from_request_export(PyObject *self, PyObject *args); +PyObject *register_name_identifier_response_new_from_export(PyObject *self, PyObject *args); #endif /* __PYLASSO_PY_REGISTER_NAME_IDENTIFIER_RESPONSE_H__ */ |
