-
Notifications
You must be signed in to change notification settings - Fork 83
Remove distutils dependency #236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,13 +14,22 @@ | |
from typing import List | ||
|
||
# pylint: disable=no-name-in-module | ||
from distutils import util | ||
#from distutils import util | ||
from typing import List, Tuple, Union | ||
|
||
DATEFMT = "%Y-%m-%d %H:%M:%S" | ||
PRECISION = 2 | ||
|
||
|
||
def strtobool(value: str) -> bool: | ||
"""Convert string to boolean.""" | ||
if s.lower() in ['yes', 'true', 't', 'y', '1']: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. undefined name 's' |
||
return True | ||
elif s.lower() in ['no', 'false', 'f', 'n', '0']: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. undefined name 's' |
||
return False | ||
else: | ||
raise ValueError("Cannot convert {} to a bool".format(s)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. undefined name 's' |
||
|
||
def clean_url(url: str) -> str: | ||
host = re.sub(r"^http[s]?://", "", url, flags=re.IGNORECASE) | ||
host = re.sub(r"/$", "", host) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Black would make changes.
block comment should start with '# '