python-adfs

changeset 37:134a5063bb55

Made changes to accommodate the new version of cmdsyntax.py (0.80).
author David Boddie <david@boddie.org.uk>
date Tue Apr 15 02:06:05 2003 +0200
parents a6be29d7d937
children ff2377de5265
files ADF2INF.py
diffstat 1 files changed, 13 insertions(+), 7 deletions(-) [+]
line diff
     1.1 --- a/ADF2INF.py	Tue Apr 15 02:04:01 2003 +0200
     1.2 +++ b/ADF2INF.py	Tue Apr 15 02:06:05 2003 +0200
     1.3 @@ -36,16 +36,22 @@
     1.4      
     1.5      syntax_obj = cmdsyntax.Syntax(syntax)
     1.6      
     1.7 -    matches = syntax_obj.get_args(sys.argv[1:])
     1.8 +    matches, failed = syntax_obj.get_args(sys.argv[1:], return_failed = 1)
     1.9      
    1.10 -    if matches == [] and cmdsyntax.use_GUI() != None:
    1.11 +    if len(matches) != 1 and cmdsyntax.use_GUI() != None:
    1.12      
    1.13 -        form = cmdsyntax.Form("ADF2INF", syntax_obj)
    1.14 +        form = cmdsyntax.Form("ADF2INF", syntax_obj, failed[0])
    1.15          
    1.16 -        matches = [form.get_args()]
    1.17 +        matches = form.get_args()
    1.18      
    1.19 -    # Take the first match.
    1.20 -    match = matches[0]
    1.21 +    # Take the first match, if possible.
    1.22 +    if len(matches) > 0:
    1.23 +    
    1.24 +        match = matches[0]
    1.25 +    
    1.26 +    else:
    1.27 +    
    1.28 +        match = None
    1.29      
    1.30      if match == {} or match is None:
    1.31      
    1.32 @@ -106,7 +112,7 @@
    1.33      try:
    1.34          adf = open(adf_file, "rb")
    1.35      except IOError:
    1.36 -        print "Couldn't open the ADF file, %s" % adf_file
    1.37 +        print "Couldn't open the ADF file: %s" % adf_file
    1.38          print
    1.39          sys.exit()
    1.40