]> khamidou — GitHub mirrors - cagibi.git/commitdiff
an utility object
authorkarim hamidou <khamidou@gmail.com>
Mon, 30 Jul 2012 09:57:16 +0000 (11:57 +0200)
committerkarim hamidou <khamidou@gmail.com>
Mon, 30 Jul 2012 09:57:16 +0000 (11:57 +0200)
cagibi/filequeue.py [new file with mode: 0644]

diff --git a/cagibi/filequeue.py b/cagibi/filequeue.py
new file mode 100644 (file)
index 0000000..b9960de
--- /dev/null
@@ -0,0 +1,15 @@
+from Queue import Queue
+
+class FileQueue(object):
+    """A convenience class representing which files have been modified at a given time"""
+    def __init__(self):
+        super(FileQueue, self).__init__()
+        self.added = Queue()
+        self.removed = Queue()
+        self.modified = Queue()
+
+        # The list of modified files is used when a file has been
+        # modified by the client itself, so that it doesn't try to
+        # upload it again to the server in a never-ending loop.
+        # No need for a mutex as it's thread-local
+        self.client_modified = []