conduit r1180 - in trunk: . conduit/dataproviders



Author: johncarr
Date: Thu Jan 10 09:46:45 2008
New Revision: 1180
URL: http://svn.gnome.org/viewvc/conduit?rev=1180&view=rev

Log:
Safe AutoSync. Don't overwrite ChangeLog in build system.

Modified:
   trunk/ChangeLog
   trunk/Makefile.am
   trunk/conduit/dataproviders/AutoSync.py

Modified: trunk/Makefile.am
==============================================================================
--- trunk/Makefile.am	(original)
+++ trunk/Makefile.am	Thu Jan 10 09:46:45 2008
@@ -35,11 +35,9 @@
 dist-hook:
 	@echo "Generating Changelog, NEWS, TODO"
 	@if test -d $(top_srcdir)/.svn ; then \
-		svn2cl --output=$(distdir)/ChangeLog --authors=$(top_srcdir)/AUTHORS --group-by-day; \
-	    wget -q -O $(distdir)/NEWS "http://www.conduit-project.org/wiki/$(VERSION)?format=txt" ; \
+		wget -q -O $(distdir)/NEWS "http://www.conduit-project.org/wiki/$(VERSION)?format=txt" ; \
 		wget -q -O $(distdir)/TODO "http://www.conduit-project.org/wiki/TODO?format=txt"; ; \
 	else \
-		touch $(distdir)/ChangeLog; \
 		touch $(distdir)/NEWS; \
 		touch $(distdir)/TODO; \
 	fi

Modified: trunk/conduit/dataproviders/AutoSync.py
==============================================================================
--- trunk/conduit/dataproviders/AutoSync.py	(original)
+++ trunk/conduit/dataproviders/AutoSync.py	Thu Jan 10 09:46:45 2008
@@ -3,49 +3,19 @@
 import logging
 log = logging.getLogger("dataproviders.AutoSync")
 
-class AutoSync(object): 
-    def __init__(self): pass
-    def handle_added(self, uid): pass
-    def handle_modified(self, uid): pass
-    def handle_deleted(self, uid): pass
-
-class BrokenAutoSync(object):
+class AutoSync(object):
     def __init__(self):
-        self.as_added = []
-        self.as_modified = []
-        self.as_deleted = []
         self.timeout = 5
         self._timeout_id = 0
 
-        self.first_sync = True
-
-        # decorate functions
-        self.get_changes = self.decorated_changes(self.get_changes)
-        self.finish = self.decorated_finish(self.finish)
-
     def handle_added(self, uid):
-        if not uid in self.as_added and not uid in self.as_modified:
-            if uid in self.as_deleted:
-                self.as_deleted.remove(uid)
-                self.as_modified.append(uid)
-            else:    
-                self.as_added.append(uid)
-            self._handle_change()
+        self._handle_change()
 
     def handle_modified(self, uid):
-        if not uid in self.as_modified and not uid in self.as_deleted and not uid in self.as_added:
-            self.as_modified.append(uid)
-            self._handle_change()
+        self._handle_change()
 
     def handle_deleted(self, uid):
-        if not uid in self.as_deleted:
-            if uid in self.as_added:
-                self.as_added.remove(uid)
-            else:
-                if uid in self.as_modified:
-                    self.as_modified.remove(uid)
-                self.as_deleted.append(uid)
-            self._handle_change()
+        self._handle_change()
 
     def _handle_change(self):
         # reset timer..
@@ -63,19 +33,3 @@
         self._timeout_id = 0
         self.emit_change_detected()
 
-    def decorated_changes(self, old_func):
-        def _get_changes(self):
-            if self.first_sync == True:
-                return old_func()
-            else:
-                return self.as_added, self.as_modified, self.as_deleted
-        return MethodType(_get_changes, self)
-
-    def decorated_finish(self, old_func):
-        # Ugly, only needed until we use super() ;-)
-        def _finish(self):
-            #FIXME: Only do on a succesfull sync
-            self.first_sync = False
-            old_func()
-        return MethodType(_finish, self)
-        



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