Skip to content

Commit

Permalink
Merge pull request #4 from avalentino/cli
Browse files Browse the repository at this point in the history
Small improvement so CLI and logging
  • Loading branch information
scottstanie committed Feb 3, 2021
2 parents c46f1bf + fa9c183 commit eeb86b0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions eof/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env python3

import sys
from eof.cli import cli

sys.exit(cli())
4 changes: 3 additions & 1 deletion eof/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""
import click
from eof import download
from eof import log


@click.command()
Expand All @@ -23,7 +24,7 @@
)
@click.option(
"--sentinel-file",
type=click.Path(exists=True, file_okay=True, dir_okay=True),
type=click.Path(exists=False, file_okay=True, dir_okay=True),
help="Specify path to download only 1 .EOF for a Sentinel-1 file/folder",
show_default=True,
)
Expand All @@ -43,6 +44,7 @@ def cli(search_path, save_dir, sentinel_file, date, mission):
Will find both ".SAFE" and ".zip" files matching Sentinel-1 naming convention.
With no arguments, searches current directory for Sentinel 1 products
"""
log._set_logger_handler()
download.main(
search_path=search_path,
save_dir=save_dir,
Expand Down
3 changes: 2 additions & 1 deletion eof/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ def _set_logger_handler(level="INFO"):


logger = logging.Logger("sentineleof")
_set_logger_handler()
logger.addHandler(logging.NullHandler())
# _set_logger_handler()

0 comments on commit eeb86b0

Please sign in to comment.