- conf[rvid]['minor'] = 'minor' in rv
- if 'comment' in rv:
- conf[rvid]['comment'] = rv['comment']
- else:
- conf[rvid]['comment'] = None
- fd = file(os.path.join(self.location, 'cache', 'rv'), 'w')
- fd.write(json.dumps(conf))
+ fd.seek(0)
+ fd.write(json.dumps(pagedata))
+ fd.truncate()
+ fd.close()
+
+ def pages_get_rv_list(self, pageid):
+ pagefile = os.path.join(self.location, 'cache', 'pages', str(pageid))
+ fd = file(pagefile, 'r')
+ pagedata = json.loads(fd.read())
+ rvs = [int(x) for x in pagedata.keys()]
+ rvs.sort()
+ return rvs
+
+ def pages_get_rv(self, pageid, rvid):
+ pagefile = os.path.join(self.location, 'cache', 'pages', str(pageid))
+ fd = file(pagefile, 'r')
+ pagedata = json.loads(fd.read())
+ return pagedata[str(rvid)]