def __pack_import(name, globals=None, locals=None, fromlist=None, arg5=None):
    if name in sys.modules:
        return sys.modules[name]

    filename = name + '.py'

    if pack.Exist(filename):
        dbg.Trace('importing from pack %s\\n' % name)

        newmodule = _process_result(
            compile(pack_file(filename, 'r').read(), filename, 'exec'), name)

        module_do(newmodule)
        return newmodule
        #return imp.load_module(name, pack_file(filename,'r'),filename,('.py','r',imp.PY_SOURCE))
    else:
        dbg.Trace('importing from lib %s\\n' % name)
        return old_import(name, globals, locals, fromlist)
 def write(self, msg):
     dbg.Trace(msg)