Changeset 358 for pkpgcounter/trunk

Show
Ignore:
Timestamp:
08/15/06 00:10:52 (18 years ago)
Author:
jerome
Message:

Ensures that the resolution argument is comprised between 72 and 1200 dpi.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pkpgcounter/trunk/pkpgpdls/analyzer.py

    r353 r358  
    3232 
    3333 
    34 class AnalyzerOption : 
     34class AnalyzerOptions : 
    3535    """A class for use as the options parameter to PDLAnalyzer's constructor.""" 
    3636    def __init__(self, debug=None, 
     
    4545class PDLAnalyzer :     
    4646    """Class for PDL autodetection.""" 
    47     def __init__(self, filename, options=AnalyzerOption()) : 
     47    def __init__(self, filename, options=AnalyzerOptions()) : 
    4848        """Initializes the PDL analyzer. 
    4949         
     
    190190    if options.version : 
    191191        print "%s" % version.__version__ 
     192    elif not (72 <= options.resolution <= 1200) :     
     193        sys.stderr.write("ERROR: the argument to the --resolution command line switch must be between 72 and 1200.\n") 
     194        sys.stderr.flush() 
    192195    else : 
    193196        if (not arguments) or ((not sys.stdin.isatty()) and ("-" not in arguments)) :