mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-14 15:14:31 -04:00
mypy fixes
This commit is contained in:
parent
d96d986885
commit
beb83f292d
7 changed files with 111 additions and 27 deletions
|
@ -8,7 +8,7 @@ from pathlib import Path
|
|||
from django.db import models, transaction
|
||||
from django.utils.functional import cached_property
|
||||
|
||||
from solo.models import SingletonModel
|
||||
from solo.models import SingletonModel # type: ignore[import-untyped]
|
||||
|
||||
|
||||
from config import bin_path, bin_version
|
||||
|
@ -22,6 +22,14 @@ ConfigDict = Dict[str, Any]
|
|||
# def bin_version(bin_path: str, cmd: str | None=None) -> str | None:
|
||||
# return '0.0.0'
|
||||
|
||||
# def pretty_path(path: Path) -> str:
|
||||
# """take a Path object and return the path as a string relative to the current directory"""
|
||||
|
||||
# if not path:
|
||||
# return ''
|
||||
|
||||
# return str(path.expanduser().resolve().relative_to(Path.cwd().resolve()))
|
||||
|
||||
|
||||
class ArchiveBoxBaseDependency(models.Model):
|
||||
singleton_instance_id = 1
|
||||
|
@ -96,7 +104,7 @@ class ArchiveBoxBaseDependency(models.Model):
|
|||
|
||||
@cached_property
|
||||
def pretty_version(self):
|
||||
if self.enabled:
|
||||
if self.is_enabled:
|
||||
if self.is_valid:
|
||||
color, symbol, note, version = 'green', '√', 'valid', ''
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue