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

All Samples(3)  |  Call(2)  |  Derive(0)  |  Import(1)
Entry validation function.  Converts a config value to a boolean.
Raises ConfigError on failure.

        def _parseBoolean(boolean):
    """Entry validation function.  Converts a config value to a boolean.
       Raises ConfigError on failure."""
    s = boolean.strip().lower()
    if s in ("1", "yes", "y", "true", "on"):
        return 1
    elif s not in ("0", "no", "n", "false", "off"):
        raise ConfigError("Invalid boolean %r" % (boolean))
    else:
        return 0
        


src/m/i/mixminion-HEAD/lib/mixminion/test.py   mixminion(Download)
        ## First, check valid cases.
        # boolean
        self.assertEquals(C._parseBoolean("yes"), 1)
        self.assertEquals(C._parseBoolean(" NO"), 0)
        # severity

src/m/i/mixminion-HEAD/lib/mixminion/testSupport.py   mixminion(Download)
import mixminion.Common
from mixminion.Common import waitForChildren, ceilDiv, createPrivateDir, LOG
from mixminion.Config import _parseBoolean, _parseIntervalList, ConfigError
 
from mixminion.server.Modules import DELIVER_FAIL_NORETRY, DELIVER_FAIL_RETRY,\