Author: duncan
Date: Wed Jun 13 18:24:56 2007
New Revision: 9687
Modified:
branches/rel-1/freevo/ChangeLog
branches/rel-1/freevo/src/tv/record_client.py
Log:
[ 1734781 ] Add functionality to record_client
Patch from Valera Koval applied
Modified: branches/rel-1/freevo/ChangeLog
==============================================================================
--- branches/rel-1/freevo/ChangeLog (original)
+++ branches/rel-1/freevo/ChangeLog Wed Jun 13 18:24:56 2007
@@ -20,6 +20,7 @@
* Added sounds to menu selection, enabled with OSD_SOUNDS_ENABLED (F#1732380)
* Updated childapp to use subprocess instead of popen (F#1729597)
* Updated local_conf.py.example with MPLAYER_HAS_FIELD_DOMINANCE (F#1729404)
+ * Updated record_client to allow favourites to be added from the command line
(F#1734781)
* Updated skins to adjust the window heights when the button bar is active
(F#1733061)
* Updated system sensors for a configurable path (B#1731892)
* Updated xine video plug-in to allow bookmarks to work (F#1729024)
Modified: branches/rel-1/freevo/src/tv/record_client.py
==============================================================================
--- branches/rel-1/freevo/src/tv/record_client.py (original)
+++ branches/rel-1/freevo/src/tv/record_client.py Wed Jun 13 18:24:56 2007
@@ -56,7 +56,7 @@
try:
(status, message) = server.getScheduledRecordings()
except Exception, e:
- print 'getScheduledRecordings:', e
+ _debug_('%s' % e)
return (FALSE, 'record_client: '+_('connection error'))
return returnFromJelly(status, message)
@@ -75,7 +75,7 @@
try:
(status, message) = server.echotest(teststr)
except Exception, e:
- print 'connectionTest:', e
+ _debug_('%s' % e)
traceback.print_exc()
return (FALSE, 'record_client: '+_('connection error'))
@@ -152,8 +152,7 @@
try:
(status, response) = server.findMatches(find, movies_only)
except Exception, e:
- print 'Search error for \'%s\'' % find
- print e
+ _debug_('Search error for \'%s\' %s' % (find, e), config.DWARNING)
return (FALSE, 'record_client: '+_('connection error'))
return returnFromJelly(status, response)
@@ -174,7 +173,7 @@
server.addEditedFavorite(jellyToXML(name), \
jellyToXML(title), chan, dow, mod, priority, allowDuplicates,
onlyNew)
except Exception, e:
- print e
+ _debug_('%s' % e, config.DERROR)
traceback.print_exc()
return (FALSE, 'record_client: '+_('connection error'))
@@ -273,22 +272,49 @@
if function == "updateFavoritesSchedule":
(result, response) = updateFavoritesSchedule()
- print response
+ _debug_('%r' % response)
if function == "test":
(result, response) = connectionTest('connection test')
- print 'result: %s, response: %s ' % (result, response)
+ _debug_('result: %s, response: %s ' % (result, response))
+
if function == "moviesearch":
if len(sys.argv) >= 3:
- find = sys.argv[2]
+ find = Unicode(sys.argv[2])
+
+ (result, response) = findMatches(find, 0)
+ if result:
+ for prog in response:
+ _debug_('Prog: %s' % prog.title)
+ else:
+ _debug_('result: %s, response: %s ' % (result, response))
else:
find = ''
- (result, response) = findMatches(find, 1)
- if result:
- for prog in response:
- print 'Prog: %s' % prog.title
+
+ if function == "addfavorite":
+ if len(sys.argv) >= 3:
+ name=Unicode(string.join(sys.argv[2:]))
+ title=name
+ channel="ANY"
+ dow="ANY"
+ mod="ANY"
+ priority=0
+ allowDuplicates=FALSE
+ onlyNew=TRUE
+
+ (result, msg) =
addEditedFavorite(name,title,channel,dow,mod,priority,allowDuplicates,onlyNew)
+ if not result:
+ # it is important to show the user this error,
+ # because that means the favorite is removed,
+ # and must be created again
+ _debug_('Save Failed, favorite was lost: %s' % (msg),
config.DWARNING)
+ else:
+ _debug_('Ok!')
+ (result, response) = updateFavoritesSchedule()
+ _debug_('%r' % response)
else:
- print 'result: %s, response: %s ' % (result, response)
+ favorite = ''
+ _debug_('no data')
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog