Update of /cvsroot/freevo/freevo/Docs/html/SourceDoc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23724/html/SourceDoc

Added Files:
        Mbus.html MenuSystem.html Mevas.html Notifier.html PyEPG.html 
Log Message:
add wiki to cvs

--- NEW FILE: MenuSystem.html ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd";>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta name="robots" content="index,nofollow">


<title>SourceDoc/MenuSystem - Freevo 2.0 Wiki</title>


<link rel="stylesheet" type="text/css" charset="utf-8" media="all" 
href="../modern/css/common.css">
<link rel="stylesheet" type="text/css" charset="utf-8" media="screen" 
href="../modern/css/screen.css">
<link rel="stylesheet" type="text/css" charset="utf-8" media="print" 
href="../modern/css/print.css">
<link rel="stylesheet" type="text/css" charset="utf-8" 
href="../modern/css/freevo.css">

<link rel="alternate" title="Freevo 2.0 Wiki Recent Changes" 
href="/cgi-bin/freevo-2.0/RecentChanges?action=rss_rc&amp;ddiffs=1&amp;unique=1"
 type="application/rss+xml">
<link rel="Start" href="/cgi-bin/freevo-2.0/Index">
<link rel="Alternate" title="Wiki Markup" 
href="/cgi-bin/freevo-2.0/SourceDoc/MenuSystem?action=raw">
<link rel="Alternate" media="print" title="Print View" 
href="/cgi-bin/freevo-2.0/SourceDoc/MenuSystem?action=print">
<link rel="Up" href="/cgi-bin/freevo-2.0/SourceDoc">
<link rel="Search" href="/cgi-bin/freevo-2.0/FindPage">
<link rel="Index" href="/cgi-bin/freevo-2.0/TitleIndex">
<link rel="Glossary" href="/cgi-bin/freevo-2.0/WordIndex">
<link rel="Help" href="/cgi-bin/freevo-2.0/HelpOnFormatting">
</head>

<body  lang="en" dir="ltr">

            <!-- Header Logo and Status Line -->
<div id="titlebar"><span class="name"><a href="http://freevo.sourceforge.net/"; 
target="_blank">Freevo</a></span></div>
<div id="header">
<ul>

        <li><a href="../Index.html">User Documentation</a></li>
        <li id="current"><a href="../SourceDoc.html">Source 
Documenation</a></li>
        
</ul>
</div>
<p>&nbsp;</p>
<div id="page" lang="en" dir="ltr"><!-- start page -->


<h1 id="title">SourceDoc/MenuSystem</h1>
<div lang="en" id="content" dir="ltr">
<a id="top"></a>
<ol>

<li>
<a href="#head-5456630128205ca9c5cffda39b968f830e6c3b1c">Menu</a>
</li>

<li>
<a href="#head-745663ded2204e23999cba5c295081d54eb62ff7">Item</a>
</li>

<li>
<a href="#head-e171ce35ecb580c146c909812d4fc011e486d23c">MenuItem</a>
</li>

<li>
<a href="#head-6b5342fa4ca3fa43b25c4b5bbe2d443ae179757b">MenuWidget</a>
</li>

<li>
<a href="#head-40dd9f480765c6bc3166db16cedd43b94a0f2bcc">Example</a>
</li>

</ol>
<p> </p>
<p>Menu's in freevo are done using the classes described below. But in general 
they are essential lists of items which have their names displayed in the list. 
Each item then has actions associated with them. The first action is the one 
used when selected and you can use enter to see the others. Menu's also have 
actions that can be associated with them to perform actions or updates. </p>
<p>PleaseUpdate: The following doc is copied from the "Plugin Writing Howto" 
and needs to be checked if the information is still valid. Maybe also create 
simpler examples with more documentation. </p>

<h2 id="head-5456630128205ca9c5cffda39b968f830e6c3b1c">Menu</h2>

<p>Menu is essentially a class wrapped around an array of choices. It has 
several methods but the constructor is the most commonly used. It takes a 
title, then an array of options, and then some optional parameters. The 
reload_func is the most commonly used. The reload_func is used when you come 
back from executing an item. It's only used when you want to show something 
other than the menu you started with when you come back. 
</p>
<pre>
# make the command menu using the command_items array and when we
# call refresh with the reload arg we go back to the main menu.
command_menu = menu.Menu(_('Commands'), command_items,
                  reload_func=menuwidget.goto_main_menu)

# make a basic menu with the string variable name for its name and
# items the array of choices.
mymenu = menu.Menu(name, items)
</pre>

<h2 id="head-745663ded2204e23999cba5c295081d54eb62ff7">Item</h2>

<p>Item is the base class for anything that appears in the Menu. Generally you 
create a subclass of Item and then create an actions method to tell the menu 
what to do when the item is clicked. The name property is what the Menu object 
uses to display on the screen. You can then create other variables to hold 
important data points in. 
</p>
<pre>
class CoolItem(Item):
    def __init__(self, command):
        Item.__init__(self)
        self.name = command
        self.image = util.getimage(self.cmd)

    def actions(self):
        """
        return a list of actions for this item
        """
        items = [ ( self.runMyCommand , _('Run Command') ) ]
        return items

    def runMyCommand(self, arg=None, menuw=None):
        # do some real cool stuff..
</pre>

<h2 id="head-e171ce35ecb580c146c909812d4fc011e486d23c">MenuItem</h2>

<p>This is a convenience class it is useful in two different situations. The 
first and most common is for creating Menus to display error conditions. The 
second use is for when you only need a very simple item with a single easy 
action. </p>
<p>To use MenuItem in the error condition case you call the constructor with 
three parameters. The first parameter is what to display in the menu, the 
second is the action to take  when the item to select and the third is put the 
arg to the action function. In this case you typically wrap the constructor 
call into an append to your list of items to be given to menu. </p>
<p>To use MenuItem as a simple Item and not bother with creating your own sub 
item class, you again call the constructor with the set of three parameters.  
The first parameter is what to display in the menu, the second is the action to 
take  when the item to select and the third is put the arg to the action 
function. But typically you save a reference to this item and set a few 
additional parameters manually. 
</p>
<pre>
# you would then create a menu like normal and then push it onto the stack
command_items += [menu.MenuItem(_('No Commands found'),
                         menuwidget.goto_prev_page, 0)]

# generic item use for things that are simple
# you would then create a menu like normal and then push it onto the stack
if item.info.has_key('audio'):
    items.append(menu.MenuItem(_('Audio selection'),
                         audio_selection_menu, item))
if item.info.has_key('subtitles'):
    items.append(menu.MenuItem(_('Subtitle selection'),
                         subtitle_selection_menu, item))
if item.info.has_key('chapters'):
    items.append(menu.MenuItem(_('Chapter selection'),
                         chapter_selection_menu, item))
</pre>

<h2 id="head-6b5342fa4ca3fa43b25c4b5bbe2d443ae179757b">MenuWidget</h2>

<p>MenuWidget or menuw as it is often labelled in the code. Is a handy utility 
class where most of the menu magic happens. It has most of the default utility 
actions for menus as well as the methods to manage the menu stack. </p>
<p>Common Menu Actions: </p>
<ul>
<li><p> back_one_menu: goes to the previous menu. Typically used after 
deleteing the current menu. see cdbackup.py for an example. </p>
</li>
<li><p> goto_main_menu: jumps all the way back to the main menu. </p>
</li>
</ul>
<p>List of menu stack actions: </p>
<ul>
<li><p> pushmenu: used after constructing a menu, then typically a call to 
refresh to display the menu. </p>
</li>
<li><p> refresh: redraw the top item on the menu stack. It is usually called 
after a pushmenu call. </p>
</li>
<li><p> delete_menu: remove the currently displayed menu. </p>
</li>
</ul>
<p>PleaseUpdate: add more functions. </p>

<h2 id="head-40dd9f480765c6bc3166db16cedd43b94a0f2bcc">Example</h2>

<p>This is a full example bringing everything together </p>

<pre>
# list of items to go in the menu
mylistofitems = []

# a call to a function that returns an array of objects you would create
# your menu from. for example a call to os.listdir to return a list of strings
# containing filenames
mylistofobjects = some_func_that_returns_you_list()

# loop through our object list and add each item to the list for the menu
for myobject in mylistofobjects:
    img_item = ImageItem(myobject, self)
    mylistofitems += [ img_item ]

# handle the no objects found case if we get an empty list
# this uses a single menu item
if (len(mylistofitems) == 0):
    mylistofitems += [menu.MenuItem(_('No Objects found'),
                      menuw.back_one_menu, 0)]

# create the menu using your menu list
myobjectmenu = menu.Menu(_('My Image Objects'), mylistofitems,
                         reload_func=menuw.back_one_menu )

# now we push our menu on the top of the stack and tell it to display
menuw.pushmenu(myobjectmenu)
menuw.refresh()
</pre>
<a id="bottom"></a>

</div>
<p id="pageinfo" class="info" lang="en" dir="ltr">last edited 2004-12-12 
10:54:16 by <span title="134.102.71.53">Dischi</span>
<br>Current version: <a 
href="http://freevo.sourceforge.net/cgi-bin/freevo-2.0/SourceDoc/MenuSystem";>http://freevo.sourceforge.net/cgi-bin/freevo-2.0/SourceDoc/MenuSystem</a></p>
</div> <!-- end page -->
</body>
</html>

--- NEW FILE: Mbus.html ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd";>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta name="robots" content="index,nofollow">


<title>SourceDoc/Mbus - Freevo 2.0 Wiki</title>


<link rel="stylesheet" type="text/css" charset="utf-8" media="all" 
href="../modern/css/common.css">
<link rel="stylesheet" type="text/css" charset="utf-8" media="screen" 
href="../modern/css/screen.css">
<link rel="stylesheet" type="text/css" charset="utf-8" media="print" 
href="../modern/css/print.css">
<link rel="stylesheet" type="text/css" charset="utf-8" 
href="../modern/css/freevo.css">

<link rel="alternate" title="Freevo 2.0 Wiki Recent Changes" 
href="/cgi-bin/freevo-2.0/RecentChanges?action=rss_rc&amp;ddiffs=1&amp;unique=1"
 type="application/rss+xml">
<link rel="Start" href="/cgi-bin/freevo-2.0/Index">
<link rel="Alternate" title="Wiki Markup" 
href="/cgi-bin/freevo-2.0/SourceDoc/Mbus?action=raw">
<link rel="Alternate" media="print" title="Print View" 
href="/cgi-bin/freevo-2.0/SourceDoc/Mbus?action=print">
<link rel="Up" href="/cgi-bin/freevo-2.0/SourceDoc">
<link rel="Search" href="/cgi-bin/freevo-2.0/FindPage">
<link rel="Index" href="/cgi-bin/freevo-2.0/TitleIndex">
<link rel="Glossary" href="/cgi-bin/freevo-2.0/WordIndex">
<link rel="Help" href="/cgi-bin/freevo-2.0/HelpOnFormatting">
</head>

<body  lang="en" dir="ltr">

            <!-- Header Logo and Status Line -->
<div id="titlebar"><span class="name"><a href="http://freevo.sourceforge.net/"; 
target="_blank">Freevo</a></span></div>
<div id="header">
<ul>

        <li><a href="../Index.html">User Documentation</a></li>
        <li id="current"><a href="../SourceDoc.html">Source 
Documenation</a></li>
        
</ul>
</div>
<p>&nbsp;</p>
<div id="page" lang="en" dir="ltr"><!-- start page -->


<h1 id="title">SourceDoc/Mbus</h1>
<div lang="en" id="content" dir="ltr">
<a id="top"></a>
<ol>

<li>
<a href="#head-6b2c7dc2c37bb4de8f07a2425979f4455abc9c89">mcomm</a>
<ol>

<li>
<a href="#head-da2c960c3e618a0716c401064b2b6b207e26509a">Creating a server</a>
</li>

<li>
<a href="#head-fc8f2a0c3bf9ac26c708aa5efae3bc454dab6876">Client</a>
</li>

</ol>

<li>
<a href="#head-60aaf65c3022011dec7475b38384b80dd246250e">PyMbus</a>
</li>

</ol>
<p> </p>

<h2 id="head-6b2c7dc2c37bb4de8f07a2425979f4455abc9c89">mcomm</h2>

<p>mcomm.py is a small layer between Freevo and PyMbus to make usage of the 
mbus simpler. Warning: the interface itself may change in the future, but only 
on some minor details. </p>
<p>Freevo has a wrapper for the important mbus functions for easier access 
inside helpers and plugins. By using the wrapper, the application will join the 
mbus with the following naming scheme: "app=freevo, type=home-theatre, 
module=name" with name being the name of the helper or 'core' for the main 
freevo application. </p>
<p>First let's make an example how to use client server communication over 
mbus. That's the only thing working right now in the wrapper, events will come 
later. PyMbus supports much more than the mcomm layer, so maybe it is necessary 
to import mbus in a plugin for special stuff. </p>

<h3 id="head-da2c960c3e618a0716c401064b2b6b207e26509a">Creating a server</h3>

<p>To create a server you must inherit from mcomm.RPCServer. It is possible to 
have more than one server on one bus, the class is only a wrapper for easy 
access. Each function starting with __rpc_ and ending with __ will be 
registered as rpc to the mbus entity. So let's say you have a plugin listening 
to the rpc home.theatre.play, you would create the following plugin: 
</p>
<pre>
class PluginInterface(plugin.Plugin, mcomm.RPCServer):
    def __init__(self):
        plugin.Plugin.__init__(self)
        mcomm.RPCServer.__init__(self)

    def __rpc_play__(self, addr, val):
        file = self.parse_parameter(val, ( str, ))

        if not eventhandler.is_menu():
            return mcomm.RPCError('freevo not in menu mode')

        menuw  = eventhandler.get()
        parent = menuw.menustack[-1].selected

        for p in plugin.mimetype(None):
            i = p.get(parent, [ file ] )
            if i and hasattr(i[0], 'play'):
                i[0].play(menuw=menuw)
                return mcomm.RPCReturn([])

        return mcomm.RPCError('no player found')
</pre>
<p>Simple, isn't it? </p>

<h3 id="head-fc8f2a0c3bf9ac26c708aa5efae3bc454dab6876">Client</h3>

<p>Now, how does the client look like? </p>

<pre>
freevo = mcomm.find('freevo')

if not freevo:
    print 'freevo not running'
    sys.exit(0)

try:
    freevo.play('/my/file.mp3')
except mcomm.MException, e:
    print e
</pre>
<p>That's all. mcomm.find will wait on the bus until the freevo core comes up 
(timeout 10 sec). Calling freevo.play will result in a mbus call 
home-theatre.play with the given argument. There are three possible returns: 
</p>
<p>1. (True, return values): The server sent mcomm.RPCReturn(return values). 
Everything worked as expected. </p>
<p>2. (False, reason): The server send mcomm.RPCError(reason). The parameter 
are ok, but it was not possible to do what expected. </p>
<p>3. mcomm.MException is raised. Something went wrong. Possible reasons are a 
crash on server side, a server not answering and so on. </p>
<p>freevo.play will block until the result is there. If you don't want to wait, 
you can specify a callback to the function: 
</p>
<pre>
freevo.play('/my/file.mp3', callback=my_function)
</pre>
<p>This callback will get the raw mbus return, no True, False or MException 
stuff. </p>

<h2 id="head-60aaf65c3022011dec7475b38384b80dd246250e">PyMbus</h2>

<p>PleaseUpdate: add basic PyMbus doc here </p>
<a id="bottom"></a>

</div>
<p id="pageinfo" class="info" lang="en" dir="ltr">last edited 2004-12-12 
11:08:31 by <span title="134.102.71.53">Dischi</span>
<br>Current version: <a 
href="http://freevo.sourceforge.net/cgi-bin/freevo-2.0/SourceDoc/Mbus";>http://freevo.sourceforge.net/cgi-bin/freevo-2.0/SourceDoc/Mbus</a></p>
</div> <!-- end page -->
</body>
</html>

--- NEW FILE: PyEPG.html ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd";>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta name="robots" content="index,nofollow">


<title>SourceDoc/PyEPG - Freevo 2.0 Wiki</title>


<link rel="stylesheet" type="text/css" charset="utf-8" media="all" 
href="../modern/css/common.css">
<link rel="stylesheet" type="text/css" charset="utf-8" media="screen" 
href="../modern/css/screen.css">
<link rel="stylesheet" type="text/css" charset="utf-8" media="print" 
href="../modern/css/print.css">
<link rel="stylesheet" type="text/css" charset="utf-8" 
href="../modern/css/freevo.css">

<link rel="alternate" title="Freevo 2.0 Wiki Recent Changes" 
href="/cgi-bin/freevo-2.0/RecentChanges?action=rss_rc&amp;ddiffs=1&amp;unique=1"
 type="application/rss+xml">
<link rel="Start" href="/cgi-bin/freevo-2.0/Index">
<link rel="Alternate" title="Wiki Markup" 
href="/cgi-bin/freevo-2.0/SourceDoc/PyEPG?action=raw">
<link rel="Alternate" media="print" title="Print View" 
href="/cgi-bin/freevo-2.0/SourceDoc/PyEPG?action=print">
<link rel="Up" href="/cgi-bin/freevo-2.0/SourceDoc">
<link rel="Search" href="/cgi-bin/freevo-2.0/FindPage">
<link rel="Index" href="/cgi-bin/freevo-2.0/TitleIndex">
<link rel="Glossary" href="/cgi-bin/freevo-2.0/WordIndex">
<link rel="Help" href="/cgi-bin/freevo-2.0/HelpOnFormatting">
</head>

<body  lang="en" dir="ltr">

            <!-- Header Logo and Status Line -->
<div id="titlebar"><span class="name"><a href="http://freevo.sourceforge.net/"; 
target="_blank">Freevo</a></span></div>
<div id="header">
<ul>

        <li><a href="../Index.html">User Documentation</a></li>
        <li id="current"><a href="../SourceDoc.html">Source 
Documenation</a></li>
        
</ul>
</div>
<p>&nbsp;</p>
<div id="page" lang="en" dir="ltr"><!-- start page -->


<h1 id="title">SourceDoc/PyEPG</h1>
<div lang="en" id="content" dir="ltr">
<a id="top"></a>
<ol>

<li>
<a href="#head-a2107bc32b8b821c9c1e2edfa936eaecc507741e">Setup the database</a>
</li>

<li>
<a href="#head-b8773bc18a6308428cfda06bfa9e33f729b9d9f2">Update the database</a>
<ol>

<li>
<a href="#head-1c9d34b9af41344d64061bab977e2093b7459a2a">Using the XMLTV 
backend</a>
</li>

<li>
<a href="#head-20e8543fa3acf8ff1ab8d665b8fc4779be541499">Using the VDR 
backend</a>
</li>

</ol>

<li>
<a href="#head-02edeab41680c7a34aca2e1a3175eb310803c2ec">Access the database</a>
<ol>

<li>
<a href="#head-6393b14fb772eacd6505d6dee8fa09342f268fec">Getting channels</a>
</li>

<li>
<a href="#head-48922fa729a6982fafdff8709ba01638d9a2a43c">Using the channel 
objects to get program listing</a>
</li>

<li>
<a href="#head-9357e4ec774c557de7688a5e206d6f4b98e714ca">Searching the 
database</a>
</li>

</ol>

<li>
<a href="#head-9f69672c29b1795feaff6e02547d4bc3aac4ed5a">Writing a source 
backend</a>
</li>

<li>
<a href="#head-8b570a5eb627e6650735a33846c9ae985c510ef6">Writing a database 
backend</a>
</li>

</ol>
<p> </p>
<p>PyEPG is an electronic program guide with a database frontent. It is located 
in the Freevo source tree at lib/pyepg but it does not depend on Freevo. It 
only depends on a working sql database interface, right now only <a 
class="external" href="http://sqlite.sf.net";><img 
src="../modern/img/moin-www.png" alt="[WWW]" height="11" width="11"> 
pysqlite</a> is supported. </p>

<h2 id="head-a2107bc32b8b821c9c1e2edfa936eaecc507741e">Setup the database</h2>

<p>Before a program can use PyEPG the module needs to be connect to a database 
and load the channel list. To connect to a database you need to specify the 
type of the database and arguments this databse needs. For sqlite this is the 
path of the databse file. 
</p>
<pre>
pysql.connect('sqlite', '/path/to/db')
</pre>
<p>After that the database must be loaded. This will load all channel 
informatiosn from the database and create an internal structure of channels. 
You can add channels to the internal list even if they are not in the database 
itself, rename channels or exclude channels from the guide. The load function 
has two optional parameters, the first one the list of (channel id, name) to be 
added and the second one a list of channel ids to be excluded. If the channel 
id of the first parameter is already in the database, the internal channel name 
will be replaced with the given one. All channels given here will also be added 
on top of the internal list. 
</p>
<pre>
channels = [ ('ard.de', 'ARD'), ('zdf.de': 'ZDF') ]
exclude  = [ 'prosieben.de' ]
pyepg.load(channels, exclude)
</pre>

<h2 id="head-b8773bc18a6308428cfda06bfa9e33f729b9d9f2">Update the database</h2>

<p>To update the database call the PyEPG update function. The first parameter 
if the backend which should do the update. Right now there are two backends: 
xmltv and vdr. Both have a different set of arguments, so the specific update 
call is different. </p>

<h3 id="head-1c9d34b9af41344d64061bab977e2093b7459a2a">Using the XMLTV 
backend</h3>

<p>The <a href="../XMLTV.html">XMLTV</a> backend gets only one additional 
parameter, the TV.xml file containing the data. 
</p>
<pre>
pyepg.update('xmltv', '/tmp/TV.xml')
</pre>

<h3 id="head-20e8543fa3acf8ff1ab8d665b8fc4779be541499">Using the VDR 
backend</h3>

<p>PleaseUpdate: add description </p>

<h2 id="head-02edeab41680c7a34aca2e1a3175eb310803c2ec">Access the database</h2>


<h3 id="head-6393b14fb772eacd6505d6dee8fa09342f268fec">Getting channels</h3>

<p>There are two ways to get a channel object. The first one is using 
_<tt>_getitem_</tt>_ on the guide object. It is possible to use an integer as 
index or the database id. The second way is to use the channel object which is 
a sorted list of all channels. </p>

<pre>
pyepg.channels
pyepg.guide[2]
pyepg.guide['ard.de']
</pre>
<p>When you have a channel object, you can get previous and following channels 
with the get_channel function. This function will wrap around if the begging or 
end of the list is reached. 
</p>
<pre>
c = pyepg.guide[2]
pypeg.guide[4] == pyepg.get_channel(c, 2)
</pre>

<h3 id="head-48922fa729a6982fafdff8709ba01638d9a2a43c">Using the channel 
objects to get program listing</h3>

<p>If you have a channel object, you can access it's attributes and program 
listings. You can access every time frame you want, if no data is in the 
database at this point, dummy programs with the id -1 will be returned. </p>
<p>The channel has the following attributes: </p>
<ul>
<li><p> id: id inside the database </p>
</li>
<li><p> access_id: access id for tuner etc. </p>
</li>
<li><p> logo: url of a logo </p>
</li>
<li><p> name: channel name </p>
</li>
<li><p> title: channel display name </p>
</li>
</ul>
<p>To get programs from the epg about the channel use __getitem__ function from 
Python. 
</p>
<pre>
channel = pyepg.guide['ard.de']
now = time.time()
channel[now]              # what is running now
channel[now:now + 60*60]  # what is running in the next hour
channel[now:]             # everything in the db from now on
</pre>

<h3 id="head-9357e4ec774c557de7688a5e206d6f4b98e714ca">Searching the 
database</h3>

<p>You can use the search function to search the guide for a specific title. On 
optional second parameter is a channel id if you want to limit the search to a 
specific channel. Result is a list of Program objects. 
</p>
<pre>
pyepg.search('Tagesschau')
pyepg.search('Heute Journal', 'zdf.de')
</pre>

<h2 id="head-9f69672c29b1795feaff6e02547d4bc3aac4ed5a">Writing a source 
backend</h2>

<p>A source must be in the current Python path and must be named 
source_backend.py, e.g. source_xmltv.py or source_vdr.py. It needs to provide 
an update function. This function gets the guide object as first parameter and 
all other parameters from the pyepg.update call. </p>
<p>The source backend will need some internal functions from the guide itself 
to add the channels and programs to the database. 
</p>
<pre>
guide.sql_add_channel(id, display_name, access_id)
guide.sql_get_channel_ids()
guide.sql_add_program(self, channel_id, title, start, stop,
                      subtitle, description, episode)
guide.exclude_channels
</pre>

<h2 id="head-8b570a5eb627e6650735a33846c9ae985c510ef6">Writing a database 
backend</h2>

<p>A database backend must be in the current Python path and must be named 
db_backend.py, e.g. db_sqlite.py or db_mysql.py. The name of the class must be 
'Database'. The arguments of the init function will be based to the object when 
calling 'pyepg.connect'. The database backend must provide three functions: 
'execute', 'commit' and 'close'. In case of blocking the database must take 
care of <a href="../SourceDoc/Notifier.html">PyNotifier</a> to keep the main 
loop alive. 
</p>
<pre>
class Database:
    def __init__(self, argument listing):
        [...]

    def execute(self, query):
        [...]

    def commit(self):
        [...]

    def close(self):
        [...]
</pre>
<a id="bottom"></a>

</div>
<p id="pageinfo" class="info" lang="en" dir="ltr">last edited 2004-12-12 
15:04:41 by <span title="blk-215-73-155.eastlink.ca">rshortt</span>
<br>Current version: <a 
href="http://freevo.sourceforge.net/cgi-bin/freevo-2.0/SourceDoc/PyEPG";>http://freevo.sourceforge.net/cgi-bin/freevo-2.0/SourceDoc/PyEPG</a></p>
</div> <!-- end page -->
</body>
</html>

--- NEW FILE: Notifier.html ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd";>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta name="robots" content="index,nofollow">


<title>SourceDoc/Notifier - Freevo 2.0 Wiki</title>


<link rel="stylesheet" type="text/css" charset="utf-8" media="all" 
href="../modern/css/common.css">
<link rel="stylesheet" type="text/css" charset="utf-8" media="screen" 
href="../modern/css/screen.css">
<link rel="stylesheet" type="text/css" charset="utf-8" media="print" 
href="../modern/css/print.css">
<link rel="stylesheet" type="text/css" charset="utf-8" 
href="../modern/css/freevo.css">

<link rel="alternate" title="Freevo 2.0 Wiki Recent Changes" 
href="/cgi-bin/freevo-2.0/RecentChanges?action=rss_rc&amp;ddiffs=1&amp;unique=1"
 type="application/rss+xml">
<link rel="Start" href="/cgi-bin/freevo-2.0/Index">
<link rel="Alternate" title="Wiki Markup" 
href="/cgi-bin/freevo-2.0/SourceDoc/Notifier?action=raw">
<link rel="Alternate" media="print" title="Print View" 
href="/cgi-bin/freevo-2.0/SourceDoc/Notifier?action=print">
<link rel="Up" href="/cgi-bin/freevo-2.0/SourceDoc">
<link rel="Search" href="/cgi-bin/freevo-2.0/FindPage">
<link rel="Index" href="/cgi-bin/freevo-2.0/TitleIndex">
<link rel="Glossary" href="/cgi-bin/freevo-2.0/WordIndex">
<link rel="Help" href="/cgi-bin/freevo-2.0/HelpOnFormatting">
</head>

<body  lang="en" dir="ltr">

            <!-- Header Logo and Status Line -->
<div id="titlebar"><span class="name"><a href="http://freevo.sourceforge.net/"; 
target="_blank">Freevo</a></span></div>
<div id="header">
<ul>

        <li><a href="../Index.html">User Documentation</a></li>
        <li id="current"><a href="../SourceDoc.html">Source 
Documenation</a></li>
        
</ul>
</div>
<p>&nbsp;</p>
<div id="page" lang="en" dir="ltr"><!-- start page -->


<h1 id="title">SourceDoc/Notifier</h1>
<div lang="en" id="content" dir="ltr">
<a id="top"></a>
<p> </p>
<p>PleaseUpdate: add usage description </p>
<a id="bottom"></a>

</div>
<p id="pageinfo" class="info" lang="en" dir="ltr">last edited 2004-12-11 
12:34:01 by <span title="134.102.71.53">Dischi</span>
<br>Current version: <a 
href="http://freevo.sourceforge.net/cgi-bin/freevo-2.0/SourceDoc/Notifier";>http://freevo.sourceforge.net/cgi-bin/freevo-2.0/SourceDoc/Notifier</a></p>
</div> <!-- end page -->
</body>
</html>

--- NEW FILE: Mevas.html ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd";>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta name="robots" content="index,nofollow">


<title>SourceDoc/Mevas - Freevo 2.0 Wiki</title>


<link rel="stylesheet" type="text/css" charset="utf-8" media="all" 
href="../modern/css/common.css">
<link rel="stylesheet" type="text/css" charset="utf-8" media="screen" 
href="../modern/css/screen.css">
<link rel="stylesheet" type="text/css" charset="utf-8" media="print" 
href="../modern/css/print.css">
<link rel="stylesheet" type="text/css" charset="utf-8" 
href="../modern/css/freevo.css">

<link rel="alternate" title="Freevo 2.0 Wiki Recent Changes" 
href="/cgi-bin/freevo-2.0/RecentChanges?action=rss_rc&amp;ddiffs=1&amp;unique=1"
 type="application/rss+xml">
<link rel="Start" href="/cgi-bin/freevo-2.0/Index">
<link rel="Alternate" title="Wiki Markup" 
href="/cgi-bin/freevo-2.0/SourceDoc/Mevas?action=raw">
<link rel="Alternate" media="print" title="Print View" 
href="/cgi-bin/freevo-2.0/SourceDoc/Mevas?action=print">
<link rel="Up" href="/cgi-bin/freevo-2.0/SourceDoc">
<link rel="Search" href="/cgi-bin/freevo-2.0/FindPage">
<link rel="Index" href="/cgi-bin/freevo-2.0/TitleIndex">
<link rel="Glossary" href="/cgi-bin/freevo-2.0/WordIndex">
<link rel="Help" href="/cgi-bin/freevo-2.0/HelpOnFormatting">
</head>

<body  lang="en" dir="ltr">

            <!-- Header Logo and Status Line -->
<div id="titlebar"><span class="name"><a href="http://freevo.sourceforge.net/"; 
target="_blank">Freevo</a></span></div>
<div id="header">
<ul>

        <li><a href="../Index.html">User Documentation</a></li>
        <li id="current"><a href="../SourceDoc.html">Source 
Documenation</a></li>
        
</ul>
</div>
<p>&nbsp;</p>
<div id="page" lang="en" dir="ltr"><!-- start page -->


<h1 id="title">SourceDoc/Mevas</h1>
<div lang="en" id="content" dir="ltr">
<a id="top"></a>
<p> </p>
<p>PleaseUpdate: add usage description </p>
<a id="bottom"></a>

</div>
<p id="pageinfo" class="info" lang="en" dir="ltr">last edited 2004-12-11 
12:36:05 by <span title="134.102.71.53">Dischi</span>
<br>Current version: <a 
href="http://freevo.sourceforge.net/cgi-bin/freevo-2.0/SourceDoc/Mevas";>http://freevo.sourceforge.net/cgi-bin/freevo-2.0/SourceDoc/Mevas</a></p>
</div> <!-- end page -->
</body>
</html>



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to