conduit r1416 - in trunk: . conduit conduit/dataproviders conduit/gtkui conduit/modules/NetworkModule



Author: jstowers
Date: Mon Apr  7 13:21:19 2008
New Revision: 1416
URL: http://svn.gnome.org/viewvc/conduit?rev=1416&view=rev

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

	* conduit/Synchronization.py:
	* conduit/dataproviders/DataProvider.py:
	* conduit/gtkui/Canvas.py:
	* conduit/modules/NetworkModule/XMLRPCUtils.py: Remove get_status_text()
	and just make the dataprovider status be a string.



Modified:
   trunk/ChangeLog
   trunk/conduit/Synchronization.py
   trunk/conduit/dataproviders/DataProvider.py
   trunk/conduit/gtkui/Canvas.py
   trunk/conduit/modules/NetworkModule/XMLRPCUtils.py

Modified: trunk/conduit/Synchronization.py
==============================================================================
--- trunk/conduit/Synchronization.py	(original)
+++ trunk/conduit/Synchronization.py	Mon Apr  7 13:21:19 2008
@@ -646,7 +646,7 @@
 
                 #refresh state
                 elif self.state is self.REFRESH_STATE:
-                    log.debug("Source Status = %s" % self.source.module.get_status_text())
+                    log.debug("Source Status = %s" % self.source.module.get_status())
                     #Refresh the source
                     try:
                         self.source.module.refresh()

Modified: trunk/conduit/dataproviders/DataProvider.py
==============================================================================
--- trunk/conduit/dataproviders/DataProvider.py	(original)
+++ trunk/conduit/dataproviders/DataProvider.py	Mon Apr  7 13:21:19 2008
@@ -16,20 +16,18 @@
 import conduit.utils as Utils
 import conduit.Settings as Settings
 
-#Constants used in the sync state machine
-STATUS_NONE = 0
-STATUS_CHANGE_DETECTED = 1
-STATUS_REFRESH = 2
-STATUS_DONE_REFRESH_OK = 3
-STATUS_DONE_REFRESH_ERROR = 4
-STATUS_SYNC = 5
-STATUS_DONE_SYNC_OK = 6
-STATUS_DONE_SYNC_ERROR = 7
-STATUS_DONE_SYNC_SKIPPED = 8
-STATUS_DONE_SYNC_CANCELLED = 9
-STATUS_DONE_SYNC_CONFLICT = 10
-STATUS_DONE_SYNC_NOT_CONFIGURED = 11
-
+STATUS_NONE = _("Ready")
+STATUS_CHANGE_DETECTED = _("New data to sync")
+STATUS_REFRESH = _("Refreshing...")
+STATUS_DONE_REFRESH_OK = _("Refreshed OK")
+STATUS_DONE_REFRESH_ERROR = _("Error Refreshing")
+STATUS_SYNC = _("Synchronizing...")
+STATUS_DONE_SYNC_OK = _("Synchronized OK")
+STATUS_DONE_SYNC_ERROR = _("Error Synchronizing")
+STATUS_DONE_SYNC_SKIPPED = _("Synchronization Skipped")
+STATUS_DONE_SYNC_CANCELLED = _("Synchronization Cancelled")
+STATUS_DONE_SYNC_CONFLICT = _("Synchronization Conflict")
+STATUS_DONE_SYNC_NOT_CONFIGURED = _("Not Configured Correctly")
 
 class DataProviderBase(gobject.GObject):
     """
@@ -142,9 +140,6 @@
         """
         Sets the dataprovider status. If the status has changed then emits
         a status-changed signal
-        
-        @param newStatus: The new status
-        @type newStatus: C{int}
         """
         if newStatus != self.get_status():
             self.status = newStatus
@@ -152,44 +147,10 @@
         
     def get_status(self):
         """
-        @returns: The current dataproviders status (code)
-        @rtype: C{int}
+        @returns: The current dataproviders status
         """
         return self.status
         
-    def get_status_text(self):
-        """
-        @returns: a textual representation of the current dataprover status
-        @rtype: C{str}
-        """
-        s = self.get_status()
-        if s == STATUS_NONE:
-            return _("Ready")
-        elif s == STATUS_CHANGE_DETECTED:
-            return _("New data to sync")
-        elif s == STATUS_REFRESH:
-            return _("Refreshing...")
-        elif s == STATUS_DONE_REFRESH_OK:
-            return _("Refreshed OK")
-        elif s == STATUS_DONE_REFRESH_ERROR:
-            return _("Error Refreshing")
-        elif s == STATUS_SYNC:
-            return _("Synchronizing...")
-        elif s == STATUS_DONE_SYNC_OK:
-            return _("Synchronized OK")
-        elif s == STATUS_DONE_SYNC_ERROR:
-            return _("Error Synchronizing")
-        elif s == STATUS_DONE_SYNC_SKIPPED:
-            return _("Synchronization Skipped")
-        elif s == STATUS_DONE_SYNC_CANCELLED:
-            return _("Synchronization Cancelled")
-        elif s == STATUS_DONE_SYNC_CONFLICT:
-            return _("Synchronization Conflict")
-        elif s == STATUS_DONE_SYNC_NOT_CONFIGURED:
-            return _("Not Configured Correctly")
-        else:
-            return "BAD PROGRAMMER"
-            
     def is_busy(self):
         """
         A DataProvider is busy if it is currently in the middle of the

Modified: trunk/conduit/gtkui/Canvas.py
==============================================================================
--- trunk/conduit/gtkui/Canvas.py	(original)
+++ trunk/conduit/gtkui/Canvas.py	Mon Apr  7 13:21:19 2008
@@ -662,7 +662,7 @@
         log.debug("CHANGE DETECTED")
 
     def _on_status_changed(self, dataprovider):
-        msg = dataprovider.get_status_text()
+        msg = dataprovider.get_status()
         self.statusText.set_property("text", msg)
         
     def update_appearance(self):
@@ -677,7 +677,7 @@
         if self.model.module == None:
             statusText = self.PENDING_MESSAGE
         else:
-            statusText = self.model.module.get_status_text()
+            statusText = self.model.module.get_status()
         self.statusText.set_property("text",statusText)
 
         self.box.set_property("fill_color_rgba",self._get_fill_color())

Modified: trunk/conduit/modules/NetworkModule/XMLRPCUtils.py
==============================================================================
--- trunk/conduit/modules/NetworkModule/XMLRPCUtils.py	(original)
+++ trunk/conduit/modules/NetworkModule/XMLRPCUtils.py	Mon Apr  7 13:21:19 2008
@@ -187,10 +187,6 @@
     def get_status(self):
         return self.server.get_status()
         
-    @Utils.log_function_call(clog)
-    def get_status_text(self):
-        return self.server.get_status_text()
-        
     def get_name(self):
         return "Remote %s" % self._name_
         
@@ -222,7 +218,6 @@
         #the module directly
         self.register_function(self.dpw.module.set_status)
         self.register_function(self.dpw.module.get_status)
-        self.register_function(self.dpw.module.get_status_text)
 
 
     def get_info(self):



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