pyuno in Libreoffice 5.1.4.2

Jim jf_byrnes at comcast.net
Sun Jan 22 20:30:08 EST 2017


On 01/22/2017 07:02 PM, MRAB wrote:
> On 2017-01-23 00:10, Jim wrote:
>> Does anyone know if the changes outlined here [1] have been implemented?
>>
>> Supposedly changes have been made to pyuno to make it more pythonic.
>>
>> Item 2 Cellranges says that:
>> cell = sheet.getCellByPosition(cellCol + col, cellRow + row)
>> Can be written as:
>> cell = sheet.cellrange[cellRow + row, cellCol + col]
>>
>> But when I try that I get:
>>
>> Traceback (most recent call last):
>>    File
>> "/home/jfb/.config/libreoffice/4/user/Scripts/python/enter_INV/enter_INV.py",
>>
>> line 68, in keyPressed
>>      move_selected_cell(1, 0)
>>    File
>> "/home/jfb/.config/libreoffice/4/user/Scripts/python/enter_INV/enter_INV.py",
>>
>> line 112, in move_selected_cell
>>      cell = sheet.cellrange[cellRow + row, cellCol + col]
>> AttributeError: cellrange
>>
>> Or maybe I am misunderstanding how to use it.
>>
> I think it might be direct indexing of the sheet:
>
>     cell = sheet[cellRow + row, cellCol + col]
>
>> Regards,  Jim
>>
>> [1]
>> https://cgit.freedesktop.org/libreoffice/core/commit/?id=af8143bc40cf2cfbc12e77c9bb7de01b655f7b30
>>

You are correct, that worked. Thank you very much.

Regards,  Jim





More information about the Python-list mailing list