Browse Source

nicer syntax

PYADPT-55
Volker Birk 8 years ago
parent
commit
71f4e3232b
  1. 6
      src/identity.cc
  2. 2
      src/identity.hh
  3. 1
      src/pEpmodule.cc

6
src/identity.cc

@ -1,5 +1,6 @@
#include "identity.hh" #include "identity.hh"
#include "pEpmodule.hh" #include "pEpmodule.hh"
#include "basic_api.hh"
#include "message_api.hh" #include "message_api.hh"
#include <typeinfo> #include <typeinfo>
#include <sstream> #include <sstream>
@ -143,6 +144,11 @@ namespace pEp {
return copy(); return copy();
} }
void Identity::update()
{
update_identity(*this);
}
Identity identity_attr(pEp_identity *&ident) Identity identity_attr(pEp_identity *&ident)
{ {
if (!ident) if (!ident)

2
src/identity.hh

@ -57,6 +57,8 @@ namespace pEp {
Identity copy(); Identity copy();
Identity deepcopy(dict& memo); Identity deepcopy(dict& memo);
void update();
}; };
Identity identity_attr(pEp_identity *&ident); Identity identity_attr(pEp_identity *&ident);

1
src/pEpmodule.cc

@ -119,6 +119,7 @@ BOOST_PYTHON_MODULE(pEp)
.add_property("rating", &pEp::PythonAdapter::Identity::rating, "rating of Identity") .add_property("rating", &pEp::PythonAdapter::Identity::rating, "rating of Identity")
.add_property("color", &pEp::PythonAdapter::Identity::color, "color of Identity") .add_property("color", &pEp::PythonAdapter::Identity::color, "color of Identity")
.def("__deepcopy__", &pEp::PythonAdapter::Identity::deepcopy) .def("__deepcopy__", &pEp::PythonAdapter::Identity::deepcopy)
.def("update", &pEp::PythonAdapter::Identity::update, "update Identity")
.def("__copy__", &pEp::PythonAdapter::Identity::copy); .def("__copy__", &pEp::PythonAdapter::Identity::copy);
identity_class.attr("PEP_OWN_USERID") = "pEp_own_userId"; identity_class.attr("PEP_OWN_USERID") = "pEp_own_userId";

Loading…
Cancel
Save