conduit r1409 - in trunk: . conduit/modules/NetworkModule



Author: jstowers
Date: Fri Apr  4 12:47:52 2008
New Revision: 1409
URL: http://svn.gnome.org/viewvc/conduit?rev=1409&view=rev

Log:
2008-04-05  John Stowers  <john stowers gmail com>

	* conduit/modules/NetworkModule/NetworkModule.py: Dont enable network 
	sync support on systems with < python2.5



Modified:
   trunk/ChangeLog
   trunk/conduit/modules/NetworkModule/NetworkModule.py

Modified: trunk/conduit/modules/NetworkModule/NetworkModule.py
==============================================================================
--- trunk/conduit/modules/NetworkModule/NetworkModule.py	(original)
+++ trunk/conduit/modules/NetworkModule/NetworkModule.py	Fri Apr  4 12:47:52 2008
@@ -5,19 +5,30 @@
 Copyright: John Stowers, 2006
 License: GPLv2
 """
-import conduit.utils as Utils
-Utils.dataprovider_add_dir_to_path(__file__, "")
+import sys
+import logging
+log = logging.getLogger("modules.Network")
 
-import Client
-import Server
+#We need Python2.5 for network sync. This is because allow_none (i.e.
+#the marshalling of None in the xmlrpc server) was only added in Python2.5
+if sys.version_info[0:2] >= (2,5):
+    import conduit.utils as Utils
+    Utils.dataprovider_add_dir_to_path(__file__, "")
 
-NetworkClientFactory = Client.NetworkClientFactory
-NetworkServerFactory = Server.NetworkServerFactory
-NetworkEndpoint = Server.NetworkEndpoint
+    import Client
+    import Server
 
-MODULES = {
-        "NetworkServerFactory" :     { "type": "dataprovider-factory" },
-        "NetworkClientFactory" :     { "type": "dataprovider-factory" },
-        "NetworkEndpoint"      :     { "type": "dataprovider" },
-}
+    NetworkClientFactory = Client.NetworkClientFactory
+    NetworkServerFactory = Server.NetworkServerFactory
+    NetworkEndpoint = Server.NetworkEndpoint
+
+    MODULES = {
+            "NetworkServerFactory" :     { "type": "dataprovider-factory" },
+            "NetworkClientFactory" :     { "type": "dataprovider-factory" },
+            "NetworkEndpoint"      :     { "type": "dataprovider" },
+    }
+    log.info("Network support enabled")
+else:
+    MODULES = {}
+    log.info("Network support disabled")
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]