-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On July 8, 2003 12:53 am, Aubin Paul wrote:

> We don't use it for display purposes, the channel id was being used
> for just that, a unique channel id. The problem is that changing
> something like that should come with some warning.
>
> I am indebted to the xmltv for their project, but this was frustrating
> to find out.

Fair enough. It *did* screw me up as well. I let out a curse when I noticed my 
load_listings script fail.


> Speaking of which, did you update your xmltv module? I'd be happy to
> merge in your changes into Freevo, especially if it provides a
> tangible benefit to people upgrading xmltv versions.

The lastest version is always at 
http://www.funktronics.ca:86/svn/python-xmltv/

The one you're using is the third version that I wrote. I've only made a 
couple of minor changes since then. xmltv.py simply provides raw access to 
XMLTV data and was written to the DTD, which hasn't changed. Incidentally, I 
never use that data directly. I made classes which I store in a ZODB database 
with IndexedCatalog. ( 
http://www.funktronics.ca:86/svn/openpvr/openpvr/openpvr/broadcast.py )

Actually, I should probably explain that a bit more, as you may find it 
interesting. Basically, I have a ZODB database accessable through ZEO 
running. That's neat because it stores native Python objects and allows you 
to access them as if they were all in memory. In reality, ZEO/ZODB only loads 
objects from it's storage as you access them. It's pretty seamless and it 
really cuts down on the memory use.

I'm using a package called IndexedCatalog to provide an indexing system for 
the objects. It's seriously cool, easy to use, and incredibly fast. It uses a 
simple query language so you can do something like in the following scripts:

http://www.funktronics.ca:86/svn/openpvr/openpvr/scripts/opsearch
http://www.funktronics.ca:86/svn/openpvr/openpvr/scripts/opnow

There are all kinds of other objects that I've defined or am planning to 
define:

- - Event - This object, upon creation, schedules a run of 'OpenPVR_eventwrapper 
some_unique_id' upon initialisation via at and is placed in a dictionary in 
the ZODB. OpenPVR_eventwrapper gets the object and calls it's run() method, 
which would generally call some method. I use this to schedule recordings 
from a GUI interface I wrote in PyQt. I also see this as being useful for 
sending Jabber messages: "Your favorite show is coming on in one minute!"

- - Resource - I haven't made this one yet but it's pretty simple. It would be a 
base class for all kinds of resource types such as mass storage or tv cards. 
Each Resource object would contain a hostname that resource resides on plus 
information about how to use that resource. This lets you easily build PVR 
clusters

- - Preference - Implemented, but I haven't used it yet. This allows you to set 
preferences so that a PVR can figure out what it should record. So far there 
are 'Title', 'Category', and 'Channel' preferences. Each preference has 
thumbsUp() and thumbsDown() methods that increment and decrement the score

- - Connectors - Kind of implemented, never used. These allow you to define 
actions that should occur when other actions occur. It's kind of like Qt's 
signal/slot mechanism, but not quite...

There's all kinds of stuff that can be done with it, but since I'm the only 
one who's ever used the code, I only rarely play with it. I do use the 
'opnow', 'opsearch', and 'openpvr_gui' programs fairly often, though.

If you want to try it out, just use:

svn co http://www.funktronics.ca:86/svn

or if you don't have Subversion:

wget -r http://www.funktronics.ca:86/svn

and delete all of the 'index.html' files that come down.


> > Wait until XMLTV 0.6 is released. That will include some major structural
> > changes in both programme and channel.
>
> That ought to be fun :)

I'll have a new xmltv.py by the time it's released, but like the current one, 
it will provide raw access to the data. This means that there will be 
refactoring needed. I'll probably make a compatibility mode though so that 
you can take your time converting. If you want to see what's in store, check 
out 
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/xmltv/xmltv/todo/xmltv-0.6.dtd
 
for the latest revision. There will probably be more modifications before 
release, though. It's being discussed fairly heavily on xmltv-devel.


> We'll probably need to start doing that going forward. The main
> advantage is we get to use "our" names for things. Like xmltv (or
> rather, zap2it) calls "Comedy Network" "Channel 44 COMEDC" though I
> prefer "Comedy Network" since I really could care less what channel
> number it is, but knowing what it means "to me" helps.
>
> It's a small thing, but convenient.

You could create an 'override' dict, something like:

channelOverrides =      { 'Channel 44 COMEDC': "Comedy Network",
                                ...
                                }

Whenever you use display-name, check to see if it's in channelOverrides. If 
it's there, use that, otherwise, leave it as it is. That way you can have the 
best of both worlds.


> > The format of channel['display-name'] didn't change, not in tv_grab_na at
> > least, and it will not change over the lifetime of 0.5.x.
>
> I think you're correct, but the important thing we were using was the
> channel id to map listings to channels, each programme has "channel"
> in it, but changing that id makes it a little trickier. I'm never sure
> what we're supposed to 'index' by if not the channel field.

Yeah, that's a pain, especially with the current DTD. Fortunately for me, 
IndexedCatalog will happily index member instances in newer versions. I just 
changed my Program object to use a Channel object instead of the id. After 
that I needed to add one line to my load_listings script to set it before 
indexing. I'll never have to worry about the id again.

- -- 
James Oakley
[EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)

iD8DBQE/CmPyKtn0F7+/lLMRApCdAKDKSlfa6jA2OazPDo/q4tJ5V42a4wCfWVhu
iqjcmftXYrYRZTYiyH7yHT0=
=ylOh
-----END PGP SIGNATURE-----



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
Freevo-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to