Commit f3d6a802 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Fix handling of command line when file missing

parent c883ce9a
...@@ -142,6 +142,9 @@ The background pattern was downloaded from www.subtlepatterns.com ...@@ -142,6 +142,9 @@ The background pattern was downloaded from www.subtlepatterns.com
Changelog Changelog
========= =========
1.3.14
- Minor bugfix with command line handling
1.3.13 1.3.13
- Bugfix in rendering of Continuous signals - Bugfix in rendering of Continuous signals
......
...@@ -117,7 +117,7 @@ except ImportError: ...@@ -117,7 +117,7 @@ except ImportError:
__all__ = ['opengeode', 'SDL_Scene', 'SDL_View', 'parse'] __all__ = ['opengeode', 'SDL_Scene', 'SDL_View', 'parse']
__version__ = '1.3.13' __version__ = '1.3.14'
if hasattr(sys, 'frozen'): if hasattr(sys, 'frozen'):
# Detect if we are running on Windows (py2exe-generated) # Detect if we are running on Windows (py2exe-generated)
...@@ -2211,9 +2211,10 @@ def init_logging(options): ...@@ -2211,9 +2211,10 @@ def init_logging(options):
def parse(files): def parse(files):
''' Parse files ''' ''' Parse files '''
if not files:
raise IOError('No input .pr files')
LOG.info('Checking ' + str(files)) LOG.info('Checking ' + str(files))
# move to the directory of the .pr files (needed for ASN.1 parsing) # move to the directory of the .pr files (needed for ASN.1 parsing)
LOG.info(files[0])
path = os.path.dirname(files[0]) path = os.path.dirname(files[0])
files = [os.path.abspath(each) for each in files] files = [os.path.abspath(each) for each in files]
os.chdir(path or '.') os.chdir(path or '.')
...@@ -2328,8 +2329,9 @@ def cli(options): ...@@ -2328,8 +2329,9 @@ def cli(options):
''' Run CLI App ''' ''' Run CLI App '''
try: try:
ast, warnings, errors = parse(options.files) ast, warnings, errors = parse(options.files)
except IOError: except IOError as err:
LOG.error('Aborting due to parsing error (check input file)') LOG.error('Aborting due to parsing error')
LOG.error(str(err))
return 1 return 1
if len(ast.processes) != 1: if len(ast.processes) != 1:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment