diff options
Diffstat (limited to '')
-rwxr-xr-x | later | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -41,20 +41,22 @@ def entries(): with os.scandir(watch_later_dir) as entries: for entry in sorted(entries, key=get_mtime): - if entry.is_file(): - mtime = dt.fromtimestamp(get_mtime(entry)) + if not entry.is_file(): + continue - with open(entry.path, "r") as handle: - first = handle.readline().rstrip() + mtime = dt.fromtimestamp(get_mtime(entry)) - name = entry.name - if first.startswith("# "): - name = first.strip("# ") + with open(entry.path, "r") as handle: + first = handle.readline().rstrip() - if name == "redirect entry": - continue + name = entry.name + if first.startswith("# "): + name = first.strip("# ") - yield entry.path, name, mtime + if name == "redirect entry": + continue + + yield entry.path, name, mtime parser = argparse.ArgumentParser( |