Skip to content

Commit

Permalink
Merge pull request #20 from pfernique/master
Browse files Browse the repository at this point in the history
Update wrappers
  • Loading branch information
pfernique committed May 23, 2017
2 parents 55f6358 + 702e5d6 commit b9569c6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
13 changes: 7 additions & 6 deletions src/py/statiskit/stl/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ def wrapper__init__(f):
def __init__(self, arg=None):
if arg is None:
f(self)
elif not isinstance(arg, self.__class__):
raise TypeError('\'arg\' parameter must be a \'' + self.__class__ + '\' instance')
else:
f(self, arg)
try:
f(self, arg)
except:
raise TypeError('\'arg\' parameter must be a \'' + self.__class__.__name__ + '\' instance or compatible Python object')
return __init__

cls.__init__ = wrapper__init__(cls.__init__)
Expand Down Expand Up @@ -58,17 +59,17 @@ def __setitem__(self, index, value):
del cls.at

def __str__(self):
return "[" + ", ".join(str(value) for value in self) + "]"
return "(" + ", ".join(str(value) for value in self) + ")"

cls.__str__ = __str__

def __repr__(self):
return "[" + ", ".join(repr(value) for value in self) + "]"
return "(" + ", ".join(repr(value) for value in self) + ")"

cls.__repr__ = __repr__

def _repr_latex_(self):
return "$\\left\\{" + ", ".join(getattr(value, "_repr_latex_", getattr(value, "__repr__"))() for value in self) + "\\right\\}$"
return "$\\left(" + ", ".join(getattr(value, "_repr_latex_", getattr(value, "__repr__"))() for value in self) + "\\right)$"

cls._repr_latex_ = _repr_latex_

Expand Down
4 changes: 4 additions & 0 deletions src/py/wrapper/wrapper_c62bcafb31b250e8bb3f63626536f4b4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
namespace autowig
{

void method_decorator_69807f66301958b58ec8e566dad5f44d(class ::std::fpos< __mbstate_t > & instance, ::std::streamoff param_in_0, const class ::std::fpos< __mbstate_t > & param_out) { instance.operator+=(param_in_0) = param_out; }
void method_decorator_3471b660ad1c5296a25f584dba14f6bb(class ::std::fpos< __mbstate_t > & instance, ::std::streamoff param_in_0, const class ::std::fpos< __mbstate_t > & param_out) { instance.operator-=(param_in_0) = param_out; }
}

#if defined(_MSC_VER)
Expand Down Expand Up @@ -32,7 +34,9 @@ void wrapper_c62bcafb31b250e8bb3f63626536f4b4()
::std::streamoff (::std::fpos< __mbstate_t >::*method_pointer_42ef4f3e4a4e5160863a2b0ab2bd01ac)(class ::std::fpos< __mbstate_t > const &) const = &::std::fpos< __mbstate_t >::operator-;
boost::python::class_< class ::std::fpos< __mbstate_t >, autowig::Held< class ::std::fpos< __mbstate_t > >::Type > class_c62bcafb31b250e8bb3f63626536f4b4("_Fpos_c62bcafb31b250e8bb3f63626536f4b4", "", boost::python::no_init);
class_c62bcafb31b250e8bb3f63626536f4b4.def("__iadd__", method_pointer_69807f66301958b58ec8e566dad5f44d, boost::python::return_internal_reference<>(), "");
class_c62bcafb31b250e8bb3f63626536f4b4.def("__iadd__", autowig::method_decorator_69807f66301958b58ec8e566dad5f44d);
class_c62bcafb31b250e8bb3f63626536f4b4.def("__isub__", method_pointer_3471b660ad1c5296a25f584dba14f6bb, boost::python::return_internal_reference<>(), "");
class_c62bcafb31b250e8bb3f63626536f4b4.def("__isub__", autowig::method_decorator_3471b660ad1c5296a25f584dba14f6bb);
class_c62bcafb31b250e8bb3f63626536f4b4.def("__add__", method_pointer_b29ae265339b58199401cf5c0e640389, "");
class_c62bcafb31b250e8bb3f63626536f4b4.def("__sub__", method_pointer_7e4f5995bdef5462836c01679a689968, "");
class_c62bcafb31b250e8bb3f63626536f4b4.def("__sub__", method_pointer_42ef4f3e4a4e5160863a2b0ab2bd01ac, "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ void wrapper_d0ba0922f2505f7b8e291326cad79af5()
if(autowig::Held< struct ::std::equal_to< unsigned long int > >::is_class)
{
boost::python::implicitly_convertible< autowig::Held< struct ::std::equal_to< unsigned long int > >::Type, autowig::Held< struct ::std::binary_function< unsigned long int, unsigned long int, bool > >::Type >();
//boost::python::objects::class_value_wrapper< autowig::Held< struct ::std::equal_to< unsigned long int > >::Type, boost::python::objects::make_ptr_instance< struct ::std::equal_to< unsigned long int >, boost::python::objects::pointer_holder< autowig::Held< struct ::std::equal_to< unsigned long int > >::Type, struct ::std::equal_to< unsigned long int > > > >();
}

}

0 comments on commit b9569c6

Please sign in to comment.