• Login
  • Help/Guide
  • About Trac
  • Preferences
  • Wiki
  • Timeline
  • Roadmap
  • Browse Source
  • View Tickets
  • Search

Context Navigation

  • ← Previous Change
  • Next Change →

Changeset 132 for Xml/Validator/Backend/isValidOME.py

Show
Ignore:
Timestamp:
01/10/08 15:12:08 (10 months ago)
Author:
andrew
Message:

Added -e to print errors and -w to print warnings

Files:
1 modified

  • Xml/Validator/Backend/isValidOME.py (modified) (2 diffs)

Legend:

Unmodified
Added
Removed
  • Xml/Validator/Backend/isValidOME.py

    r103 r132  
    3131        try: 
    3232                try: 
    33                         opts, args = getopt.getopt(argv[1:], "ho:v", ["help", "output="]) 
     33                        opts, args = getopt.getopt(argv[1:], "ho:vew", ["help", "output="]) 
    3434                except getopt.error, msg: 
    3535                        raise Usage(msg) 
    3636                 
    3737                verbose = False 
     38                warnings = False 
     39                errors = False 
    3840                # option processing 
    3941                for option, value in opts: 
    4042                        if option == "-v": 
    4143                                verbose = True 
     44                        if option == "-w": 
     45                                warnings = True 
     46                        if option == "-e": 
     47                                errors = True 
    4248                        if option in ("-h", "--help"): 
    4349                                raise Usage(help_message) 
    … …  
    6773                                        print "============ XML block %s [raw]============ " % aFilename 
    6874                                        print report.theDom.toxml() 
     75                        else: 
     76                                out = str() 
     77                                if errors and len(report.errorList) > 0: 
     78                                        out = out + "Errors:\n" 
     79                                        for error in report.errorList: 
     80                                                out = out + str(error) 
     81                                if warnings and len(report.warningList) > 0: 
     82                                        out = out + "Warnings:\n" 
     83                                        for warning in report.warningList: 
     84                                                out = out + str(warning) 
     85                                 
     86                                if len(out) > 0: 
     87                                        print out 
    6988         
    7089        except Usage, err: 

Download in other formats:

  • Unified Diff
  • Zip Archive

Trac Powered

Powered by Trac 0.11
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/