diff options
Diffstat (limited to 'pyuno')
-rw-r--r-- | pyuno/prj/d.lst | 3 | ||||
-rw-r--r-- | pyuno/source/loader/makefile.mk | 34 | ||||
-rw-r--r-- | pyuno/source/loader/pythonloader.component | 34 | ||||
-rw-r--r-- | pyuno/source/loader/pyuno_loader.cxx | 23 |
4 files changed, 50 insertions, 44 deletions
diff --git a/pyuno/prj/d.lst b/pyuno/prj/d.lst index 5fe7400a8d58..1dd212ea9cf4 100644 --- a/pyuno/prj/d.lst +++ b/pyuno/prj/d.lst @@ -9,12 +9,11 @@ mkdir: %_DEST%\lib%_EXT%\pyuno ..\%__SRC%\lib\unohelper.py %_DEST%\lib%_EXT%\pyuno\unohelper.py ..\%__SRC%\lib\pythonloader.py %_DEST%\lib%_EXT%\pyuno\pythonloader.py ..\%__SRC%\lib\uno.py %_DEST%\lib%_EXT%\pyuno\uno.py -..\%__SRC%\lib\pyuno_services.rdb %_DEST%\bin%_EXT%\pyuno_services.rdb +..\%__SRC%\misc\pythonloader.component %_DEST%\xml\pythonloader.component ..\%__SRC%\bin\unohelper.py %_DEST%\bin%_EXT%\pyuno\unohelper.py ..\%__SRC%\bin\pythonloader.py %_DEST%\bin%_EXT%\pyuno\pythonloader.py ..\%__SRC%\bin\uno.py %_DEST%\bin%_EXT%\pyuno\uno.py -..\%__SRC%\bin\pyuno_services.rdb %_DEST%\bin%_EXT%\pyuno_services.rdb ..\%__SRC%\bin\pyuno.pyd %_DEST%\bin%_EXT%\pyuno.pyd ..\%__SRC%\bin\pyuno.dll %_DEST%\bin%_EXT%\pyuno.dll ..\%__SRC%\bin\pythonl*.dll %_DEST%\bin%_EXT%\pythonl*.dll diff --git a/pyuno/source/loader/makefile.mk b/pyuno/source/loader/makefile.mk index 6f8648ce598e..65ec8116f9c5 100644 --- a/pyuno/source/loader/makefile.mk +++ b/pyuno/source/loader/makefile.mk @@ -73,40 +73,22 @@ SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME= $(SHL1TARGET) SLOFILES= $(SLO)$/pyuno_loader.obj -#COMPONENTS= \ -# tcv \ -# inv \ -# corefl \ -# insp \ -# invadp \ -# proxyfac \ -# pythonloader.uno \ - - -COMPONENTS= \ - stocservices.uno \ - invocation.uno \ - introspection.uno \ - invocadapt.uno \ - proxyfac.uno \ - reflection.uno \ - .$/pythonloader.uno - # --- Targets ------------------------------------------------------ ALL : ALLTAR \ - $(DLLDEST)$/pythonloader.py \ - $(DLLDEST)$/pyuno_services.rdb + $(DLLDEST)$/pythonloader.py .ENDIF # L10N_framework .INCLUDE : target.mk .IF "$(L10N_framework)"=="" $(DLLDEST)$/%.py: %.py cp $? $@ - -$(DLLDEST)$/pyuno_services.rdb : makefile.mk $(DLLDEST)$/$(DLLPRE)$(TARGET)$(DLLPOST) - -rm -f $@ $(DLLDEST)$/pyuno_services.tmp $(DLLDEST)$/pyuno_services.rdb - cd $(DLLDEST) && $(REGCOMP) -register -r pyuno_services.tmp -wop $(foreach,i,$(COMPONENTS) -c $(i)) - cd $(DLLDEST) && mv pyuno_services.tmp pyuno_services.rdb .ENDIF # L10N_framework +ALLTAR : $(MISC)/pythonloader.component + +$(MISC)/pythonloader.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt pythonloader.component + $(XSLTPROC) --nonet --stringparam uri \ + 'vnd.sun.star.expand:$$OOO_BASE_DIR/program/$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt pythonloader.component diff --git a/pyuno/source/loader/pythonloader.component b/pyuno/source/loader/pythonloader.component new file mode 100644 index 000000000000..583b6ed38771 --- /dev/null +++ b/pyuno/source/loader/pythonloader.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="org.openoffice.comp.pyuno.Loader"> + <service name="com.sun.star.loader.Python"/> + </implementation> +</component> diff --git a/pyuno/source/loader/pyuno_loader.cxx b/pyuno/source/loader/pyuno_loader.cxx index 57e893744f5f..c69132e51e3d 100644 --- a/pyuno/source/loader/pyuno_loader.cxx +++ b/pyuno/source/loader/pyuno_loader.cxx @@ -123,8 +123,7 @@ static void setPythonHome ( const OUString & pythonHome ) static void prependPythonPath( const OUString & pythonPathBootstrap ) { - rtl::OStringBuffer bufPYTHONPATH( 256 ); - bufPYTHONPATH.append( "PYTHONPATH="); + rtl::OUStringBuffer bufPYTHONPATH( 256 ); sal_Int32 nIndex = 0; while( 1 ) { @@ -140,21 +139,19 @@ static void prependPythonPath( const OUString & pythonPathBootstrap ) } OUString systemPath; osl_getSystemPathFromFileURL( fileUrl.pData, &(systemPath.pData) ); - bufPYTHONPATH.append( rtl::OUStringToOString( systemPath.pData, osl_getThreadTextEncoding() )); - bufPYTHONPATH.append( SAL_PATHSEPARATOR ); + bufPYTHONPATH.append( systemPath ); + bufPYTHONPATH.append( static_cast<sal_Unicode>(SAL_PATHSEPARATOR) ); if( nNew == -1 ) break; nIndex = nNew + 1; } const char * oldEnv = getenv( "PYTHONPATH"); if( oldEnv ) - bufPYTHONPATH.append( oldEnv ); - OString result = bufPYTHONPATH.makeStringAndClear(); - rtl_string_acquire( result.pData ); - -// printf( "Setting %s\n" , result.pData->buffer ); - putenv( result.pData->buffer ); + bufPYTHONPATH.append( rtl::OUString(oldEnv, strlen(oldEnv), osl_getThreadTextEncoding()) ); + rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("PYTHONPATH")); + rtl::OUString envValue(bufPYTHONPATH.makeStringAndClear()); + osl_setEnvironment(envVar.pData, envValue.pData); } Reference< XInterface > CreateInstance( const Reference< XComponentContext > & ctx ) @@ -232,12 +229,6 @@ void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } //================================================================================================== -sal_Bool SAL_CALL component_writeInfo( - void * pServiceManager, void * pRegistryKey ) -{ - return cppu::component_writeInfoHelper( pServiceManager, pRegistryKey, g_entries ); -} -//================================================================================================== void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ) { |