Skip to content

Commit 3a13e4e

Browse files
authored
only look for urls if a filename is provided on init of UrlCheckerResult (#68)
Signed-off-by: vsoch <vsoch@users.noreply.github.com> Co-authored-by: vsoch <vsoch@users.noreply.github.com>
1 parent 1c04436 commit 3a13e4e

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and **Merged pull requests**. Critical items to know are:
1212
Referenced versions in headers are tagged on Github, in parentheses are for pypi.
1313

1414
## [vxx](https://github.com/urlstechie/urlschecker-python/tree/master) (master)
15+
- decrease verbosity when filename is None (0.0.28)
1516
- don't exit and fail if no URLs to check (0.0.27)
1617
- multiprocessing to speed up checks (0.0.26)
1718
- bug fix for verbose option to only print file names that have failures (0.0.25)

urlchecker/core/urlproc.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ def __init__(
111111
self.urls = []
112112
self.exclude_patterns = exclude_patterns or []
113113
self.exclude_urls = exclude_urls or []
114-
self.extract_urls()
114+
115+
# Only extract if we have a filename in advance
116+
if self.file_name:
117+
self.extract_urls()
115118

116119
def __str__(self):
117120
if self.file_name:

urlchecker/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
88
"""
99

10-
__version__ = "0.0.27"
10+
__version__ = "0.0.28"
1111
AUTHOR = "Ayoub Malek, Vanessa Sochat"
1212
AUTHOR_EMAIL = "superkogito@gmail.com, vsochat@stanford.edu"
1313
NAME = "urlchecker"

0 commit comments

Comments
 (0)