def parse_isoduration(duration):
 result = iso_duration_re.match(duration)
 if (not result):
  raise ValueError(_('Only ISO 8601 duration format of the form PT#H#M#S is supported.'))
 t = 0
 t += ((3600 * int(result.group(1))) if result.group(1) else 0)
 t += ((60 * int(result.group(2))) if result.group(2) else 0)
 t += (int(result.group(3)) if result.group(3) else 0)
 return t

def parse_isoduration ( duration ) : result = iso_duration_re . match ( duration ) if ( not result ) : raise ValueError ( _ ( 'Only ISO 8601 duration format of the form PT#H#M#S is supported.' ) ) t = 0 t += ( ( 3600 * int ( result . group ( 1 ) ) ) if result . group ( 1 ) else 0 ) t += ( ( 60 * int ( result . group ( 2 ) ) ) if result . group ( 2 ) else 0 ) t += ( int ( result . group ( 3 ) ) if result . group ( 3 ) else 0 ) return t
convert duration in iso 8601 format to second(s) .