From 45209eca33b5acfd12c75425d37b12758d0f67ef Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Thu, 31 Mar 2011 20:41:59 +0700 Subject: [PATCH] modpython: Make strings to be stringable. Now you can use str() on objects of znc.String. The same is true for arguments which represent CString&. --- modules/modpython/modpython.i | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/modpython/modpython.i b/modules/modpython/modpython.i index 9419bed7..abc9189c 100644 --- a/modules/modpython/modpython.i +++ b/modules/modpython/modpython.i @@ -106,6 +106,18 @@ public: CString s; }; +%extend CPyRetString { + CString __str__() { + return $self->s; + } +}; + +%extend String { + CString __str__() { + return $self->s; + } +}; + %extend CModule { MCString_iter BeginNV_() { return MCString_iter($self->BeginNV());