Add %pythonbegin directive.

For adding code at the beginning of the generated .py file.
This commit is contained in:
William S Fulton 2013-07-05 06:30:16 +01:00
commit d0af4f50d3
5 changed files with 71 additions and 3 deletions

View file

@ -1,11 +1,10 @@
/*
Testcase to test %pythonprepend and %pythonappend
Testcase to test %pythonprepend and %pythonappend %pythoncode %pythonbegin
*/
%module python_append
%pythoncode %{
import os.path
mypath = os.path.dirname("/a/b/c/d.txt")
funcpath = None
staticfuncpath = None
@ -35,6 +34,10 @@ pass
pass
}
%pythonbegin %{
import os.path
%}
%inline %{
class Test {