Author: dmeyer
Date: Mon Apr 16 18:11:45 2007
New Revision: 2628

Modified:
   trunk/epg/src/__init__.py

Log:
add autoconnect variable to turn off auto connect() call

Modified: trunk/epg/src/__init__.py
==============================================================================
--- trunk/epg/src/__init__.py   (original)
+++ trunk/epg/src/__init__.py   Mon Apr 16 18:11:45 2007
@@ -52,6 +52,8 @@
 # connected client object
 guide = Client()
 
+autoconnect = True
+
 def connect(address = 'epg', auth_secret = ''):
     """
     Connect to the epg server with the given address and auth secret.
@@ -67,6 +69,8 @@
     Return a list of all channels.
     """
     if guide.status == DISCONNECTED:
+        if not autoconnect:
+            return []
         connect()
     return guide.get_channels(sort)
 
@@ -76,6 +80,8 @@
     Return the channel with the given name.
     """
     if guide.status == DISCONNECTED:
+        if not autoconnect:
+            return None
         connect()
     return guide.get_channel(name)
 
@@ -88,6 +94,8 @@
     arrived from the server.
     """
     if guide.status == DISCONNECTED:
+        if not autoconnect:
+            return []
         connect()
         while block and guide.status == CONNECTING:
             kaa.notifier.step()
@@ -101,4 +109,4 @@
 
 
 def is_connected():
-    return guide and guide.status == CONNECTED
+    return guide.status == CONNECTED

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

Reply via email to