comparison documentViewer.py @ 571:f1906951be2a

nicer batching of tocs
author casties
date Fri, 12 Oct 2012 17:02:40 +0200
parents 694935574177
children 9251719154a3
comparison
equal deleted inserted replaced
570:61d53ccbdd70 571:f1906951be2a
977 batch['nextStart'] = start + grpsize 977 batch['nextStart'] = start + grpsize
978 else: 978 else:
979 batch['nextStart'] = None 979 batch['nextStart'] = None
980 980
981 batch['pages'] = pages 981 batch['pages'] = pages
982 batch['first'] = minIdx
983 batch['last'] = maxIdx
982 return batch 984 return batch
983 985
984 def getBatch(self, start=1, size=10, end=0, data=None, fullData=True): 986 def getBatch(self, start=1, size=10, end=0, data=None, fullData=True):
985 """returns dict with information for one screenfull of data.""" 987 """returns dict with information for one screenfull of data."""
986 batch = {} 988 batch = {}
1021 if start + size < end: 1023 if start + size < end:
1022 batch['nextStart'] = start + size 1024 batch['nextStart'] = start + size
1023 else: 1025 else:
1024 batch['nextStart'] = None 1026 batch['nextStart'] = None
1025 1027
1026 logging.debug("getBatch start=%s size=%s end=%s batch=%s"%(start,size,end,repr(batch))) 1028 batch['first'] = start
1029 batch['last'] = end
1027 return batch 1030 return batch
1028 1031
1029 1032
1030 def getAnnotatorGroupsForUser(self, user, annotationServerUrl="http://tuxserve03.mpiwg-berlin.mpg.de/AnnotationManager"): 1033 def getAnnotatorGroupsForUser(self, user, annotationServerUrl="http://tuxserve03.mpiwg-berlin.mpg.de/AnnotationManager"):
1031 """returns list of groups {name:*, id:*} on the annotation server for the user""" 1034 """returns list of groups {name:*, id:*} on the annotation server for the user"""