Merge branch 'everyskills-patch-4'

pull/1293/head
Yahya SayadArbabi 3 years ago
commit 65ce128b7f

@ -4,8 +4,6 @@ This module supports storing information about websites.
This is the raw data that will be used to search for usernames. This is the raw data that will be used to search for usernames.
""" """
import json import json
import requests
class SiteInformation: class SiteInformation:
def __init__(self, name, url_home, url_username_format, username_claimed, def __init__(self, name, url_home, url_username_format, username_claimed,
@ -104,7 +102,7 @@ class SitesInformation:
Nothing. Nothing.
""" """
if data_file_path is None: if not data_file_path:
# The default data file is the live data.json which is in the GitHub repo. The reason why we are using # The default data file is the live data.json which is in the GitHub repo. The reason why we are using
# this instead of the local one is so that the user has the most up-to-date data. This prevents # this instead of the local one is so that the user has the most up-to-date data. This prevents
# users from creating issue about false positives which has already been fixed or having outdated data # users from creating issue about false positives which has already been fixed or having outdated data
@ -114,6 +112,7 @@ class SitesInformation:
if not data_file_path.lower().endswith(".json"): if not data_file_path.lower().endswith(".json"):
raise FileNotFoundError(f"Incorrect JSON file extension for data file '{data_file_path}'.") raise FileNotFoundError(f"Incorrect JSON file extension for data file '{data_file_path}'.")
# if "http://" == data_file_path[:7].lower() or "https://" == data_file_path[:8].lower():
if data_file_path.lower().startswith("http"): if data_file_path.lower().startswith("http"):
# Reference is to a URL. # Reference is to a URL.
try: try:

Loading…
Cancel
Save