From 34a0db9cd8a6b8124582587af23f77e6586ea00f Mon Sep 17 00:00:00 2001 From: Master Date: Wed, 9 Jan 2019 19:43:00 +0200 Subject: [PATCH 1/2] implemented #115: make parameter for site name not case sensitive --- sherlock.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sherlock.py b/sherlock.py index 304b5ca0..afc0a7c1 100644 --- a/sherlock.py +++ b/sherlock.py @@ -369,12 +369,14 @@ def main(): # Make sure that the sites are supported & build up pruned site database. site_data = {} site_missing = [] + site = str() for site in args.site_list: - if site in site_data_all: - site_data[site] = site_data_all[site] - else: - # Build up list of sites not supported for future error message. - site_missing.append(f"'{site}'") + for existing_site in site_data_all: + if site.lower() == existing_site.lower(): + site_data[existing_site] = site_data_all[existing_site] + if not site_data: + # Build up list of sites not supported for future error message. + site_missing.append(f"'{site}'") if site_missing != []: print(f"Error: Desired sites not found: {', '.join(site_missing)}.") From b245a6e5cc9b8ed82c1b18790333748fafa5ddae Mon Sep 17 00:00:00 2001 From: Master Date: Wed, 9 Jan 2019 19:46:02 +0200 Subject: [PATCH 2/2] fixed wrong condition place --- sherlock.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sherlock.py b/sherlock.py index afc0a7c1..e913f07a 100644 --- a/sherlock.py +++ b/sherlock.py @@ -369,16 +369,15 @@ def main(): # Make sure that the sites are supported & build up pruned site database. site_data = {} site_missing = [] - site = str() for site in args.site_list: for existing_site in site_data_all: if site.lower() == existing_site.lower(): site_data[existing_site] = site_data_all[existing_site] - if not site_data: - # Build up list of sites not supported for future error message. - site_missing.append(f"'{site}'") + if not site_data: + # Build up list of sites not supported for future error message. + site_missing.append(f"'{site}'") - if site_missing != []: + if site_missing: print(f"Error: Desired sites not found: {', '.join(site_missing)}.") sys.exit(1)