srcanamdw/codescanner/pyinstaller/buildtests/hooks1/hook-pkg1.py
changeset 1 22878952f6e2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/hooks1/hook-pkg1.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,11 @@
+attrs = [('notamodule','')]
+def hook(mod):
+    import os, sys, marshal
+    other = os.path.join(mod.__path__[0], '../pkg2/__init__.pyc')
+    if os.path.exists(other):
+        co = marshal.loads(open(other,'rb').read()[8:])
+    else:
+        co = compile(open(other[:-1],'r').read()+'\n', other, 'exec')
+    mod.__init__(mod.__name__, other, co)
+    mod.__path__.append(os.path.join(mod.__path__[0], 'extra'))
+    return mod