Skip to content

Commit

Permalink
Added default filename prefix checking. #15
Browse files Browse the repository at this point in the history
  • Loading branch information
sweverett committed Apr 3, 2017
1 parent ab9f3d2 commit e4d850e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions clustr.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,21 @@ def set_parameters(file):

return

def check_prefix(options):
'''
If no prefix is given, use default set in `param.config`. If default is None,
then no prefix is given.
'''
print('prefix = {}'.format(options.prefix))
if options.prefix is None:
if PARAMETERS['default_prefix'] is None:
options.prefix = ''
else:
options.prefix = PARAMETERS['default_prefix']
print('prefix = {}'.format(options.prefix))

return

def parse_opts():
''' Parse command line arguments '''
parser = argparse.ArgumentParser()
Expand Down Expand Up @@ -394,6 +409,9 @@ def main(): #pylint: disable=missing-docstring
config_file = 'param.config'
set_parameters(config_file)

# Set default prefix if none entered
check_prefix(options)

# Set methods list
method = options.method
set_methods_list(method)
Expand Down

0 comments on commit e4d850e

Please sign in to comment.