[Libreoffice] Mac - Python scripts not visible / executable in Macros manager

Christian Lohmaier lohmaier+libreoffice at googlemail.com
Wed Mar 2 16:07:25 PST 2011


Hi Caolán, *,

On Wed, Mar 2, 2011 at 10:13 PM, Caolán McNamara <caolanm at redhat.com> wrote:
> On Sat, 2011-02-26 at 16:45 +0100, Christian Lohmaier wrote:
>> I don't see what's wrong - python people around?
>> this is basis-link/program/pythonscript.py at around line 360:
>>
>>                 for assignee in node.nodes:
>>                     if assignee.name == 'g_exportedScripts':
>>                         print "found g_exportedScripts %s" % (node.expr)
>>                         for item in node.expr:
>>                             print "won't reach this on Mac"
>>                             if item.__class__.__name__ == 'Name':
>>                                 g_exportedScripts.append(item.name)
>>                         print "and not even this point"
>>                         return g_exportedScripts
>>
>>
>> So what is wrong with "for item in node.expr:"?
>
> No idea, but maybe the error isn't there but slightly later on, to test
> that theory...
>
> change print to print >> sys.stderr, e.g.

That didn't help/didn't change anything, nothing is printed..

> If you simply change...
> --if item.__class__.__name__ == 'Name':
> --    g_exportedScripts.append(item.name)
> to just
> +g_exportedScripts.append(item.name)
> does that make a difference ?

No, still the same :-(

> What's the version of python in use on Mac ?, configure.in suggest 2.3 ?
>
> What's the output of that
> print "found g_exportedScripts %s" % (node.expr)
> line ?

$ /path/to/LibreOffice\ 3.3.1/LibreOffice.app/Contents/MacOS/soffice
found g_exportedScripts Tuple([Name('capitalisePython')])
found g_exportedScripts Tuple([Name('createTable')])

> FWIW http://docs.python.org/library/compiler.html is the api being used here. All
> the code wants to do is, if there is a g_exportedScripts in the .py,
> get the list of names of methods assigned to that g_exportedScripts by
> parsing the .py without actually executing the .py.

Yes, I wonder why it fails here :-(

ciao
Christian


More information about the LibreOffice mailing list