Author: rshortt
Date: Tue Mar  7 13:23:39 2006
New Revision: 8051

Modified:
   trunk/WIP/RobShortt/webserver-epg2/src/pages/search.py

Log:
Search uses kaa.epg2 now, still a work in progress, record does not yet work.


Modified: trunk/WIP/RobShortt/webserver-epg2/src/pages/search.py
==============================================================================
--- trunk/WIP/RobShortt/webserver-epg2/src/pages/search.py      (original)
+++ trunk/WIP/RobShortt/webserver-epg2/src/pages/search.py      Tue Mar  7 
13:23:39 2006
@@ -33,11 +33,9 @@
 import time
 import logging
 
-# kaa imports
-import kaa.epg
-
 # freevo core imports
 import freevo.ipc
+from freevo.ipc.epg import connect as guide
 
 # webserver includes
 from freevo.webserver import *
@@ -61,11 +59,7 @@
         if not searchstr:
             programs = []
         else:
-            programs = kaa.epg.search(Unicode(searchstr),
-                                    by_chan,
-                                    form.get('search_title'),
-                                    form.get('search_subtitle'),
-                                    form.get('search_description'))
+            programs = guide().search(keywords = searchstr)
 
         if len(programs) < 1:
             if searchstr:
@@ -78,7 +72,7 @@
             self.tableCell(_('Stop Time'), 'class="guidehead" colspan="1"')
             self.tableCell(_('Channel'), 'class="guidehead" colspan="1"')
             self.tableCell(_('Title'), 'class="guidehead" colspan="1"')
-            self.tableCell(_('Episode'),'class="guidehead" colspan="1"')
+            # self.tableCell(_('Episode'),'class="guidehead" colspan="1"')
             self.tableCell(_('Program Description'), 'class="guidehead" 
colspan="1"')
             self.tableCell(_('Actions'), 'class="guidehead" colspan="1"')
             self.tableRowClose()
@@ -89,7 +83,7 @@
                 status = 'basic'
 
                 for rp in rec_progs:
-                    if p.channel.id == rp.channel and rp.start == p.start:
+                    if p.channel.short_name == rp.channel and rp.start == 
p.start:
                         if rp.status == u'recording':
                            status = 'recording'
                         elif rp.status == u'conflict':
@@ -114,32 +108,32 @@
                                            time.localtime(p.stop)),
                              'class="'+status+'" colspan="1"')
 
-                self.tableCell(Unicode(p.channel.title), 'class="'+status+'" 
colspan="1"')
+                self.tableCell(Unicode(p.channel.short_name), 
'class="'+status+'" colspan="1"')
                 self.tableCell(Unicode(p.title), 'class="'+status+'" 
colspan="1"')
-                self.tableCell(Unicode(p.subtitle), 'class="'+status+'" 
colspan="1"')
+                # self.tableCell(Unicode(p.subtitle), 'class="'+status+'" 
colspan="1"')
 
-                if Unicode(p.description) == u'':
+                if Unicode(p.desc) == u'' or p.desc == None:
                     cell = \
                      _('Sorry, the program description for %s is 
unavailable.')\
                      % ('<b>'+p.title+'</b>')
                 else:
-                    cell = Unicode(p.description)
+                    cell = Unicode(p.desc)
 
                 self.tableCell(cell, 'class="'+status+'" colspan="1"')
 
                 if status == 'scheduled':
                     cell = ('<a 
href="recordings?chan=%s&start=%s&action=remove">'+
-                            _('Remove')+'</a>') % (p.channel.id, p.start)
+                            _('Remove')+'</a>') % (p.channel.short_name, 
p.start)
                 elif status == 'recording':
                     cell = ('<a 
href="recordings?chan=%s&start=%s&action=remove">'+
-                           _('Record')+'</a>') % (p.channel.id, p.start)
+                           _('Record')+'</a>') % (p.channel.short_name, 
p.start)
                 else:
                     cell = ('<a 
href="recordings?chan=%s&start=%s&action=add">'+
-                           _('Record')+'</a>') % (p.channel.id, p.start)
+                           _('Record')+'</a>') % (p.channel.short_name, 
p.start)
 
                 cell += \
                      (' | <a 
href="edit_favorite?chan=%s&start=%s&action=add">'+
-                     _('New favorite')+'</a>') % (p.channel.id, p.start)
+                     _('New favorite')+'</a>') % (p.channel.short_name, 
p.start)
 
                 self.tableCell(cell, 'class="'+status+'" colspan="1"')
 


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to