diff --git a/tools/cythonize.py b/tools/cythonize.py index 10aaa8d..4e79136 100755 --- a/tools/cythonize.py +++ b/tools/cythonize.py @@ -22,12 +22,17 @@ def do(fn): fn_c = fn[:-3] + 'c' with open(fn_c) as fd: data = fd.read() + modname = modname.split('.')[-1] pat1 = 'init{}(void)'.format(modname) sub1 = 'init{}_{}(void)'.format(package, modname) pat2 = 'PyInit_{}(void)'.format(modname) sub2 = 'PyInit{}_{}(void)'.format(package, modname) pat3 = 'Pyx_NAMESTR("{}")'.format(modname) sub3 = 'Pyx_NAMESTR("{}_{}")'.format(package, modname) + + print '1: {} -> {}'.format(pat1, sub1) + print '2: {} -> {}'.format(pat2, sub2) + print '3: {} -> {}'.format(pat3, sub3) data = data.replace(pat1, sub1) data = data.replace(pat2, sub2) data = data.replace(pat3, sub3) @@ -37,5 +42,6 @@ def do(fn): fd.write(data) if __name__ == '__main__': + print '-- cythonize', sys.argv for fn in sys.argv[1:]: do(fn)