diff options
Diffstat (limited to 'pyuno/source/module')
-rw-r--r-- | pyuno/source/module/makefile.mk | 13 | ||||
-rw-r--r-- | pyuno/source/module/uno.py | 17 |
2 files changed, 20 insertions, 10 deletions
diff --git a/pyuno/source/module/makefile.mk b/pyuno/source/module/makefile.mk index 23d7a07f3..94de195e7 100644 --- a/pyuno/source/module/makefile.mk +++ b/pyuno/source/module/makefile.mk @@ -59,6 +59,7 @@ PYUNORC=pyunorc .ELSE .INCLUDE : pyversion.mk PYUNORC=pyuno.ini +DLLPOST=.pyd .ENDIF .IF "$(SYSTEM_PYTHON)" == "YES" @@ -108,11 +109,23 @@ DEFLIB1NAME=$(TARGET) # --- Targets ------------------------------------------------------ +.IF "$(GUI)$(COM)"=="WNTGCC" +ALLTAR : \ + $(DLLDEST)$/uno.py \ + $(DLLDEST)$/unohelper.py \ + $(PYUNO_MODULE) \ + $(MISC)$/$(PYUNORC) \ + $(LB)$/lib$(TARGET).a + +$(LB)$/lib$(TARGET).a: $(MISC)$/$(TARGET).def + dlltool --dllname $(TARGET)$(DLLPOST) --input-def=$(MISC)$/$(TARGET).def --kill-at --output-lib=$(LB)$/lib$(TARGET).a +.ELSE ALLTAR : \ $(DLLDEST)$/uno.py \ $(DLLDEST)$/unohelper.py \ $(PYUNO_MODULE) \ $(MISC)$/$(PYUNORC) +.ENDIF .INCLUDE : target.mk diff --git a/pyuno/source/module/uno.py b/pyuno/source/module/uno.py index e35cdd013..f136b21a0 100644 --- a/pyuno/source/module/uno.py +++ b/pyuno/source/module/uno.py @@ -250,19 +250,16 @@ def invoke( object, methodname, argTuple ): #--------------------------------------------------------------------------------------- # don't use any functions beyond this point, private section, likely to change #--------------------------------------------------------------------------------------- -def _uno_import( name, *optargs ): +#def _uno_import( name, globals={}, locals={}, fromlist=[], level=-1 ): +def _uno_import( name, *optargs, **kwargs ): try: # print "optargs = " + repr(optargs) - if len(optargs) == 0: - return _g_delegatee( name ) - #print _g_delegatee - return _g_delegatee( name, *optargs ) + return _g_delegatee( name, *optargs, **kwargs ) except ImportError: - if len(optargs) != 3 or not optargs[2]: - raise - globals = optargs[0] - locals = optargs[1] - fromlist = optargs[2] + # process optargs + globals, locals, fromlist = list(optargs)[:3] + [kwargs.get('globals',{}), kwargs.get('locals',{}), kwargs.get('fromlist',[])][len(optargs):] + if not fromlist: + raise modnames = name.split( "." ) mod = None d = sys.modules |