1
0
Fork 0
mirror of synced 2024-06-13 16:05:18 +12:00

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

View file

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

View file

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