[Libreoffice-commits] help.git: source/text
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Mar 11 19:12:36 UTC 2019
source/text/sbasic/python/python_import.xhp | 36 ++++++++++++++--------------
1 file changed, 18 insertions(+), 18 deletions(-)
New commits:
commit 669ede5358fc7aa63420bd61b62548f2d0b54519
Author: LibreOfficiant <LibreOfficiant at sfr.fr>
AuthorDate: Mon Mar 11 16:37:55 2019 +0100
Commit: Olivier Hallot <olivier.hallot at libreoffice.org>
CommitDate: Mon Mar 11 20:12:13 2019 +0100
Compiler error due to incorrect indentation
Change-Id: I041f9ac5d160ef2ebb23e77ce3d35f02e3b703e4
Reviewed-on: https://gerrit.libreoffice.org/69053
Tested-by: Jenkins
Reviewed-by: Olivier Hallot <olivier.hallot at libreoffice.org>
diff --git a/source/text/sbasic/python/python_import.xhp b/source/text/sbasic/python/python_import.xhp
index 3ac240d87..43ec28107 100644
--- a/source/text/sbasic/python/python_import.xhp
+++ b/source/text/sbasic/python/python_import.xhp
@@ -85,24 +85,24 @@
<paragraph role="pycode" localize="false" id="N0554"> </paragraph>
<paragraph role="pycode" xml-lang="en-US" id="N0555"> adapted from 'Bibliothèque de fonctions' by Hubert Lambert</paragraph>
<paragraph role="pycode" xml-lang="en-US" id="N0556"> at https://forum.openoffice.org/fr/forum/viewtopic.php?p=286213 """</paragraph>
- <paragraph role="pycode" localize="false" id="N0557">def isImportedModule(module_name: str) -> bool:</paragraph>
- <paragraph role="pycode" xml-lang="en-US" id="N0558"> """ Check run time module list """</paragraph>
- <paragraph role="pycode" localize="false" id="N0559"> return (module_name in sys.modules.keys())</paragraph>
- <paragraph role="pycode" localize="false" id="N0560">def isLoadedLibrary(lib_name: str) -> bool:</paragraph>
- <paragraph role="pycode" xml-lang="en-US" id="N0561"> """ Check PYTHON_PATH content """</paragraph>
- <paragraph role="pycode" localize="false" id="N0562"> return (lib_name in sys.path)</paragraph>
- <paragraph role="pycode" localize="false" id="N0563">def loadLibrary(lib_name: str, module_name=None):</paragraph>
- <paragraph role="pycode" xml-lang="en-US" id="N0564"> """ add directory to PYTHON_PATH, import named module """</paragraph>
- <paragraph role="pycode" localize="false" id="N0565"> doc = XSCRIPTCONTEXT.getDocument()</paragraph>
- <paragraph role="pycode" localize="false" id="N0566"> url = uno.fileUrlToSystemPath(</paragraph>
- <paragraph role="pycode" localize="false" id="N0567"> '{}/{}'.format(doc.URL,'Scripts/python/'+lib_name)</paragraph>
- <paragraph role="pycode" localize="false" id="N0568"> if not url in sys.path:</paragraph>
- <paragraph role="pycode" localize="false" id="N0569"> sys.path.insert(0, url)</paragraph>
- <paragraph role="pycode" localize="false" id="N0570"> if module_name and not module_name in sys.modules.keys():</paragraph>
- <paragraph role="pycode" localize="false" id="N0571"> return zipimport.zipimporter(url).load_module(module_name)</paragraph>
- <paragraph role="pycode" localize="false" id="N0572">def unloadLibrary(lib_name: str):</paragraph>
- <paragraph role="pycode" xml-lang="en-US" id="N0573"> """ remove directory from PYTHON_PATH """</paragraph>
- <paragraph role="pycode" localize="false" id="N0574"> sys.path.remove(lib_name)</paragraph>
+ <paragraph role="pycode" localize="false" id="N0557"> def isImportedModule(module_name: str) -> bool:</paragraph>
+ <paragraph role="pycode" xml-lang="en-US" id="N0558"> """ Check run time module list """</paragraph>
+ <paragraph role="pycode" localize="false" id="N0559"> return (module_name in sys.modules.keys())</paragraph>
+ <paragraph role="pycode" localize="false" id="N0560"> def isLoadedLibrary(lib_name: str) -> bool:</paragraph>
+ <paragraph role="pycode" xml-lang="en-US" id="N0561"> """ Check PYTHON_PATH content """</paragraph>
+ <paragraph role="pycode" localize="false" id="N0562"> return (lib_name in sys.path)</paragraph>
+ <paragraph role="pycode" localize="false" id="N0563"> def loadLibrary(lib_name: str, module_name=None):</paragraph>
+ <paragraph role="pycode" xml-lang="en-US" id="N0564"> """ add directory to PYTHON_PATH, import named module """</paragraph>
+ <paragraph role="pycode" localize="false" id="N0565"> doc = XSCRIPTCONTEXT.getDocument()</paragraph>
+ <paragraph role="pycode" localize="false" id="N0566"> url = uno.fileUrlToSystemPath(</paragraph>
+ <paragraph role="pycode" localize="false" id="N0567"> '{}/{}'.format(doc.URL,'Scripts/python/'+lib_name)</paragraph>
+ <paragraph role="pycode" localize="false" id="N0568"> if not url in sys.path:</paragraph>
+ <paragraph role="pycode" localize="false" id="N0569"> sys.path.insert(0, url)</paragraph>
+ <paragraph role="pycode" localize="false" id="N0570"> if module_name and not module_name in sys.modules.keys():</paragraph>
+ <paragraph role="pycode" localize="false" id="N0571"> return zipimport.zipimporter(url).load_module(module_name)</paragraph>
+ <paragraph role="pycode" localize="false" id="N0572"> def unloadLibrary(lib_name: str):</paragraph>
+ <paragraph role="pycode" xml-lang="en-US" id="N0573"> """ remove directory from PYTHON_PATH """</paragraph>
+ <paragraph role="pycode" localize="false" id="N0574"> sys.path.remove(lib_name)</paragraph>
<paragraph role="pycode" localize="false" id="N0575"> </paragraph>
<paragraph role="pycode" localize="false" id="N0576">g_exportedScripts = (OnDocPostOpenLoadPython, OnDocQueryCloseUnloadPython)</paragraph>
</pycode>
More information about the Libreoffice-commits
mailing list