swig/Examples/test-suite/python_append.i
Julien Schueller 7a4cef998c Enable pep8 check
2014-06-07 13:10:27 +02:00

50 lines
736 B
OpenEdge ABL

/*
Testcase to test %pythonprepend and %pythonappend %pythoncode %pythonbegin
*/
%module python_append
%pythoncode %{
mypath = os.path.dirname("/a/b/c/d.txt")
funcpath = None
staticfuncpath = None
def grabpath():
return funcpath
def grabstaticpath():
return staticfuncpath
%}
%pythonappend Test::func %{
funcpath = os.path.dirname(funcpath)
%}
%pythonprepend Test::func %{
global funcpath
funcpath = mypath
%}
%pythonappend Test::static_func %{
staticfuncpath = os.path.basename(staticfuncpath)
pass
%}
%pythonprepend Test::static_func {
global staticfuncpath
staticfuncpath = mypath
pass
}
%pythonbegin %{
import os.path
%}
%inline %{
class Test {
public:
static void static_func() {};
void func() {};
};
%}