Skip to content

Commit

Permalink
patch some cli issues, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasBeuzen committed Jul 7, 2020
1 parent ec5543a commit b95e6fc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pywebcat"
version = "0.1.3"
version = "0.1.4"
description = "Python tool for working with the NOAA NOS Web Camera Applications Testbed (WebCAT)"
authors = ["Tomas Beuzen <[email protected]>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion pywebcat/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.3"
__version__ = "0.1.4"
7 changes: 5 additions & 2 deletions pywebcat/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,19 @@ def main():
wc = WebCAT()
for item in itertools.product(station, year, month, day, time):
try:
sys.stdout = open(os.devnull, "w") # capture any output from url generation
wc.generate_url(*item) # generate url from the input data
sys.stdout = sys.__stdout__ # reinstate output
tmp_dir = os.path.join(directory, item[0], wc.name) # dir to save frames in
if not os.path.exists(tmp_dir):
os.makedirs(tmp_dir) # mkdir if not exist
if verbose:
print(f"Saving frames of {wc.name}...")
wc.save_frames(interval, tmp_dir, not no_meta, verbose) # save frames
except:
url = f"http://webcat-video.axds.co/{item[0]}/raw/{item[1]}/{item[1]}_{item[2]}/{item[1]}_{item[2]}_{item[3]}/{item[0]}.{item[1]}-{item[2]}-{item}_{item[4]}.mp4"
print(f"Warning: {url} not a valid url... Skipping.")
if verbose:
url = f"http://webcat-video.axds.co/{item[0]}/raw/{item[1]}/{item[1]}_{item[2]:02}/{item[1]}_{item[2]:02}_{item[3]:02}/{item[0]}.{item[1]}-{item[2]:02}-{item[3]:02}_{item[4]:04}.mp4"
print(f"Warning: {url} not a valid url... Skipping.")


def parse_args():
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pywebcat.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


def test_version():
assert __version__ == "0.1.3"
assert __version__ == "0.1.4"


def test_generate_url():
Expand Down

0 comments on commit b95e6fc

Please sign in to comment.