diff --git a/modules/modpython/modpython.i b/modules/modpython/modpython.i index d1fc0948..ed578cd0 100644 --- a/modules/modpython/modpython.i +++ b/modules/modpython/modpython.i @@ -14,7 +14,9 @@ * limitations under the License. */ -%module znc_core %{ +%module znc_core + +%{ #include #include "../include/znc/Utils.h" #include "../include/znc/Threads.h" @@ -51,6 +53,14 @@ using std::allocator; %apply long { uint32_t }; %apply long { uint64_t }; +// Just makes generated python code slightly more beautiful. +%feature("python:defaultargs"); +// Probably can be removed when swig is fixed to not produce bad code for some cases +%feature("python:defaultargs", "0") CDir::MakeDir; // 0700 doesn't work in python3 +%feature("python:defaultargs", "0") CUtils::GetNumInput; // SyntaxError: non-default argument follows default argument +%feature("python:defaultargs", "0") CModules::GetAvailableMods; // NameError: name 'UserModule' is not defined +%feature("python:defaultargs", "0") CModules::GetDefaultMods; // NameError: name 'UserModule' is not defined + %begin %{ #include "znc/zncconfig.h" %}