Skip to content

Commit

Permalink
Merge pull request #32 from spectre-team/fixup/cli-arguments
Browse files Browse the repository at this point in the history
Fixup: CLI arguments
  • Loading branch information
gmrukwa committed Sep 21, 2019
2 parents 0998e9d + 67fbb66 commit 8e5cec5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:
- DOCKER_REPO=gmrukwa/divik
- MAJOR=1
- MINOR=13
- FIXUP=8
- FIXUP=9
- secure: D58HyiO9DVKYGIjVcp0mNbLCvZ0BrQ8VtJ+74WXAIDTY4N5L4yGnAP4BGOhtcjFxD9calruRuBmSBMe2TCJAjkmG9KWPkyXNeN7B9T8spTuTyBybW2Xd9MEUTruXkr49W3zic7L1kecq8FGlO7k9Cc4VRl0KPjps3AAKdRmWi87g3flrDhTeODpOYNFBlfhoH8lcXs1dwUs7aNtbL5SIBnc+rpOYWnZ8TUpynkKjtQnmkixXBySdmHZQOAugpmeWX43slyt5Z3VCfTEqxDsk9uD2xmVF2rmMXSKXTorGPqx7AXrsvCHUUb0W+C3z1LfcPeUW0DrBWkksph0twYnxnxcE7hxpxQm1SQPz6pIzBZ3TUiYpvP+qTdKrIDvR8hnE8wEvsVCBxNYVCf0/BjUoUu7OTSTMdWvPGtcC81WBpizFPeVEYRf8MRY0Ug45N3EdJ7TJ6Xtlm/UaefazKsdDrDc0nD7rXj9zSsOeZezC8Hk51E2n+/lDbdllXiNUbBQs4T+1JyoM3qJP4o4+A20uP4frkqmIBetCC+RGBS1d/oEUdm+gXZ1pZvgt9uujRSgAFjbdAAhCDwUOpUI9CGGJB34gZFWF81ztU4SSH2/8zHTrxzz19u0chTNj+rG5T0+02c4pJEi9b5cYJZ7aYh51iRWGI4hjDEPdl1unEP6rwSc=
- secure: m2vvWHoICkFSR34Yt/l+mDZn0X803vcCy0Xu9NDUnFE6CipNR0PIq2EJhud7kmhN0/QjwXQ7yldLQRGhMLLF6uoRo6TSGnhREpRIZvyT7Pa9aG9irdzX6sWJha4PbZJtXJvG2AqPH6ZExhH8KAqawd24g4o9aiq1Z2c9fC4vRAKeXNm86YPR+8NMoBARgU/bU9Tn9VdegO/KrZfmsD3h5DbnZrRfD7oKroGsrq4g/f7trkWeI88G2qKol+HtfQfxjCTDN490nNmAywYlYzDcodv0fkcCNovWlAZLpHn4450EmJ4PuNKi9phgKYKDqWWZxQx23MaasKG/UFCx/GI2ZLjEE4NNtNpV4QSREB2knwC0s/UCA+XH6zx0dMfWuDAH00au94NfntCiWi+Hei/jAKPgtiSOsttePuCoe8BJbisTai3kA9olU/MX32DTX9UEzobVsvK86ECERVMwkzjWbPvIg9QMTyZk6S7KHuAbUvOlv5PVADAwZsh8NG56lbn6hopkJRMcAhC4JerkSJ2RooZFG11giz7Vbxdm6AsoKI3bnNUr7n46lJuacl5X2+tSk4hd7F9GHEUpDX0Cb3bp0ULlL8X4sBeI0D+YfLkvIh+DhzcXG98XpFpQo/o9nz3SbkD7rCPcT+96gANi8ryCCu0GfXa+yipDwCNfNxWAPI0=
install:
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
image: Ubuntu
version: 1.13.8.{build}
version: 1.13.9.{build}
skip_tags: true
skip_branch_with_pr: true
environment:
Expand Down
2 changes: 1 addition & 1 deletion spdivik/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.13.8"
__version__ = "1.13.9"
13 changes: 9 additions & 4 deletions spdivik/_scripting.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@ def parse_args():
'contain X in first column, Y in second. The '
'number of rows should be equal to the data.',
action='store', dest='xy', required=False, default=None)
parser.add_argument('--omit-datetime', action='store_true',
help='If defines, omit the datetime subdirectory of '
'result.')
parser.add_argument('--verbose', '-v', action='store_true')
return parser.parse_args()


def prepare_destination(destination: str) -> str:
datetime = time.strftime("%Y%m%d-%H%M%S")
destination = os.path.join(destination, datetime)
def prepare_destination(destination: str, omit_datetime: bool = False) -> str:
if not omit_datetime:
datetime = time.strftime("%Y%m%d-%H%M%S")
destination = os.path.join(destination, datetime)
os.makedirs(destination)
return destination

Expand Down Expand Up @@ -107,7 +111,8 @@ def try_load_xy(path):

def initialize() -> Tuple[ty.Data, Config, DestinationPath, Coordinates]:
arguments = parse_args()
destination = prepare_destination(arguments.destination)
destination = prepare_destination(arguments.destination,
arguments.omit_datetime)
setup_logger(destination, arguments.verbose)
config = load_config(arguments.config, destination)
data = try_load_data(arguments.source)
Expand Down

0 comments on commit 8e5cec5

Please sign in to comment.