Procházet zdrojové kódy

Suppress error if a monthly log file does not exist

master
JustAnotherArchivist před 3 roky
rodič
revize
ef8998c369
1 změnil soubory, kde provedl 6 přidání a 3 odebrání
  1. +6
    -3
      irclog.py

+ 6
- 3
irclog.py Zobrazit soubor

@@ -889,9 +889,12 @@ class WebServer:

def _file_iter_with_path(self, fn, path):
# Open fn, iterate over its lines yielding (path, line) tuples
with open(fn, 'r') as fp:
for line in fp:
yield (path, line)
try:
with open(fn, 'r') as fp:
for line in fp:
yield (path, line)
except FileNotFoundError:
pass

def _stdout_with_path(self, stdout):
# Process grep output with --with-filenames, --null, and --line-number into (path, line) tuples.


Načítá se…
Zrušit
Uložit