Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Your 3rd line is supposed to be:
TABALIGN_LEFT = uno.Enum("", "LEFT")

With this modification I can run your code with various Python runtimes of as well as LibreOffice 3.3:
A: <type 'instance'>
A: ({ Position = (long)0x3e8, Alignment = 
(, DecimalChar = (char)'.', FillChar = (char)' ' }
B: <type 'instance'>
B: ({ Position = (long)0x3e8, Alignment = 
(, DecimalChar = (char)'.', FillChar = (char)' ' }
A==B: True True
   Position True
   Alignment True
   DecimalChar True
   FillChar True

Python of LibreOffice 3.5 gives:
terminate called after throwing an instance of 'com::sun::star::registry::InvalidRegistryException'

This is my Python code including the correct indentation:

import uno
from import TabStop

TABALIGN_LEFT = uno.Enum("", "LEFT")

if __name__ == "__main__":
    a = TabStop()
    a.Position = 1000
    a.Alignment = TABALIGN_LEFT
    a.DecimalChar = '.'
    a.FillChar = ' '

    b = TabStop()
    b.Position = 1000
    b.Alignment = TABALIGN_LEFT
    b.DecimalChar = '.'
    b.FillChar = ' '

    print 'A:', type(a), a.__class__
    print 'A:', a
    print 'B:', type(b), b.__class__
    print 'B:', b
    print 'A==B:', a == b, a.value == b.value
    print 'FIELDS:'
    for field in ('Position', 'Alignment', 'DecimalChar', 'FillChar'):
        print '  ', field, getattr(a,field) == getattr(b,field)

For unsubscribe instructions e-mail to:
Posting guidelines + more:
List archive:
All messages sent to this list will be publicly archived and cannot be deleted


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.