stummjr / impress-code-highlighter

A simple tool to highlight source code blocks in LibreOffice Impress.
9 stars 2 forks source link

Uno has no attribute getComponentContext #2

Closed amueller closed 9 years ago

amueller commented 9 years ago

I tried to run highlight.py but got the following error message:

> python highlight.py 
Traceback (most recent call last):
  File "highlight.py", line 63, in <module>
    doc = remote_get_doc()
  File "highlight.py", line 51, in remote_get_doc
    localContext = uno.getComponentContext()
AttributeError: 'module' object has no attribute 'getComponentContext'

I'm using uno 0.3.3

stummjr commented 9 years ago

Hi @amueller,

do you have the Python Uno bridge installed? It's available with the python3-uno package.

amueller commented 9 years ago

Is that different from the uno python package?

And does that mean that impress-code-highlighter only works with python3? python3-uno is a python3 package, but highlight.py contains an xrange.

amueller commented 9 years ago

replacing xrange by rangeI got it to work, thanks. Should I submit a PR?

stummjr commented 9 years ago

Sure, I forgot to update the code to be compatible with Python 3. I'm waiting for the PR.

Thanks!

stummjr commented 9 years ago

AFAIK, LibreOffice 4+ is using Python 3. When I wrote impress-code-highlighter, I was using LibreOffice 3 or something like that.