diff options
author | LibreOfficiant <LibreOfficiant@sfr.fr> | 2019-03-11 16:37:55 +0100 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@libreoffice.org> | 2019-03-11 20:12:13 +0100 |
commit | 669ede5358fc7aa63420bd61b62548f2d0b54519 (patch) | |
tree | 0105245842b7a7e35a4b9a39eacf5afbc89285fe | |
parent | 496aaf8cbcd030c1ddfbc3776c23edd08307b96e (diff) |
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@libreoffice.org>
-rw-r--r-- | source/text/sbasic/python/python_import.xhp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/source/text/sbasic/python/python_import.xhp b/source/text/sbasic/python/python_import.xhp index 3ac240d87c..43ec281078 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> |