Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndi_G <andigros72@googlemail.com>2011-09-05 15:36:25 (GMT)
committer Andi_G <andigros72@googlemail.com>2011-09-05 15:36:25 (GMT)
commit24e894da03476cd342d577af03509141fd981597 (patch)
tree933f114a1eb37eae2fbf9a776f3b6b555894c166
parent4bd0ec8306c37a4b832b53c722bf24b993125545 (diff)
only upload your own annotations
-rw-r--r--readdb.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/readdb.py b/readdb.py
index 19a6d13..c19ef6d 100644
--- a/readdb.py
+++ b/readdb.py
@@ -721,9 +721,11 @@ class AnnotationManager:
if self._userid == '':
self._userid = self.get_userid_for_username( self.get_user_string( user ) )
self._creator = self._userid
+ if len(self._annotates) > 0:
+ values = {'w3c_hasTarget' : self._annotates }
+ else:
+ values = {'checksum' : self._filehash }
- #values = {'w3c_hasTarget' : self._annotates, 'creator' : self._creator }
- values = {'w3c_hasTarget' : self._filehash, 'creator' : self._creator }
_logger.debug('sync annotations -- annotates is: %s ' % self._annotates)
try:
data = urllib.urlencode(values)
@@ -758,8 +760,9 @@ class AnnotationManager:
_logger.debug(str('after update: timestamps are remote: %d, local %d' % (rmodifiedtstamp, self._annotations[ind].get_modified())))
self.update_annotation_db_record(a)
else:
- _logger.debug(str('remote annotation is outdated, sending %s' % self._annotations[ind]))
- self.send_annotation_to_server(self._annotations[ind])
+ if self._annotations[ind].get_creator() == self._userid:
+ _logger.debug(str('remote annotation is outdated, sending %s' % self._annotations[ind]))
+ self.send_annotation_to_server(self._annotations[ind])
if (len(self._annotations) > 0):
#send annotations if necessary