Did I find the right examples for you? yes no

All Samples(5)  |  Call(5)  |  Derive(0)  |  Import(0)
Convert a time string to seconds.
Return None if failed.

        def val2secs( value ):
    """
    Convert a time string to seconds.
    Return None if failed.
    """

    if re.search( '[mshdwcyMSHDWCY]', value ) == None:
        return string.atoi(value)
    timech = value[-1]
    value = value[:-1]
    mult = atom( timech )
    if mult == None:
        return None                # error parsing multiplier character
    if mult == 0:
        return 0
    return string.atoi(value)*mult
        


src/e/d/EDDIE-Tool-1.0.0/eddietool/common/config.py   EDDIE-Tool(Download)
        global scanperiodraw
        scanperiodraw = value                        # keep the raw scanperiod
        value = utils.val2secs( value )                # convert value to seconds
        if value > 0:
            global scanperiod
            rawval = list[2]+list[3]
 
        value = utils.val2secs( rawval )                # convert value to seconds
        if value > 0:
            log.admin_notify = value                # set the config option

src/e/d/EDDIE-Tool-1.0.0/eddietool/common/directive.py   EDDIE-Tool(Download)
            # convert scanperiod to integer seconds if not already
            if type(self.args.scanperiod) != type(1):
                self.args.scanperiod = utils.val2secs( self.args.scanperiod )
                if self.args.scanperiod == None:
                    raise ParseFailure("Invalid scanperiod: '%s'"%(self.args.scanperiod))
        try:
            if type(self.args.checkwait) != type(1):
                self.args.checkwait = utils.val2secs( self.args.checkwait )
        except:
            raise ParseFailure("checkwait argument has incorrect value '%s'"%(self.args.checkwait))

src/e/d/EDDIE-Tool-1.0.0/eddietool/common/definition.py   EDDIE-Tool(Download)
                if self.defs[argline[0]] == 'TIME':
                    # Convert time to seconds if required
                    value = utils.val2secs(value)
 
                assignment = 'self.%s=%d' % (argline[0],value)