Where does this readOne() method come from?

T

tinnews

In the (rather sparse) documentation for the vobject package it has,
in the section about parsing iCalendar objects, the following:-

Parsing iCalendar objects
=========================

To parse one top level component from an existing iCalendar stream or
string, use the readOne function:
datetime.datetime(2006, 2, 16, 0, 0, tzinfo=tzutc())

Similarly, readComponents is a generator yielding one top level
component at a time from a stream or string.
datetime.datetime(2006, 2, 16, 0, 0, tzinfo=tzutc())

More examples can be found in source code doctests.


However *nowhere* can I find anything that tells me what or where the
readOne() is. It's not to be found in the full epydoc API
documentation for vobject (or, at least, I can't find it).

All I want to do is read a .ics file and parse it. I used to use the
icalendar package but that seems less well supported than vobject so
I'm trying to use vobject instead but I'm not getting far at present.

It sort of feels like "everyone knows what readOne() is", but I don't! :)
 
T

Terry Reedy

In the (rather sparse) documentation for the vobject package it has,
in the section about parsing iCalendar objects, the following:-

Parsing iCalendar objects
=========================

To parse one top level component from an existing iCalendar stream or
string, use the readOne function:

It is obviously supposed to come from the 'vobject' package, whatever
that is. I have never heard of vobject before, though. Try reading the
source if the doc is limited. Or ask the author or mailing list if there
is one.
It sort of feels like "everyone knows what readOne() is",

Nope

PS You already know the answer to the question you asked in the subject
line. Better would have been "What is the vobject.readOne function?" to
catch the eye of someone who *does* know something about vobject.
 
C

Chris Angelico

In the (rather sparse) documentation for the vobject package it has,
in the section about parsing iCalendar objects, the following:-

   >>> parsedCal = vobject.readOne(icalstream)

Presumably you have this vobject package. Assuming it's installed
correctly, all you need to do is:

import vobject

and then vobject.readOne should be available.

Chris Angelico
 
T

tinnews

Chris Angelico said:
Presumably you have this vobject package. Assuming it's installed
correctly, all you need to do is:

import vobject

and then vobject.readOne should be available.
Digging harder into the epydoc documentation I finally found
vobject.vobject.readOne().

However having twice been befuddled by vobject, once when using it for
vCard and this time using it for vCal I've decided to move back to the
python-icalendar I was using before.

The only reason I tried to use vobject is that it's in the Ubuntu
repositories (I doing this on an xubuntu system), but it doesn't
appear to have a current maintainer and python-icalendar does so even
though it's a 'manual' install I'm sticking with python-icalendar.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top