fix missing imports

This commit is contained in:
Nick Sweeting 2020-06-30 05:55:34 -04:00
parent e6830284c5
commit df593dea0a
3 changed files with 10 additions and 3 deletions

View file

@ -24,6 +24,7 @@ from ..config import (
TERM_WIDTH, TERM_WIDTH,
OUTPUT_DIR, OUTPUT_DIR,
HTML_INDEX_FILENAME, HTML_INDEX_FILENAME,
stderr,
) )
@ -160,6 +161,7 @@ def log_parsing_started(source_file: str):
**ANSI, **ANSI,
)) ))
def log_parsing_finished(num_parsed: int, num_new_links: int, parser_name: str): def log_parsing_finished(num_parsed: int, num_new_links: int, parser_name: str):
end_ts = datetime.now() end_ts = datetime.now()
_LAST_RUN_STATS.parse_end_ts = end_ts _LAST_RUN_STATS.parse_end_ts = end_ts
@ -178,14 +180,17 @@ def log_indexing_process_started(num_links: int):
**ANSI, **ANSI,
)) ))
def log_indexing_process_finished(): def log_indexing_process_finished():
end_ts = datetime.now() end_ts = datetime.now()
_LAST_RUN_STATS.index_end_ts = end_ts _LAST_RUN_STATS.index_end_ts = end_ts
def log_indexing_started(out_path: str): def log_indexing_started(out_path: str):
if IS_TTY: if IS_TTY:
sys.stdout.write(f' > {out_path}') sys.stdout.write(f' > {out_path}')
def log_indexing_finished(out_path: str): def log_indexing_finished(out_path: str):
print(f'\r{out_path}') print(f'\r{out_path}')

View file

@ -25,10 +25,12 @@ class Snapshot(models.Model):
def __repr__(self) -> str: def __repr__(self) -> str:
return f'[{self.timestamp}] {self.url[:64]} ({self.title[:64]})' title = self.title or '-'
return f'[{self.timestamp}] {self.url[:64]} ({title[:64]})'
def __str__(self) -> str: def __str__(self) -> str:
return f'[{self.timestamp}] {self.url[:64]} ({self.title[:64]})' title = self.title or '-'
return f'[{self.timestamp}] {self.url[:64]} ({title[:64]})'
@classmethod @classmethod
def from_json(cls, info: dict): def from_json(cls, info: dict):

View file

@ -7,7 +7,7 @@ from typing import Optional
from datetime import datetime from datetime import datetime
from ..index.schema import Link, ArchiveResult, ArchiveOutput, ArchiveError from ..index.schema import Link, ArchiveResult, ArchiveOutput, ArchiveError
from ..system import run from ..system import run, chmod_file
from ..util import ( from ..util import (
enforce_types, enforce_types,
is_static_file, is_static_file,