From 3d5031cd6164b6f069247999b87690b9057b7497 Mon Sep 17 00:00:00 2001 From: Jarry Shaw Date: Mon, 4 Jan 2021 20:29:03 +0800 Subject: [PATCH] minor bugfix --- Dockerfile | 2 +- darc/__init__.py | 2 +- darc/model/web/hostname.py | 8 ++++---- darc/sites/__init__.py | 2 +- debug.dockerfile | 2 +- docker/Dockerfile | 2 +- docker/debug.dockerfile | 2 +- docs/source/conf.py | 2 +- setup.py | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1132df87..119bf585 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ LABEL org.opencontainers.image.title="darc" \ org.opencontainers.image.description="Darkweb Crawler Project" \ org.opencontainers.image.url="https://darc.jarryshaw.me/" \ org.opencontainers.image.source="https://github.com/JarryShaw/darc" \ - org.opencontainers.image.version="0.9.1" \ + org.opencontainers.image.version="0.9.2" \ org.opencontainers.image.licenses='BSD 3-Clause "New" or "Revised" License' STOPSIGNAL SIGINT diff --git a/darc/__init__.py b/darc/__init__.py index bc0e282f..89e31692 100644 --- a/darc/__init__.py +++ b/darc/__init__.py @@ -40,4 +40,4 @@ from darc.sites import register as register_sites # pylint: disable=unused-import __all__ = ['darc'] -__version__ = '0.9.1' +__version__ = '0.9.2' diff --git a/darc/model/web/hostname.py b/darc/model/web/hostname.py index 447ded01..bb96dd3a 100644 --- a/darc/model/web/hostname.py +++ b/darc/model/web/hostname.py @@ -12,7 +12,7 @@ """ -from typing import TYPE_CHECKING, cast +from typing import TYPE_CHECKING from peewee import DateTimeField, TextField @@ -21,7 +21,7 @@ from darc.model.utils import IntEnumField, Proxy if TYPE_CHECKING: - from typing import List + from typing import Callable, List from darc._compat import datetime from darc.model.web.hosts import HostsModel @@ -86,9 +86,9 @@ def since(self) -> 'datetime': """ if self.alive: - filtering = lambda url: cast('HostnameModel', url).alive + filtering = lambda url: url.alive # type: Callable[[URLModel], bool] else: - filtering = lambda url: not cast('HostnameModel', url).alive + filtering = lambda url: not url.alive return min(*filter( filtering, self.urls diff --git a/darc/sites/__init__.py b/darc/sites/__init__.py index ccb4b976..92ca5b8d 100644 --- a/darc/sites/__init__.py +++ b/darc/sites/__init__.py @@ -90,7 +90,7 @@ def _get_site(link: 'Link') -> 'Type[BaseSite]': * :data:`darc.sites.SITEMAP` """ - host = link.host.casefold() + host = (link.host or '').casefold() site = SITEMAP.get(host) if site is None: site = DefaultSite diff --git a/debug.dockerfile b/debug.dockerfile index 925bd90d..856447dd 100644 --- a/debug.dockerfile +++ b/debug.dockerfile @@ -15,7 +15,7 @@ LABEL org.opencontainers.image.title="darc" \ org.opencontainers.image.description="Darkweb Crawler Project" \ org.opencontainers.image.url="https://darc.jarryshaw.me/" \ org.opencontainers.image.source="https://github.com/JarryShaw/darc" \ - org.opencontainers.image.version="0.9.1" \ + org.opencontainers.image.version="0.9.2" \ org.opencontainers.image.licenses='BSD 3-Clause "New" or "Revised" License' #EXPOSE 9050 diff --git a/docker/Dockerfile b/docker/Dockerfile index d5e3a2a7..dafa7271 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -4,7 +4,7 @@ LABEL org.opencontainers.image.title="darc" \ org.opencontainers.image.description="Darkweb Crawler Project" \ org.opencontainers.image.url="https://darc.jarryshaw.me/" \ org.opencontainers.image.source="https://github.com/JarryShaw/darc" \ - org.opencontainers.image.version="0.9.1" \ + org.opencontainers.image.version="0.9.2" \ org.opencontainers.image.licenses='BSD 3-Clause "New" or "Revised" License' STOPSIGNAL SIGINT diff --git a/docker/debug.dockerfile b/docker/debug.dockerfile index 3877d9a3..ace37787 100644 --- a/docker/debug.dockerfile +++ b/docker/debug.dockerfile @@ -15,7 +15,7 @@ LABEL org.opencontainers.image.title="darc" \ org.opencontainers.image.description="Darkweb Crawler Project" \ org.opencontainers.image.url="https://darc.jarryshaw.me/" \ org.opencontainers.image.source="https://github.com/JarryShaw/darc" \ - org.opencontainers.image.version="0.9.1" \ + org.opencontainers.image.version="0.9.2" \ org.opencontainers.image.licenses='BSD 3-Clause "New" or "Revised" License' #EXPOSE 9050 diff --git a/docs/source/conf.py b/docs/source/conf.py index dadfa184..a4287ce8 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -22,7 +22,7 @@ author = 'Jarry Shaw' # The full version, including alpha/beta/rc tags -release = '0.9.1' +release = '0.9.2' # -- General configuration --------------------------------------------------- diff --git a/setup.py b/setup.py index 607b7f14..c898a808 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ version_info = sys.version_info[:2] # version string -__version__ = '0.9.1' +__version__ = '0.9.2' # setup attributes attrs = dict(