How to work with PyUNO documentation?

Hello, I'm having a problem with the docs. E.g. there's a method
"gotoRange" that takes "XTextRange" type. So, I need to find a method
in the class of opened document that returns that type. Well, easy:

    >>> type(file)
    <class 'pyuno'>

And… there isn't documentation for the class "pyuno". That's just the
name of the API itself! The problem is even deeper, just look at the
example:

    >>> type(file)
    <class 'pyuno'>
    >>> file.getBookmarks()
    pyuno object
(com.sun.star.container.XNameAccess)0x1141318{implementationName=SwXBookmarks,
supportedServices={com.sun.star.text.Bookmarks},
supportedInterfaces={com.sun.star.container.XNameAccess,com.sun.star.container.XIndexAccess,com.sun.star.lang.XServiceInfo,com.sun.star.lang.XTypeProvider,com.sun.star.uno.XWeak}}
    >>> type(cursor)
    <class 'pyuno'>
    >>> cursor.getBookmarks()
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    AttributeError: getBookmarks

Huh, what? I couldn't call the same method of two objects of the single class?!

So, how am I supposed to work with documentation? I am totally
confused, the only solution I see is seeking for a working examples —
but how then these peoples found docs?

UNO is self-documenting and there is a GUI for what it has to tell:

Hm, that's interesting. However I couldn't figure out how to get
properties of the object under the cursor. I'm feel there's a
misunderstanding. E.g. for a test I placed cursor to a simple text,
called MRI, and copied all the properties. Next I placed cursor to the
"Table Of Contents", and did the same action. In the end I used diff
utility between both contents, and found that for the different
objects there's the same properties list :confused:

What do I do wrong?

The LibreOffice API might help you a bit further, assuming you can draw
a parallel from the Java UNO documentation :

http://api.libreoffice.org/docs/java/ref/index.html

Alex

Double-Click

Okay, in the end I found the answer, so I share it with list. An
important thing is of course the MRI. But often this have no use at
all. E.g. in my case I was needed to iterate thru paragraphs, and I
couldn't find anything related. Even more — I found a function
«getFlatParagraphIterator()» which was the only thing that mentions
them, and I was confused that I must to do something with that.

In the end it turned to be the «createEnumeration()», and the answer
is impossible to infer deductively with just MRI.

So, the second important thing is the Oracle's book «StarOfficeTM 6.0
Office Suite». It explains many things of the UNO API, e.g. the reason
behind not having an iterator thru paragraphs (it seems to be made
like some kind of linked list of objects that not all are paragraphs).
Although the book rather about StarOffice, but is still a great help.