Update of /cvsroot/freevo/freevo/WIP/Ruelle
In directory sc8-pr-cvs1:/tmp/cvs-serv21589
Modified Files:
tvtime.py
Log Message:
ok it should be ready for merge.
Index: tvtime.py
===================================================================
RCS file: /cvsroot/freevo/freevo/WIP/Ruelle/tvtime.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** tvtime.py 14 Oct 2003 18:54:56 -0000 1.11
--- tvtime.py 15 Oct 2003 19:00:41 -0000 1.12
***************
*** 10,15 ****
# -----------------------------------------------------------------------
# $Log$
! # Revision 1.11 2003/10/14 18:54:56 mikeruelle
! # now we merge stationlist if it already exists
#
# Revision 1.17 2003/09/03 17:54:38 dischi
--- 10,15 ----
# -----------------------------------------------------------------------
# $Log$
! # Revision 1.12 2003/10/15 19:00:41 mikeruelle
! # ok it should be ready for merge.
#
# Revision 1.17 2003/09/03 17:54:38 dischi
***************
*** 59,62 ****
--- 59,63 ----
from xml.dom.ext.reader import Sax2
from xml.dom.ext import PrettyPrint
+ from cStringIO import StringIO
import util # Various utilities
***************
*** 101,114 ****
helpcmd = '%s --help' % config.TVTIME_CMD
has_xmltv=False
- print helpcmd
child = popen2.Popen3( helpcmd, 1, 100)
data = child.childerr.readline() # Just need the first line
- print data
if data:
data = re.search( "^tvtime: Running tvtime
(?P<major>\d+).(?P<minor>\d+).(?P<version>\d+).", data )
if data:
! print "major is: %s" % data.group( "major" )
! print "minor is: %s" % data.group( "minor" )
! print "version is: %s" % data.group( "version" )
major = int(data.group( "major" ))
minor = int(data.group( "minor" ))
--- 102,113 ----
helpcmd = '%s --help' % config.TVTIME_CMD
has_xmltv=False
child = popen2.Popen3( helpcmd, 1, 100)
data = child.childerr.readline() # Just need the first line
if data:
data = re.search( "^tvtime: Running tvtime
(?P<major>\d+).(?P<minor>\d+).(?P<version>\d+).", data )
if data:
! _debug_("major is: %s" % data.group( "major" ))
! _debug_("minor is: %s" % data.group( "minor" ))
! _debug_("version is: %s" % data.group( "version" ))
major = int(data.group( "major" ))
minor = int(data.group( "minor" ))
***************
*** 149,153 ****
if not os.path.isfile(self.tvtimecache):
! print 'no cache file'
return 1
--- 148,152 ----
if not os.path.isfile(self.tvtimecache):
! _debug_('no cache file')
return 1
***************
*** 159,174 ****
if not (cachelconf == self.mylocalconf):
! print 'local_conf changed places'
return 1
- print cachelconf_t
- print self.mylocalconf_t
-
if (long(self.mylocalconf_t) > long(cachelconf_t)):
! print 'local_conf modified'
return 1
if (long(self.myfconfig_t) > long(cachefconf_t)):
! print 'fconfig modified'
return 1
--- 158,170 ----
if not (cachelconf == self.mylocalconf):
! _debug_('local_conf changed places')
return 1
if (long(self.mylocalconf_t) > long(cachelconf_t)):
! _debug_('local_conf modified')
return 1
if (long(self.myfconfig_t) > long(cachefconf_t)):
! _debug_('fconfig modified')
return 1
***************
*** 190,196 ****
def writeTvtimeXML(self):
tvtimexml = os.path.join(os.environ['HOME'], '.tvtime', 'tvtime.xml')
! #BUG take the tvtime binary and strip off its path and use that to
! #prepend here
! configcmd = "tvtime-configure"
cf_norm, cf_input, cf_clist, cf_device = config.TV_SETTINGS.split()
s_norm = cf_norm.upper()
--- 186,191 ----
def writeTvtimeXML(self):
tvtimexml = os.path.join(os.environ['HOME'], '.tvtime', 'tvtime.xml')
! configcmd = os.path.dirname(config.TVTIME_CMD)
! configcmd += "tvtime-configure"
cf_norm, cf_input, cf_clist, cf_device = config.TV_SETTINGS.split()
s_norm = cf_norm.upper()
***************
*** 205,209 ****
def writeStationListXML(self):
- print "writing new stationlist.xml"
self.createChannelsLookupTables()
norm='freevo'
--- 200,203 ----
***************
*** 217,220 ****
--- 211,215 ----
def mergeStationListXML(self, tvtimefile, tvnorm, norm):
+ _debug_("merging stationlist.xml")
try:
os.rename(tvtimefile,tvtimefile+'.bak')
***************
*** 260,270 ****
freevonode.appendChild(fchild)
c = c + 1
! #PrettyPrint the results to stationlistxml
fp = open(tvtimefile,'wb')
! PrettyPrint(doc, fp)
fp.close()
def writeNewStationListXML(self, tvtimefile, tvnorm, norm):
fp = open(tvtimefile,'wb')
fp.write('<?xml version="1.0"?>\n')
--- 255,276 ----
freevonode.appendChild(fchild)
c = c + 1
! # YUCK:
! # PrettyPrint the results to stationlistxml unfortuneately it
! # adds a bunch of stuff in comments at the end of the file
! # that causes the document not to load if we merge again later
! # so I print to a string buffer and then remove the offending
! # comments by truncating the output.
! strIO = StringIO()
! PrettyPrint(doc, strIO)
! mystr = strIO.getvalue()
! myindex = mystr.find('</stationlist>')
! mystr = mystr[:myindex+15]
fp = open(tvtimefile,'wb')
! fp.write(mystr)
fp.close()
def writeNewStationListXML(self, tvtimefile, tvnorm, norm):
+ _debug_("writing new stationlist.xml")
fp = open(tvtimefile,'wb')
fp.write('<?xml version="1.0"?>\n')
***************
*** 300,314 ****
if config.FREQUENCY_TABLE.has_key(channel):
! print "have a custom"
return "Custom"
elif (re.search('^\d+$', channel)):
! print "have number"
if self.chanlists.has_key(config.CONF.chanlist):
! print "found chanlist in our list"
return self.chanlists[config.CONF.chanlist]
elif self.chans2band.has_key(channel):
! print "We know this channels band."
return self.chans2band[channel]
! print "ok so we are not that smart"
return "US Cable"
--- 306,320 ----
if config.FREQUENCY_TABLE.has_key(channel):
! _debug_("have a custom")
return "Custom"
elif (re.search('^\d+$', channel)):
! _debug_("have number")
if self.chanlists.has_key(config.CONF.chanlist):
! _debug_("found chanlist in our list")
return self.chanlists[config.CONF.chanlist]
elif self.chans2band.has_key(channel):
! _debug_("We know this channels band.")
return self.chans2band[channel]
! _debug_("defaulting to USCABLE")
return "US Cable"
***************
*** 489,493 ****
def eventhandler(self, event, menuw=None):
! print '%s: %s app got %s event' % (time.time(), self.mode, event)
if event == em.STOP or event == em.PLAY_END:
self.Stop()
--- 495,499 ----
def eventhandler(self, event, menuw=None):
! _debug_('%s: %s app got %s event' % (time.time(), self.mode, event))
if event == em.STOP or event == em.PLAY_END:
self.Stop()
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog