def timeparse(sval):
 match = re.match(((u'\\s*' + TIMEFORMAT) + u'\\s*$'), sval, re.I)
 if ((not match) or (not match.group(0).strip())):
  return
 mdict = match.groupdict()
 return sum(((MULTIPLIERS[k] * cast(v)) for (k, v) in mdict.items() if (v is not None)))

def timeparse ( sval ) : match = re . match ( ( ( u'\\s*' + TIMEFORMAT ) + u'\\s*$' ) , sval , re . I ) if ( ( not match ) or ( not match . group ( 0 ) . strip ( ) ) ) : return mdict = match . groupdict ( ) return sum ( ( ( MULTIPLIERS [ k ] * cast ( v ) ) for ( k , v ) in mdict . items ( ) if ( v is not None ) ) )
parse a time expression .