Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
Validation function.  Converts a config value to a log severity.
Raises ConfigError on failure.

        def _parseSeverity(severity):
    """Validation function.  Converts a config value to a log severity.
       Raises ConfigError on failure."""
    s = severity.strip().upper()
    if not mixminion.Common._SEVERITIES.has_key(s):
        raise ConfigError("Invalid log level %r" % (severity))
    return s
        


src/m/i/mixminion-HEAD/lib/mixminion/server/ServerMain.py   mixminion(Download)
        elif o == '--severity':
            try:
                severity = mixminion.Config._parseSeverity(v)
            except mixminion.Config.ConfigError, e:
                raise UIError(str(e))

src/m/i/mixminion-HEAD/lib/mixminion/test.py   mixminion(Download)
        self.assertEquals(C._parseBoolean(" NO"), 0)
        # severity
        self.assertEquals(C._parseSeverity("error"), "ERROR")
        # serverMode
        self.assertEquals(C._parseServerMode(" relay "), "relay")