Hi,

Your 3rd line is supposed to be:
TABALIGN_LEFT = uno.Enum("com.sun.star.style.TabAlign", "LEFT")

With this modification I can run your code with various Python runtimes of OpenOffice.org as well as LibreOffice 3.3:
$ $OFFICE unocmp.py
A: <type 'instance'> uno.com.sun.star.style.TabStop
A: (com.sun.star.style.TabStop){ Position = (long)0x3e8, Alignment = 
(com.sun.star.style.TabAlign)LEFT, DecimalChar = (char)'.', FillChar = (char)' 
' }
B: <type 'instance'> uno.com.sun.star.style.TabStop
B: (com.sun.star.style.TabStop){ Position = (long)0x3e8, Alignment = 
(com.sun.star.style.TabAlign)LEFT, DecimalChar = (char)'.', FillChar = (char)' 
' }
A==B: True True
FIELDS:
   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 com.sun.star.style import TabStop

TABALIGN_LEFT = uno.Enum("com.sun.star.style.TabAlign", "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: [email protected]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Reply via email to