- def add_page_info(self, pageid, pagename, rvids):
- lulz = file(os.path.join(self.location, 'cache', 'page'), 'r')
- conf = json.loads(lulz.read())
- conf[pageid] = {'name': pagename, 'rv': rvids}
- fd = file(os.path.join(self.location, 'cache', 'page'), 'w')
- fd.write(json.dumps(conf))
+ def pagedict_add(self, pagename, pageid):
+ fd = file(os.path.join(self.location, 'cache', 'pagedict'), 'r+')
+ pagedict = json.loads(fd.read())
+ pagedict[pagename] = int(pageid)
+ fd.seek(0)
+ fd.write(json.dumps(pagedict))
+ fd.truncate()