Skip to content

Commit 8a317d6

Browse files
committed
remvoing verbose parameter, always printing missing urls, and no longer printing for cache misses
1 parent 6235664 commit 8a317d6

File tree

4 files changed

+4
-14
lines changed

4 files changed

+4
-14
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ many of those were matched in a feed.
4040
(one url per line)
4141
* `--url http://example.com` Check a single url instead of a Cal-ITP agencies
4242
yaml file
43-
* `--verbose` Print a table of all results (organized by domain)
4443
* `--output /path/to/file.json` Save the results as a json file
45-
* `--clear-cache` Deletes the cache folder before running.
4644

4745
[1]: https://www.transit.land/documentation/index#signing-up-for-an-api-key
4846
[2]: https://github.com/cal-itp/data-infra/blob/main/airflow/data/agencies.yml

gtfs_aggregator_checker/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ def clean_url(url):
2626
return urllib.parse.urlunparse(url)
2727

2828

29-
def check_feeds(
30-
yml_file=None, csv_file=None, url=None, output=None, verbose=False,
31-
):
29+
def check_feeds(yml_file=None, csv_file=None, url=None, output=None):
3230
results = {}
3331

3432
if url:
@@ -92,7 +90,7 @@ def check_feeds(
9290
if "present" not in statuses:
9391
missing.append(url)
9492

95-
if missing and verbose:
93+
if missing:
9694
print(f"Unable to find {len(missing)}/{len(results)} urls:")
9795
for url in missing:
9896
print(url)

gtfs_aggregator_checker/__main__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@ def main(
88
csv_file=typer.Option(None, help="A csv file (one url per line)"),
99
url=typer.Option(None, help="URL to check instead of a file",),
1010
output=typer.Option(None, help="Path to a file to save output to."),
11-
verbose: bool = typer.Option(False, help="Print a result table to stdout"),
1211
):
13-
check_feeds(
14-
yml_file=yml_file, csv_file=csv_file, url=url, output=output, verbose=verbose,
15-
)
12+
check_feeds(yml_file=yml_file, csv_file=csv_file, url=url, output=output)
1613

1714

1815
typer.run(main)

gtfs_aggregator_checker/cache.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import os
22
from pathlib import Path
3-
import sys
43
import urllib.error
54
import urllib.request
65

@@ -24,13 +23,11 @@ def get_cached(key, func, directory=None):
2423
content = func()
2524
with open(path, "w") as f:
2625
f.write(content)
27-
if "--verbose" in sys.argv:
28-
print("wrote cached file", path)
2926
with open(path, "r") as f:
3027
return f.read()
3128

3229

33-
def curl_cached(url, key=None, verbose=False):
30+
def curl_cached(url, key=None):
3431
domain, path = url_split(url)
3532
if key is None:
3633
key = path.replace("/", "__")

0 commit comments

Comments
 (0)