瀏覽代碼

Suppress error if a monthly log file does not exist

master
JustAnotherArchivist 3 年之前
父節點
當前提交
ef8998c369
共有 1 個檔案被更改,包括 6 行新增3 行删除
  1. +6
    -3
      irclog.py

+ 6
- 3
irclog.py 查看文件

@@ -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.


Loading…
取消
儲存