Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/carquinyol/layoutmanager.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/carquinyol/layoutmanager.py')
-rw-r--r--src/carquinyol/layoutmanager.py28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/carquinyol/layoutmanager.py b/src/carquinyol/layoutmanager.py
index 8402b6d..ef4db16 100644
--- a/src/carquinyol/layoutmanager.py
+++ b/src/carquinyol/layoutmanager.py
@@ -17,6 +17,9 @@
import os
import logging
+from sugar.logger import trace
+
+
MAX_QUERY_LIMIT = 40960
CURRENT_LAYOUT_VERSION = 4
@@ -89,18 +92,27 @@ class LayoutManager(object):
def get_queue_path(self):
return os.path.join(self.get_checksums_dir(), 'queue')
+ def recheck_index_updated(self):
+ """Check whether the index_updated file exists."""
+ index_updated_path = os.path.join(self._root_path, 'index_updated')
+ self._index_updated = os.path.exists(index_updated_path)
+
+ @trace()
def _is_index_updated(self):
return self._index_updated
+ @trace()
def _set_index_updated(self, index_updated):
- if index_updated != self._index_updated:
- self._index_updated = index_updated
-
- index_updated_path = os.path.join(self._root_path, 'index_updated')
- if os.path.exists(index_updated_path):
- os.remove(index_updated_path)
- else:
- open(index_updated_path, 'w').close()
+ self._index_updated = index_updated
+
+ index_updated_path = os.path.join(self._root_path, 'index_updated')
+ if not (os.path.exists(index_updated_path) ^ index_updated):
+ return
+
+ if index_updated:
+ open(index_updated_path, 'w').close()
+ else:
+ os.remove(index_updated_path)
index_updated = property(_is_index_updated, _set_index_updated)