Update of /cvsroot/freevo/freevo/src/helpers
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8247/src/helpers

Modified Files:
        epg.py 
Log Message:
pyepg updates and disable some functions


Index: epg.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/helpers/epg.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** epg.py      4 Dec 2004 01:35:29 -0000       1.3
--- epg.py      13 Dec 2004 01:43:25 -0000      1.4
***************
*** 8,15 ****
  
  import config
! from tv.channels import get_epg
  
! epg = get_epg()
! print 'Using database: %s' % epg.db.db.filename
  
  
--- 8,20 ----
  
  import config
! import sysconfig
! import pyepg
  
! pyepg.connect('sqlite', sysconfig.datafile('epgdb'))
! pyepg.load(config.TV_CHANNELS, config.TV_CHANNELS_EXCLUDE)
! 
! 
! # db.db.db looks a bit rediculous!
! print 'Using database: %s' % pyepg.guide.db.db.db.filename
  
  
***************
*** 17,21 ****
      print '\nUsage:  %s [options]' % sys.argv[0]
      print '\nOptions:'
-     print '  [-c|--update-channels]            Use config to add new 
channels.'
      print '  [-h|--help]                       Print help and exit.'
      print '  [-i|--info]                       Print some information.'
--- 22,25 ----
***************
*** 31,49 ****
  
  
- def update_channels():
-     for chan in config.TV_CHANNELS:
-         epg.add_channel(chan[0], chan[1], chan[2])
-         
- 
  def list_channels():
-     res = epg.execute('select * from channels')
      print 'EPGDB Channels:'
      print '---------------'
!     for row in res:
!         print '%s: %s' % (row.id, row.call_sign)
  
  
  def list_programs(channel):
!     print epg.get_programs(channel)
  
  
--- 35,50 ----
  
  
  def list_channels():
      print 'EPGDB Channels:'
      print '---------------'
!     for c in pyepg.channels:
!         print '%s: %s' % (c.id, c.title)
  
  
  def list_programs(channel):
!     print 'list_programs() disabled'
!     sys.exit(0)
!     for c in pyepg.channels:
!         print c
  
  
***************
*** 54,61 ****
      print 'FILE: "%s"' % xmltv_file
  
!     epg.add_data_xmltv(xmltv_file)
  
  
  def info():
      print 'Version:'
      print epg.execute('select * from admin')
--- 55,64 ----
      print 'FILE: "%s"' % xmltv_file
  
!     pyepg.update('xmltv', xmltv_file)
  
  
  def info():
+     print 'info() disabled'
+     sys.exit(0)
      print 'Version:'
      print epg.execute('select * from admin')
***************
*** 71,74 ****
--- 74,79 ----
  
  def list_tables():
+     print 'list_tables() disabled'
+     sys.exit(0)
      rows = epg.execute('select tbl_name from sqlite_master where \
                          type="table" order by tbl_name')
***************
*** 82,95 ****
      print 'Results:'
      print '--------'
!     programs = epg.search_programs(subs)
      for p in programs:
!         print '%s:%d: %s - %s' % (String(p['channel_id']), p['id'], 
!                String(p['title']), 
                 time.strftime('%b %d ' + config.TV_TIMEFORMAT, 
!                              time.localtime(p['start'])))
  
  
  def test_func():
!     epg.expire_programs()
      sys.exit(0)
  
--- 87,100 ----
      print 'Results:'
      print '--------'
!     programs = pyepg.search(subs)
      for p in programs:
!         print '%s:%d: %s - %s' % (String(p.channel.id), p.id, 
!                String(p.title), 
                 time.strftime('%b %d ' + config.TV_TIMEFORMAT, 
!                              time.localtime(p.start)))
  
  
  def test_func():
!     pyepg.guide.expire_programs()
      sys.exit(0)
  



-------------------------------------------------------
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