From eed63054d7ac40eb818004d3f0b366d7049d5a80 Mon Sep 17 00:00:00 2001 From: Adrien Barbaresi Date: Tue, 3 Sep 2024 17:35:05 +0200 Subject: [PATCH] maintenance: add __all__ to init.py and lint code --- courlan/__init__.py | 22 ++++++++++++++++++++++ courlan/urlutils.py | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/courlan/__init__.py b/courlan/__init__.py index efdfc86..c454554 100644 --- a/courlan/__init__.py +++ b/courlan/__init__.py @@ -31,3 +31,25 @@ get_hostinfo, is_external, ) + +__all__ = [ + "clean_url", + "normalize_url", + "scrub_url", + "check_url", + "extract_links", + "is_navigation_page", + "is_not_crawlable", + "is_valid_url", + "lang_filter", + "validate_url", + "sample_urls", + "UrlStore", + "extract_domain", + "filter_urls", + "fix_relative_urls", + "get_base_url", + "get_host_and_path", + "get_hostinfo", + "is_external", +] diff --git a/courlan/urlutils.py b/courlan/urlutils.py index b8a702a..e94bc1a 100644 --- a/courlan/urlutils.py +++ b/courlan/urlutils.py @@ -57,7 +57,7 @@ def extract_domain( return ( full_domain - if full_domain and not domain in blacklist and not full_domain in blacklist + if full_domain and domain not in blacklist and full_domain not in blacklist else None )