def ParseTaskAgeLimit(age_limit):
 age_limit = age_limit.strip()
 if (not age_limit):
  raise MalformedQueueConfiguration('Task Age Limit must not be empty.')
 unit = age_limit[(-1)]
 if (unit not in 'smhd'):
  raise MalformedQueueConfiguration('Task Age_Limit must be in s (seconds), m (minutes), h (hours) or d (days)')
 try:
  number = float(age_limit[0:(-1)])
  if (unit == 's'):
   return int(number)
  if (unit == 'm'):
   return int((number * 60))
  if (unit == 'h'):
   return int((number * 3600))
  if (unit == 'd'):
   return int((number * 86400))
 except ValueError:
  raise MalformedQueueConfiguration(('Task Age_Limit "%s" is invalid.' % age_limit))

def ParseTaskAgeLimit ( age_limit ) : age_limit = age_limit . strip ( ) if ( not age_limit ) : raise MalformedQueueConfiguration ( 'Task Age Limit must not be empty.' ) unit = age_limit [ ( - 1 ) ] if ( unit not in 'smhd' ) : raise MalformedQueueConfiguration ( 'Task Age_Limit must be in s (seconds), m (minutes), h (hours) or d (days)' ) try : number = float ( age_limit [ 0 : ( - 1 ) ] ) if ( unit == 's' ) : return int ( number ) if ( unit == 'm' ) : return int ( ( number * 60 ) ) if ( unit == 'h' ) : return int ( ( number * 3600 ) ) if ( unit == 'd' ) : return int ( ( number * 86400 ) ) except ValueError : raise MalformedQueueConfiguration ( ( 'Task Age_Limit "%s" is invalid.' % age_limit ) )
parses a string representing the tasks age limit .