<s> from __future__ import absolute_import , unicode_literals <EOL> import datetime <EOL> import re <EOL> from . . import util <EOL> class Namespace ( object ) : <EOL> supported_namespaces = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> def __init__ ( self ) : <EOL> self . psc_chapters_flag = False <EOL> super ( Namespace , self ) . __init__ ( ) <EOL> def _start_psc_chapters ( self , attrsD ) : <EOL> context = self . _getContext ( ) <EOL> if '<STR_LIT>' not in context : <EOL> self . psc_chapters_flag = True <EOL> attrsD [ '<STR_LIT>' ] = [ ] <EOL> context [ '<STR_LIT>' ] = util . FeedParserDict ( attrsD ) <EOL> def _end_psc_chapters ( self ) : <EOL> self . psc_chapters_flag = False <EOL> def _start_psc_chapter ( self , attrsD ) : <EOL> if self . psc_chapters_flag : <EOL> start = self . _getAttribute ( attrsD , '<STR_LIT:start>' ) <EOL> attrsD [ '<STR_LIT>' ] = _parse_psc_chapter_start ( start ) <EOL> context = self . _getContext ( ) [ '<STR_LIT>' ] <EOL> context [ '<STR_LIT>' ] . append ( util . FeedParserDict ( attrsD ) ) <EOL> def _parse_psc_chapter_start ( start ) : <EOL> FORMAT = r'<STR_LIT>' <EOL> m = re . compile ( FORMAT ) . match ( start ) <EOL> if m is None : <EOL> return None <EOL> _ , h , m , s , _ , ms = m . groups ( ) <EOL> h , m , s , ms = ( int ( h or <NUM_LIT:0> ) , int ( m ) , int ( s ) , int ( ms or <NUM_LIT:0> ) ) <EOL> return datetime . timedelta ( <NUM_LIT:0> , h * <NUM_LIT> * <NUM_LIT> + m * <NUM_LIT> + s , ms * <NUM_LIT:1000> ) </s>
