diff options
Diffstat (limited to '')
-rwxr-xr-x | later | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -77,9 +77,10 @@ class TitleMap: except Exception as err: sys.exit(f"later: cannot read title cache: {err}") - def get(self, key): + def mark_seen(self, key): self.seen.add(key) + def get(self, key): if key in self.map: return self.map[key] @@ -133,7 +134,7 @@ class TitleMap: sys.exit(f"later: cannot write title cache: {err}") -def entries(): +def entries(title_map): def get_mtime(entry): return entry.stat().st_mtime @@ -154,6 +155,7 @@ def entries(): if name == "redirect entry": continue + title_map.mark_seen(name) yield WatchLaterEntry(name=name, path=entry.path, mtime=mtime) @@ -170,7 +172,7 @@ args = parser.parse_args() title_map = TitleMap(title_map_file, update=args.update_titles) -for entry in entries(): +for entry in entries(title_map): print(entry.format(title_map)) title_map.maybe_commit() |