Author: dmeyer
Date: Sun Oct 16 14:25:51 2005
New Revision: 7715

Modified:
   trunk/freevo-tvdev/bin/freevo-tvdev
   trunk/freevo-tvdev/src/tvcards.py

Log:
adjust to new cfgparser

Modified: trunk/freevo-tvdev/bin/freevo-tvdev
==============================================================================
--- trunk/freevo-tvdev/bin/freevo-tvdev (original)
+++ trunk/freevo-tvdev/bin/freevo-tvdev Sun Oct 16 14:25:51 2005
@@ -39,11 +39,12 @@
 
 
 def usage():
-    print 'usage:'
-    print '"%s" to start' % sys.argv[0]
-    print '"%s list" to list all devices' % sys.argv[0]
-    print '"%s configure device help" to get help on configuration' % 
sys.argv[0]
-    print '"%s configure device key=value [key=value ...]" to configure card' 
% sys.argv[0]
+    bin = os.path.basename(sys.argv[0])
+    print '\nusage:'
+    print '"%s" to start' % bin
+    print '"%s list" to list all devices' % bin
+    print '"%s configure device help" to get help on configuration' % bin
+    print '"%s configure device key=value [key=value ...]" to configure card' 
% bin
     print
     print 'options:'
     print '-c config file [ default = %s ]' % cfgfile
@@ -67,6 +68,10 @@
 
 if len(args) == 0:
     devices.detect(cfgfile)
+    if not devices.DEVICES:
+        log.error('no active devies found, terminate')
+        usage()
+        sys.exit(0)
 
     # create controller
     c = Controller()

Modified: trunk/freevo-tvdev/src/tvcards.py
==============================================================================
--- trunk/freevo-tvdev/src/tvcards.py   (original)
+++ trunk/freevo-tvdev/src/tvcards.py   Sun Oct 16 14:25:51 2005
@@ -55,6 +55,10 @@
     def __init__(self, device, config):
         self.device = device
         self.config = config[device]
+        if not self.config:
+            config.add_section(device)
+            self.config = config[device]
+            
         self.priority = self.config.getint('priority', 0)
         self.channels_conf = ''
         self.active = self.config.getboolean('active', True)


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to