https://bugs.documentfoundation.org/show_bug.cgi?id=92007

            Bug ID: 92007
           Summary: python scripts with tuple-assignments fails on access
                    from GUI
           Product: LibreOffice
           Version: 4.0 all versions
          Hardware: Other
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: UI
          Assignee: libreoffice-bugs@lists.freedesktop.org
          Reporter: karloofo...@arcor.de

In python its valid syntax making `tuple assignments` like:

x, y, z = 42, math.pi, 99

or PY3 also:

x, y , *all_the_rest = some_list_with_undefined_length

unfortunatly the functions in Scripts with those assignments, becomes no
visible in the GUI.

here's the patch to fix this issue:

    --- /opt/libreoffice4.4/program/pythonscript.py     #old
    +++ /opt/libreoffice4.4/program/pythonscript.py     #new
    @@ -403,7 +403,12 @@
                     allFuncs.append(node.name)
                 elif isinstance(node, ast.Assign):
                     for target in node.targets:
    -                    if target.id == "g_exportedScripts":
    +                    try:
    +                        identifier = target.id
    +                    except AttributeError:
    +                        identifier = ""
    +                        pass
    +                    if identifier == "g_exportedScripts":
                             for value in node.value.elts:
                                 g_exportedScripts.append(value.id)
                             return g_exportedScripts

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to