srcanamdw/codescanner/pyinstaller/buildtests/hooks1/hook-pkg1.py
author noe\swadi
Thu, 18 Feb 2010 12:29:02 +0530
changeset 1 22878952f6e2
permissions -rw-r--r--
Committing the CodeScanner Core tool This component has been moved from the StaticAnaApps package. BUG : 5889 (http://developer.symbian.org/webbugs/show_bug.cgi?id=5889).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     1
attrs = [('notamodule','')]
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     2
def hook(mod):
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     3
    import os, sys, marshal
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     4
    other = os.path.join(mod.__path__[0], '../pkg2/__init__.pyc')
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     5
    if os.path.exists(other):
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     6
        co = marshal.loads(open(other,'rb').read()[8:])
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     7
    else:
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     8
        co = compile(open(other[:-1],'r').read()+'\n', other, 'exec')
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     9
    mod.__init__(mod.__name__, other, co)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    10
    mod.__path__.append(os.path.join(mod.__path__[0], 'extra'))
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    11
    return mod