On Sun, 2007-02-18 at 16:49 +0100, Tanja wrote:
> 1.) I wonder, why we need to use a special format for the date element?
> Why not use:
> attr['date'] = child.content
> instead of:
> attr['date'] = int(time.mktime(time.strptime(child.content, fmt)))

It's nice to normalize the date for searching purposes, but yes from
what I can tell there's no fundamental reason this attribute needs to
be.


> 2.) Is the format of the date element in xmltv always either %Y-%m-%d or 
> %Y? In the xmltv.dtd I found:
> """"
> "All dates and times in this DTD follow the same format, loosely based
> "on ISO 8601.  They can be 'YYYYMMDDhhmmss' or some initial
> "substring, for example if you only know the year and month you can
> "have 'YYYYMM'.  You can also append a timezone to the end; if no
> "explicit timezone is given, UTC is assumed.  Examples:
> "'200007281733 BST', '200209', '19880523083000 +0300'.  (BST == +0100.)
> """"
> Thus a real xmltv file with date info that contains more than just the 
> year, also would fail!

Start/end times are parsed by timestr2secs_utc() which handles the
'200007281733 BST' or '19880523083000 +0300' cases, but does seem to be
lacking support for the others.

We should add support for formats %Y%m and %Y and %Y-%m-%d to
timestr2secs_utc() and then use this function also for the date
attribute.  And if the date attribute doesn't match any of these
formats, just fall back to the literal string used in the xml data.

This way at least we can still do searches on date, and although the
"1994/95" case won't get picked up, it won't cause epg to barf.
Although having "1994/95" as a date in xmltv does seem to violate its
DTD, as you point out.

I'd certainly very much like to see a native kaa.epg source for your
grabber. :)

Cheers,
Jason.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to