[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-5-2+backports' - scripting/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 13 13:43:03 UTC 2019


 scripting/source/pyprov/pythonscript.py |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit a285ce82cfa9686c0f235c8b1a245f414311b5e3
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Aug 12 20:32:54 2019 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Tue Aug 13 15:42:25 2019 +0200

    construct final url from parsed output
    
    Change-Id: Ifd733625a439685ad307603eb2b00bf463eb9ca9
    Reviewed-on: https://gerrit.libreoffice.org/77373
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 87959e5deea6d33cd35dbb3b8423056f9566710e)
    Reviewed-on: https://gerrit.libreoffice.org/77377
    (cherry picked from commit c03acb9b8a97254cfcf7c45ef920b93b7f1dd344)
    Reviewed-on: https://gerrit.libreoffice.org/77407
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    Tested-by: Michael Stahl <Michael.Stahl at cib.de>

diff --git a/scripting/source/pyprov/pythonscript.py b/scripting/source/pyprov/pythonscript.py
index 6625b226f609..66bbf9231abe 100644
--- a/scripting/source/pyprov/pythonscript.py
+++ b/scripting/source/pyprov/pythonscript.py
@@ -223,7 +223,13 @@ class MyUriHelper:
             sStorageUri = sStorageUri.replace( "|", "/" )
 
             # path to the .py file, relative to the base
-            sFileUri = sStorageUri[0:sStorageUri.find("$")]
+            funcNameStart = sStorageUri.find("$")
+            if funcNameStart != -1:
+                sFileUri = sStorageUri[0:funcNameStart]
+                sFuncName = sStorageUri[funcNameStart+1:]
+            else:
+                sFileUri = sStorageUri
+
             xFileUri = self.m_uriRefFac.parse(sFileUri)
             if not xFileUri:
                 message = "pythonscript: invalid relative uri '" + sFileUri+ "'"
@@ -240,7 +246,9 @@ class MyUriHelper:
                 log.debug( message )
                 raise RuntimeException( message )
 
-            ret = sBaseUri + sStorageUri
+            ret = sAbsScriptUri
+            if funcNameStart != -1:
+                ret = ret + "$" + sFuncName
             log.debug( "converting scriptURI="+scriptURI + " to storageURI=" + ret )
             return ret
         except UnoException as e:


More information about the Libreoffice-commits mailing list