From: Fredrik Tolf Date: Mon, 13 May 2013 17:59:28 +0000 (+0200) Subject: Added page refresh(/retry) feature. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=a133683da68efa3e4b9b01dc8474bdccac0a2b01;p=automanga.git Added page refresh(/retry) feature. --- diff --git a/manga/reader.py b/manga/reader.py index 1a8aa05..12089e7 100644 --- a/manga/reader.py +++ b/manga/reader.py @@ -115,6 +115,14 @@ class pagecache(object): self.bk = self.bk[-self.sz:] return f + def __delitem__(self, page): + idl = page.idlist() + for i, (ol, f) in enumerate(self.bk): + if ol == idl: + del self.bk[i] + return + raise KeyError(idl) + class relpageget(future): def __init__(self, cur, prev, cache=None): super(relpageget, self).__init__() @@ -608,6 +616,10 @@ class reader(gtk.Window): self.fetchpage(self.point.next, lambda page: self.preload.set(preload(relpageget(page, False, self.cache)))) elif ev.keyval in [65288]: self.fetchpage(self.point.prev, lambda page: self.preload.set(preload(relpageget(page, True, self.cache)))) + elif ev.keyval in [ord('R'), ord('r')]: + page = self.point.cur.cur + del self.cache[page] + self.imgfetch.set(imgfetch(self.cache[page])) def quit(self): self.hide()