diff --git a/modules/modpython/modpython.i b/modules/modpython/modpython.i index abc9189c..67b110b4 100644 --- a/modules/modpython/modpython.i +++ b/modules/modpython/modpython.i @@ -119,6 +119,9 @@ public: }; %extend CModule { + CString __str__() { + return $self->GetModName(); + } MCString_iter BeginNV_() { return MCString_iter($self->BeginNV()); } @@ -142,6 +145,24 @@ public: } } +%extend CUser { + CString __str__() { + return $self->GetUserName(); + } +}; + +%extend CChan { + CString __str__() { + return $self->GetName(); + } +}; + +%extend CNick { + CString __str__() { + return $self->GetNick(); + } +}; + /* Web */ %template(StrPair) pair; diff --git a/modules/modpython/znc.py b/modules/modpython/znc.py index 0b60f063..6e80424f 100644 --- a/modules/modpython/znc.py +++ b/modules/modpython/znc.py @@ -113,6 +113,8 @@ class ModuleNV(collections.MutableMapping): raise NotImplemented class Module: + def __str__(self): + return self.GetModName() def OnLoad(self, sArgs, sMessage): return True def _GetSubPages(self):