Author: duncan
Date: Sun Dec 16 12:44:08 2007
New Revision: 10211
Log:
Added _debug_ messages
Modified:
branches/rel-1/freevo/src/tv/edit_favorite.py
branches/rel-1/freevo/src/tv/favoriteitem.py
branches/rel-1/freevo/src/tv/plugins/view_favorites.py
branches/rel-1/freevo/src/tv/program_display.py
branches/rel-1/freevo/src/tv/programitem.py
branches/rel-1/freevo/src/util/tv_util.py
Modified: branches/rel-1/freevo/src/tv/edit_favorite.py
==============================================================================
--- branches/rel-1/freevo/src/tv/edit_favorite.py (original)
+++ branches/rel-1/freevo/src/tv/edit_favorite.py Sun Dec 16 12:44:08 2007
@@ -61,9 +61,10 @@
height Integer
context Context in which the object is instanciated
"""
-
- def __init__(self, parent=None, subject=None, left=None, top=None,
width=500,
- height=350, context=None):
+ def __init__(self, parent=None, subject=None, left=None, top=None,
width=500, height=350, context=None):
+ """ """
+ _debug_('EditFavorite.__init__(parent=%r, subject=%r, left=%r, top=%r,
width=%r, height=%r, context=%r)' % \
+ (parent, subject, left, top, width, height, context), 1)
self.oldname = None
if context:
@@ -189,7 +190,9 @@
self.cancel = Button(_('CANCEL'))
self.add_child(self.cancel)
+
def removeFavorite(self):
+ _debug_('removeFavorite()', 2)
(result, msg) = record_client.removeFavorite(self.oldname)
if result:
searcher = None
@@ -208,7 +211,9 @@
AlertBox(parent=self,
text=_('Remove Failed')+(': %s' % msg)).show()
+
def eventhandler(self, event, menuw=None):
+ _debug_('eventhandler(event=%r, menuw=%r)' % (event, menuw), 2)
if self.get_selected_child() == self.name_input:
if event == em.INPUT_LEFT:
Modified: branches/rel-1/freevo/src/tv/favoriteitem.py
==============================================================================
--- branches/rel-1/freevo/src/tv/favoriteitem.py (original)
+++ branches/rel-1/freevo/src/tv/favoriteitem.py Sun Dec 16 12:44:08 2007
@@ -45,7 +45,9 @@
Item class for favorite items
"""
def __init__(self, parent, fav, fav_action='edit'):
+ """ """
Item.__init__(self, parent, skin_type='video')
+ _debug_('FavoriteItem.__init__(parent=%r, fav=%r, fav_action=%r)' %
(parent, fav, fav_action), 2)
self.fav = fav
self.name = self.origname = fav.name
self.title = fav.title
@@ -89,6 +91,7 @@
def actions(self):
+ _debug_('actions()', 2)
return [( self.display_submenu , _('Edit favorite'))]
@@ -99,57 +102,46 @@
All attributes of a favorite can be edited here and in the end
the user must select 'save changes' to finally create the favorite.
"""
-
+ _debug_('display_submenu(arg=%r, menuw=%r)' % (arg, menuw), 2)
### create menu items for editing the favorites attributes
items = []
- items.append(menu.MenuItem(_('Modify name'),
- action=self.mod_name))
- items.append(menu.MenuItem(_('Modify channel'),
- action=self.mod_channel))
- items.append(menu.MenuItem(_('Modify day of week'),
- action=self.mod_day))
- items.append(menu.MenuItem(_('Modify time of day'),
- action=self.mod_time))
+ items.append(menu.MenuItem(_('Modify name'), action=self.mod_name))
+ items.append(menu.MenuItem(_('Modify channel'),
action=self.mod_channel))
+ items.append(menu.MenuItem(_('Modify day of week'),
action=self.mod_day))
+ items.append(menu.MenuItem(_('Modify time of day'),
action=self.mod_time))
if config.TV_RECORD_DUPLICATE_DETECTION:
if self.allowDuplicates:
- items.append(menu.MenuItem(_('Prevent Recording of
Duplicates'),
- action=self.alter_prop, arg=('dup', 'False')))
+ items.append(menu.MenuItem(_('Prevent Recording of
Duplicates'), \
+ action=self.alter_prop, arg=('dup', 'False')))
else:
items.append(menu.MenuItem(_('Allow Recording of Duplicates'),
- action=self.alter_prop, arg=('dup', 'True')))
+ action=self.alter_prop, arg=('dup', 'True')))
if config.TV_RECORD_ONLY_NEW_DETECTION:
if self.onlyNew:
- items.append(menu.MenuItem(_('Record All Episodes'),
- action=self.alter_prop, arg=('new', 'False')))
+ items.append(menu.MenuItem(_('Record All Episodes'),
action=self.alter_prop, arg=('new', 'False')))
else:
- items.append(menu.MenuItem(_('Record Only New Episodes'),
- action=self.alter_prop, arg=('new', 'True')))
+ items.append(menu.MenuItem(_('Record Only New Episodes'),
action=self.alter_prop, arg=('new', 'True')))
# XXX: priorities aren't quite supported yet
if 0:
(got_favs, favs) = record_client.getFavorites()
if got_favs and len(favs) > 1:
- items.append(menu.MenuItem(_('Modify priority'),
- action=self.mod_priority))
+ items.append(menu.MenuItem(_('Modify priority'),
action=self.mod_priority))
### save favorite
- items.append(menu.MenuItem(_('Save changes'),
- action=self.save_changes))
+ items.append(menu.MenuItem(_('Save changes'),
action=self.save_changes))
### remove this program from favorites
if not self.fav_action == 'add':
- items.append(menu.MenuItem(_('Remove favorite'),
- action=self.rem_favorite))
+ items.append(menu.MenuItem(_('Remove favorite'),
action=self.rem_favorite))
### put the whole menu together
- favorite_menu = menu.Menu(_('Favorite Menu'), items,
- item_types = 'tv favorite menu')
-
+ favorite_menu = menu.Menu(_('Favorite Menu'), items, item_types='tv
favorite menu')
favorite_menu.infoitem = self
favorite_menu.is_submenu = True
menuw.pushmenu(favorite_menu)
@@ -165,14 +157,15 @@
This opens a input box to ask the user for a new name for this
favorite.
The default name of a favorite is the name of the program.
"""
+ _debug_('mod_name(arg=%r, menuw=%r)' % (arg, menuw), 2)
self.menuw = menuw
- InputBox(text=_('Alter Name'), handler=self.alter_name,
- width = osd.get_singleton().width - config.OSD_OVERSCAN_LEFT
- 20,
- input_text=self.name).show()
+ InputBox(text=_('Alter Name'), handler=self.alter_name, \
+ width=osd.get_singleton().width - config.OSD_OVERSCAN_LEFT - 20,
input_text=self.name).show()
def alter_name(self, name):
""" set the new name"""
+ _debug_('alter_name(name=%r)' % (name,), 2)
if name:
self.name = self.fav.name = name.strip()
@@ -181,39 +174,34 @@
def mod_channel(self, arg=None, menuw=None):
"""Modify channel"""
+ _debug_('mod_channel(arg=%r, menuw=%r)' % (arg, menuw), 2)
items = []
- items.append(menu.MenuItem('ANY CHANNEL',
- action=self.alter_prop, arg=('channel', 'ANY')))
+ items.append(menu.MenuItem('ANY CHANNEL', action=self.alter_prop,
arg=('channel', 'ANY')))
for chanline in config.TV_CHANNELS:
- items.append(menu.MenuItem(chanline[1],
- action=self.alter_prop, arg=('channel', chanline[1])))
+ items.append(menu.MenuItem(chanline[1], action=self.alter_prop,
arg=('channel', chanline[1])))
- favorite_menu = menu.Menu(_('Modify Channel'), items,
- item_types = 'tv favorite menu')
+ favorite_menu = menu.Menu(_('Modify Channel'), items, item_types='tv
favorite menu')
favorite_menu.infoitem = self
menuw.pushmenu(favorite_menu)
menuw.refresh()
-
def mod_day(self, arg=None, menuw=None):
""" Modify day
Opens a submenu where the day of the week of a favorite can be
configured.
"""
+ _debug_('mod_day(arg=%r, menuw=%r)' % (arg, menuw), 2)
items = []
- items.append(menu.MenuItem(_('ANY DAY'),
- action=self.alter_prop, arg=('dow', 'ANY')))
+ items.append(menu.MenuItem(_('ANY DAY'), action=self.alter_prop,
arg=('dow', 'ANY')))
for i in range(len(self.week_days)):
- items.append(menu.MenuItem(self.week_days[i],
- action=self.alter_prop, arg=('dow', i)))
+ items.append(menu.MenuItem(self.week_days[i],
action=self.alter_prop, arg=('dow', i)))
- favorite_menu = menu.Menu(_('Modify Day'), items,
- item_types = 'tv favorite menu')
+ favorite_menu = menu.Menu(_('Modify Day'), items, item_types = 'tv
favorite menu')
favorite_menu.infoitem = self
menuw.pushmenu(favorite_menu)
menuw.refresh()
@@ -224,20 +212,17 @@
Opens a submenu where the time of a favorite can be configured.
"""
+ _debug_('mod_time(arg=%r, menuw=%r)' % (arg, menuw), 2)
items = []
- items.append(menu.MenuItem(_('ANY TIME'), action=self.alter_prop,
- arg=('mod', 'ANY')))
+ items.append(menu.MenuItem(_('ANY TIME'), action=self.alter_prop,
arg=('mod', 'ANY')))
for i in range(48):
mod = i * 30
- items.append(menu.MenuItem(time.strftime(config.TV_TIME_FORMAT,
- time.gmtime(float(mod * 60))),
- action=self.alter_prop,
- arg=('mod', mod)))
+ items.append(menu.MenuItem(time.strftime(config.TV_TIME_FORMAT,
time.gmtime(float(mod * 60))), \
+ action=self.alter_prop, arg=('mod', mod)))
- favorite_menu = menu.Menu(_('Modify Time'), items,
- item_types = 'tv favorite menu')
+ favorite_menu = menu.Menu(_('Modify Time'), items, item_types = 'tv
favorite menu')
favorite_menu.infoitem = self
menuw.pushmenu(favorite_menu)
menuw.refresh()
@@ -249,6 +234,7 @@
This function is where the properties of a favorite really are changed.
"""
+ _debug_('alter_prop(arg=%r, menuw=%r)' % (arg, menuw), 2)
(prop, val) = arg
if prop == 'channel':
@@ -306,7 +292,6 @@
menuw.init_page()
menuw.refresh()
-
elif prop == 'new':
# twisted needs FALSE and TRUE, it does not know False and True
if val == 'True':
@@ -334,6 +319,7 @@
"""
Save favorite
"""
+ _debug_('save_changes(arg=%r, menuw=%r)' % (arg, menuw), 2)
# this can take some time, as it means although to update the schedule
msgtext = _('Saving the changes to this favorite.')+'\n'
msgtext+= _('This may take some time.')
@@ -371,6 +357,7 @@
"""
Remove favorite
"""
+ _debug_('rem_favorite(arg=%r, menuw=%r)' % (arg, menuw), 2)
name = self.origname
(result, msg) = record_client.removeFavorite(name)
if result:
Modified: branches/rel-1/freevo/src/tv/plugins/view_favorites.py
==============================================================================
--- branches/rel-1/freevo/src/tv/plugins/view_favorites.py (original)
+++ branches/rel-1/freevo/src/tv/plugins/view_favorites.py Sun Dec 16
12:44:08 2007
@@ -40,24 +40,25 @@
class ViewFavoritesItem(Item):
def __init__(self, parent):
+ _debug_('ViewFavoritesItem.__init__(parent=%r)' % (parent,), 2)
Item.__init__(self, parent, skin_type='tv')
self.name = _('View Favorites')
self.menuw = None
def actions(self):
+ _debug_('actions()', 2)
return [ ( self.view_favorites , _('View Favorites') ) ]
def view_favorites(self, arg=None, menuw=None):
+ _debug_('view_favorites(arg=%r, menuw=%r)' % (arg, menuw), 2)
items = self.get_items()
if not len(items):
AlertBox(_('No favorites.')).show()
return
- favorite_menu = menu.Menu(_( 'View Favorites'), items,
- reload_func = self.reload,
- item_types = 'tv favorite menu')
+ favorite_menu = menu.Menu(_( 'View Favorites'), items,
reload_func=self.reload, item_types='tv favorite menu')
self.menuw = menuw
rc.app(None)
menuw.pushmenu(favorite_menu)
@@ -65,6 +66,7 @@
def reload(self):
+ _debug_('reload()', 2)
menuw = self.menuw
menu = menuw.menustack[-1]
@@ -83,6 +85,7 @@
def get_items(self):
+ _debug_('get_items()', 2)
items = []
(server_available, msg) = record_client.connectionTest()
@@ -97,7 +100,6 @@
favorites.sort(f)
for fav in favorites:
items.append(FavoriteItem(self, fav))
-
else:
AlertBox(_('Get favorites failed')+(': %s' % favorites)).show()
return []
@@ -114,7 +116,9 @@
"""
def __init__(self):
+ _debug_('PluginInterface.__init__()', 2)
plugin.MainMenuPlugin.__init__(self)
def items(self, parent):
+ _debug_('items(parent=%r)' % (parent,), 2)
return [ ViewFavoritesItem(parent) ]
Modified: branches/rel-1/freevo/src/tv/program_display.py
==============================================================================
--- branches/rel-1/freevo/src/tv/program_display.py (original)
+++ branches/rel-1/freevo/src/tv/program_display.py Sun Dec 16 12:44:08 2007
@@ -61,6 +61,7 @@
Item class for program items in the tv guide
"""
def __init__(self, parent, prog, context='guide'):
+ _debug_('ProgramItem.__init__(parent=%r, prog=%r, context=%r)' %
(parent, prog, context), 2)
Item.__init__(self, parent, skin_type='video')
self.prog = prog
self.context = context
@@ -107,6 +108,7 @@
def actions(self):
+ _debug_('actions()', 2)
return [( self.display_program , _('Display program') ,
'MENU_SUBMENU')]
@@ -122,6 +124,7 @@
This function checks if the program is already scheduled or a favorite
and chooses the appropriate menu entries.
"""
+ _debug_('display_program(arg=%r, menuw=%r)' % (arg, menuw), 2)
#list of entries for the menu
items = []
@@ -183,6 +186,7 @@
### Actions:
def play_program(self, arg=None, menuw=None):
""" Play """
+ _debug_('play_program(arg=%r, menuw=%r)' % (arg, menuw), 2)
menuw.delete_menu()
rc.post_event('PLAY')
@@ -190,12 +194,14 @@
"""
View a full scrollable description of the program.
"""
+ _debug_('view_description(arg=%r, menuw=%r)' % (arg, menuw), 2)
ShowProgramDetails(menuw, self.prog)
def schedule_program(self, arg=None, menuw=None):
"""
add a program to schedule
"""
+ _debug_('schedule_program(arg=%r, menuw=%r)' % (arg, menuw), 2)
(result, msg) = record_client.scheduleRecording(self.prog)
if result:
if menuw:
@@ -213,6 +219,7 @@
"""
remove a program from schedule
"""
+ _debug_('remove_program(arg=%r, menuw=%r)' % (arg, menuw), 2)
(result, msg) = record_client.removeScheduledRecording(self.prog)
if result:
if menuw:
@@ -227,6 +234,7 @@
"""
Find more of this program
"""
+ _debug_('find_more(arg=%r, menuw=%r)' % (arg, menuw), 2)
_debug_(String('searching for: %s' % self.prog.title))
@@ -263,6 +271,7 @@
"""
Add a program to favorites
"""
+ _debug_('add_favorite(arg=%r, menuw=%r)' % (arg, menuw), 2)
if menuw:
# we do not want to return to this menu,
# if we delete it here, then later back_one_menu
@@ -281,6 +290,7 @@
"""
Edit the settings of a favorite
"""
+ _debug_('edit_favorite(arg=%r, menuw=%r)' % (arg, menuw), 2)
if menuw:
# we do not want to return to this menu,
# if we delete it here, then later back_one_menu
@@ -306,6 +316,7 @@
Item class for favorite items
"""
def __init__(self, parent, fav, fav_action='edit'):
+ _debug_('FavoriteItem.__init__(parent=%r, fav=%r, fav_action=%r)' %
(parent, fav, fav_action), 2)
Item.__init__(self, parent, skin_type='video')
self.fav = fav
self.name = self.origname = fav.name
@@ -345,6 +356,7 @@
def actions(self):
+ _debug_('actions()', 2)
return [( self.display_favorite , _('Display favorite') ,
'MENU_SUBMENU')]
@@ -355,6 +367,7 @@
All attributes of a favorite can be edited here and in the end
the user must select 'save changes' to finally create the favorite.
"""
+ _debug_('display_favorite(arg=%r, menuw=%r)' % (arg, menuw), 2)
### create menu items for editing the favorites attributes
items = []
@@ -404,6 +417,7 @@
This opens a input box to ask the user for a new name for this
favorite.
The default name of a favorite is the name of the program.
"""
+ _debug_('mod_name(arg=%r, menuw=%r)' % (arg, menuw), 2)
self.menuw = menuw
InputBox(text=_('Alter Name'), handler=self.alter_name,
width = osd.get_singleton().width - config.OSD_OVERSCAN_RIGHT
- 20,
@@ -412,6 +426,7 @@
def alter_name(self, name):
""" set the new name"""
+ _debug_('alter_name(name=%r)' % (name), 2)
if name:
self.name = self.fav.name = name.strip()
@@ -423,6 +438,7 @@
This opens a submenu where the user can change the settings for the
duplication detection.
"""
+ _debug_('mod_dup(arg=%r, menuw=%r)' % (arg, menuw), 2)
items = []
items.append(menu.MenuItem('Allow Duplicates', action=self.alter_prop,
arg=('dup', 'True')))
@@ -441,6 +457,7 @@
This opens a submenu where the user can choose if all episodes of
a program should be recorded or only new ones.
"""
+ _debug_('mod_new(arg=%r, menuw=%r)' % (arg, menuw), 2)
items = []
items.append(menu.MenuItem('All Episodes', action=self.alter_prop,
arg=('new', 'False')))
@@ -455,6 +472,7 @@
def mod_channel(self, arg=None, menuw=None):
"""Modify channel"""
+ _debug_('mod_channel(arg=%r, menuw=%r)' % (arg, menuw), 2)
items = []
items.append(menu.MenuItem('ANY CHANNEL', action=self.alter_prop,
@@ -477,6 +495,7 @@
Opens a submenu where the day of the week of a favorite can be
configured.
"""
+ _debug_('mod_day(arg=%r, menuw=%r)' % (arg, menuw), 2)
items = []
items.append(menu.MenuItem(_('ANY DAY'), action=self.alter_prop,
@@ -498,6 +517,7 @@
Opens a submenu where the time of a favorite can be configured.
"""
+ _debug_('mod_time(arg=%r, menuw=%r)' % (arg, menuw), 2)
items = []
items.append(menu.MenuItem(_('ANY TIME'), action=self.alter_prop,
@@ -523,6 +543,7 @@
This function is where the properties of a favorite really are changed.
"""
+ _debug_('alter_prop(arg=%r, menuw=%r)' % (arg, menuw), 2)
(prop, val) = arg
if prop == 'channel':
@@ -575,6 +596,7 @@
"""
Save favorite
"""
+ _debug_('save_changes(arg=%r, menuw=%r)' % (arg, menuw), 2)
if self.fav_action == 'edit':
# first we remove the old favorite
(result, msg) = record_client.removeFavorite(self.origname)
@@ -617,6 +639,7 @@
"""
Remove favorite
"""
+ _debug_('rem_favorite(arg=%r, menuw=%r)' % (arg, menuw), 2)
name = self.origname
(result, msg) = record_client.removeFavorite(name)
if result:
@@ -630,12 +653,16 @@
else:
# if all fails then we should show an error
AlertBox(text=_('Remove Failed')+(': %s' % msg)).show()
+
+
+
# Program Info screen
class ShowProgramDetails:
"""
Screen to show the details of the TV program
"""
def __init__(self, menuw, prg):
+ _debug_('ShowProgramDetails.__init__(menuw=%r, prg=%r)' % (menuw,
prg), 2)
if prg is None:
name = _('No Information Available')
sub_title = ''
@@ -681,6 +708,7 @@
def getattr(self, name):
+ _debug_('getattr(name=%r)' % (name,), 2)
if name == 'title':
return self.name
@@ -694,6 +722,7 @@
"""
eventhandler
"""
+ _debug_('eventhandler(event=%r, menuw=%r)' % (event, menuw), 2)
if event in ('MENU_SELECT', 'MENU_BACK_ONE_MENU'):
rc.app(None)
self.menuw.show()
Modified: branches/rel-1/freevo/src/tv/programitem.py
==============================================================================
--- branches/rel-1/freevo/src/tv/programitem.py (original)
+++ branches/rel-1/freevo/src/tv/programitem.py Sun Dec 16 12:44:08 2007
@@ -24,7 +24,7 @@
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
+# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# ----------------------------------------------------------------------
@@ -57,14 +57,15 @@
"""
def __init__(self, parent, prog, context='menu'):
Item.__init__(self, parent, skin_type='video')
+ _debug_('__init__(parent=%r, prog=%r, context=%r)' % (parent, prog,
context), 2)
# prog is a TvProgram object as we get it from the recordserver
self.prog = prog
self.context= context
if hasattr(prog, 'name'): self.name = self.title = prog.name
if hasattr(prog, 'title'): self.title = self.name = prog.title
- if hasattr(prog,'sub_title'): self.sub_title = prog.sub_title
- if hasattr(prog,'desc'): self.description = prog.desc
+ if hasattr(prog, 'sub_title'): self.sub_title = prog.sub_title
+ if hasattr(prog, 'desc'): self.description = prog.desc
# categories
if hasattr(prog, 'categories'):self.categories = prog.categories
@@ -91,14 +92,15 @@
self.favorite = False
# start time
- self.start = time.strftime(config.TV_DATETIME_FORMAT,
+ self.start = time.strftime(config.TV_DATETIME_FORMAT,
time.localtime(prog.start))
# stop time
- self.stop = time.strftime(config.TV_DATETIME_FORMAT,
+ self.stop = time.strftime(config.TV_DATETIME_FORMAT,
time.localtime(prog.stop))
def actions(self):
""" List of actions """
+ _debug_('actions()', 2)
#list of entries for the menu
items = []
@@ -116,7 +118,7 @@
# check if this program is scheduled
(got_schedule, schedule) = record_client.getScheduledRecordings()
if got_schedule:
- (result, message) = record_client.isProgScheduled(self.prog,
+ (result, message) = record_client.isProgScheduled(self.prog,
schedule.getProgramList())
if result:
self.scheduled = True
@@ -152,6 +154,7 @@
"""
Start watching TV
"""
+ _debug_('play(arg=%r, menuw=%r)' % (arg, menuw), 2)
# watching TV should only be possible from the guide
if not self.context=='guide':
rc.post_event(MENU_SELECT)
@@ -198,6 +201,7 @@
"""
View a full scrollable description of the program.
"""
+ _debug_('show_description(arg=%r, menuw=%r)' % (arg, menuw), 2)
ShowProgramDetails(menuw, self)
@@ -205,6 +209,7 @@
"""
schedule or unschedule this program, depending on its current status
"""
+ _debug_('toggle_rec(arg=%r, menuw=%r)' % (arg, menuw), 2)
if self.scheduled:
# remove this program from schedule it it is already scheduled
self.remove_program(menuw=menuw)
@@ -218,6 +223,7 @@
"""
Add a program to schedule
"""
+ _debug_('schedule_program(arg=%r, menuw=%r)' % (arg, menuw), 2)
# schedule the program
(result, msg) = record_client.scheduleRecording(self.prog)
if result:
@@ -238,6 +244,7 @@
"""
Remove a program from schedule
"""
+ _debug_('remove_program(arg=%r, menuw=%r)' % (arg, menuw), 2)
# remove the program
(result, msg) = record_client.removeScheduledRecording(self.prog)
if result:
@@ -258,11 +265,12 @@
"""
Add a program to favorites
"""
+ _debug_('add_favorite(arg=%r, menuw=%r)' % (arg, menuw), 2)
if menuw:
menuw.delete_submenu(refresh=False)
# create a favorite
- fav = Favorite(self.title, self.prog,
- True, True, True, -1, True, False)
+ fav = Favorite(self.title, self.prog, True, True, True, -1, True,
False)
+ _debug_('self.title=%r, self.prog=%r, fav.__dict__=%r)' % (self.title,
self.prog, fav.__dict__), 2)
# and a favorite item which represents the submen
fav_item = FavoriteItem(self, fav, fav_action='add')
# and open that submenu
@@ -273,6 +281,7 @@
"""
Edit the settings of a favorite
"""
+ _debug_('edit_favorite(arg=%r, menuw=%r)' % (arg, menuw), 2)
if menuw:
menuw.delete_submenu(refresh=False)
@@ -292,9 +301,10 @@
"""
Find more of this program
"""
- _debug_(String('searching for: %s' % self.title),2)
+ _debug_('find_more(arg=%r, menuw=%r)' % (arg, menuw), 2)
# this might take some time, thus we open a popup messages
+ _debug_(String('searching for: %s' % self.title), 2)
pop = PopupBox(text=_('Searching, please wait...'))
pop.show()
# do the search
@@ -322,8 +332,7 @@
return
# create a menu from the search result
- search_menu = menu.Menu(_( 'Search Results' ), items,
- item_types = 'tv program menu')
+ search_menu = menu.Menu(_('Search Results'), items, item_types='tv
program menu')
# do not return from the search list to the submenu
# where the search was initiated
menuw.delete_submenu(refresh = False)
@@ -335,6 +344,7 @@
"""
Open the submenu for this item
"""
+ _debug_('display_submenu(arg=%r, menuw=%r)' % (arg, menuw), 2)
if not menuw:
return
# this tries to imitated freevo's internal way of creating submenus
@@ -352,6 +362,7 @@
Screen to show the details of the TV program
"""
def __init__(self, menuw, prg):
+ _debug_('ShowProgramDetails.__init__(menuw=%r, prg=%r)' % (menuw,
prg), 2)
if prg is None:
name = _('No Information Available')
sub_title = ''
@@ -382,7 +393,7 @@
if prg.ratings:
description += u'\n'
- for system,value in prg.ratings.items():
+ for system, value in prg.ratings.items():
description += u'\n' + _('Rating') + u'(' + system + u') :
' + value
# that's all, we can show this to the user
@@ -394,6 +405,9 @@
def getattr(self, name):
+ """
+ """
+ _debug_('getattr(name=%r)' % (name,), 2)
if name == 'title':
return self.name
@@ -407,8 +421,8 @@
"""
eventhandler for the programm description display
"""
+ _debug_('eventhandler(event=%r, menuw=%r)' % (event, menuw), 2)
menuw = self.menuw
- _debug_('programdescription: %s' % event, 2)
event_consumed = ScrollableTextScreen.eventhandler(self, event, menuw)
if not event_consumed:
if event == PLAY:
Modified: branches/rel-1/freevo/src/util/tv_util.py
==============================================================================
--- branches/rel-1/freevo/src/util/tv_util.py (original)
+++ branches/rel-1/freevo/src/util/tv_util.py Sun Dec 16 12:44:08 2007
@@ -55,25 +55,26 @@
The translation get rid of strange characters as e.g. german umlauts
"""
- translation_table = \
- ' ' \
- + ' ' \
- + ' !"#$%&' + "'" + '()*+,-./' \
- + '0123456789:;<=>?' \
- + '@ABCDEFGHIJKLMNO' \
- + 'PQRSTUVWXYZ[\]^_' \
- + '`abcdefghijklmno' \
- + 'pqrstuvwxyz{|}~ ' \
- + ' ' \
- + ' ' \
- + ' ' \
- + ' ' \
- + 'AAAAAAACEEEEIIII' \
- + 'DNOOOOOxOUUUUYPS' \
- + 'aaaaaaaceeeeiiii' \
- + 'dnooooo/ouuuuypy'
+ translation_table \
+ = ' ' \
+ + ' ' \
+ + ' !"#$%&' + "'" + '()*+,-./' \
+ + '0123456789:;<=>?' \
+ + '@ABCDEFGHIJKLMNO' \
+ + 'PQRSTUVWXYZ[\]^_' \
+ + '`abcdefghijklmno' \
+ + 'pqrstuvwxyz{|}~ ' \
+ + ' ' \
+ + ' ' \
+ + ' ' \
+ + ' ' \
+ + 'AAAAAAACEEEEIIII' \
+ + 'DNOOOOOxOUUUUYPS' \
+ + 'aaaaaaaceeeeiiii' \
+ + 'dnooooo/ouuuuypy'
favname = string.translate(progname,translation_table)
+ _debug_('progname2favname(progname=%r) favname=%r' % (progname, favname),
2)
return favname
@@ -99,9 +100,8 @@
filemask = config.TV_RECORD_FILE_MASK % filename_array
filemask = time.strftime(filemask, time.localtime(prog.start))
- filename = os.path.join(config.TV_RECORD_DIR,
- progname2filename(filemask).rstrip(' -_:') +
- config.TV_RECORD_FILE_SUFFIX)
+ filename = os.path.join(config.TV_RECORD_DIR,
progname2filename(filemask).rstrip(' -_:') + \
+ config.TV_RECORD_FILE_SUFFIX)
return filename
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog