Anonymous avatar Anonymous committed 2b6800b

Add 'log' level for stdio inspection.

Comments (0)

Files changed (1)

lib/galaxy/tools/__init__.py

 # that warning < fatal. This is really meant to just be an enum. 
 class StdioErrorLevel( object ):
     NO_ERROR = 0
-    WARNING = 1
-    FATAL = 2
-    MAX = 2
-    descs = {NO_ERROR : 'No error', WARNING : 'Warning', FATAL : 'Fatal error'}
+    LOG  = 1
+    WARNING = 2
+    FATAL = 3
+    MAX = 3
+    descs = {
+        NO_ERROR : 'No error', 
+        LOG: 'Log', 
+        WARNING : 'Warning', 
+        FATAL : 'Fatal error'
+    }
     @staticmethod
     def desc( error_level ):
         err_msg = "Unknown error"
     # TODO: This method doesn't have to be part of the Tool class.
     def parse_error_level( self, err_level ):
         """
-        Return fatal or warning depending on what's in the error level.
-        This will assume that the error level fatal is returned if it's 
-        unparsable. 
+        Parses error level and returns error level enumeration. If
+        unparsable, returns 'fatal'
         """
-        # What should the default be? I'm claiming it should be fatal:
-        # if you went to the trouble to write the rule, then it's 
-        # probably a problem. I think there are easily three substantial
-        # camps: make it fatal, make it a warning, or, if it's missing,
-        # just throw an exception and ignore the exit_code element.
         return_level = StdioErrorLevel.FATAL 
         try:
-            if ( None != err_level ):
-                if ( re.search( "warning", err_level, re.IGNORECASE ) ):
+            if err_level:
+                if ( re.search( "log", err_level, re.IGNORECASE ) ):
+                    return_level = StdioErrorLevel.LOG
+                elif ( re.search( "warning", err_level, re.IGNORECASE ) ):
                     return_level = StdioErrorLevel.WARNING 
                 elif ( re.search( "fatal", err_level, re.IGNORECASE ) ):
                     return_level = StdioErrorLevel.FATAL
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.