Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #18135 > unrolled thread

Where does this readOne() method come from?

Started bytinnews@isbd.co.uk
First post2011-12-28 19:04 +0000
Last post2011-12-29 14:36 +0000
Articles 4 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  Where does this readOne() method come from? tinnews@isbd.co.uk - 2011-12-28 19:04 +0000
    Re: Where does this readOne() method come from? Terry Reedy <tjreedy@udel.edu> - 2011-12-28 15:41 -0500
    Re: Where does this readOne() method come from? Chris Angelico <rosuav@gmail.com> - 2011-12-29 07:45 +1100
      Re: Where does this readOne() method come from? tinnews@isbd.co.uk - 2011-12-29 14:36 +0000

#18135 — Where does this readOne() method come from?

Fromtinnews@isbd.co.uk
Date2011-12-28 19:04 +0000
SubjectWhere does this readOne() method come from?
Message-ID<rr5ss8-hhr.ln1@chris.zbmc.eu>
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:

    >>> parsedCal = vobject.readOne(icalstream)
    >>> parsedCal.vevent.dtstart.value
    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.

    >>> vobject.readComponents(icalstream).next().vevent.dtstart.value
    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! :-)

-- 
Chris Green

[toc] | [next] | [standalone]


#18139

FromTerry Reedy <tjreedy@udel.edu>
Date2011-12-28 15:41 -0500
Message-ID<mailman.4193.1325104920.27778.python-list@python.org>
In reply to#18135
On 12/28/2011 2:04 PM, tinnews@isbd.co.uk wrote:
> 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:
>
>      >>>  parsedCal = vobject.readOne(icalstream)

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.

-- 
Terry Jan Reedy

[toc] | [prev] | [next] | [standalone]


#18140

FromChris Angelico <rosuav@gmail.com>
Date2011-12-29 07:45 +1100
Message-ID<mailman.4194.1325105133.27778.python-list@python.org>
In reply to#18135
On Thu, Dec 29, 2011 at 6:04 AM,  <tinnews@isbd.co.uk> wrote:
> 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

[toc] | [prev] | [next] | [standalone]


#18176

Fromtinnews@isbd.co.uk
Date2011-12-29 14:36 +0000
Message-ID<lfaus8-l57.ln1@chris.zbmc.eu>
In reply to#18140
Chris Angelico <rosuav@gmail.com> wrote:
> On Thu, Dec 29, 2011 at 6:04 AM,  <tinnews@isbd.co.uk> wrote:
> > 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.
> 
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.

-- 
Chris Green

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web