#NEWLINE# def pre_process( self , entry ) : #NEWLINE# #INDENT# '\n        A hook is used to clean up feed entry data before it is processed.\n        This hook can be used to clean up dates and/or media data\n        before being processed.\n        ' #NEWLINE# date_published = entry . get ( 'published' , entry . get ( 'updated' ) ) #NEWLINE# if ( not date_published ) : #NEWLINE# #INDENT# date_published = str ( datetime . datetime . utcnow ( ) ) #NEWLINE# #UNINDENT# date_published = dateutil . parser . parse ( date_published ) #NEWLINE# utcoffset = date_published . utcoffset ( ) #NEWLINE# if utcoffset : #NEWLINE# #INDENT# date_published = ( date_published - utcoffset ) #NEWLINE# #UNINDENT# date_published = date_published . replace ( tzinfo = None ) #NEWLINE# entry [ 'published' ] = date_published #NEWLINE# if ( 'link' in entry ) : #NEWLINE# #INDENT# protocol_index = entry [ 'link' ] . find ( '://' ) #NEWLINE# if ( protocol_index != ( - 1 ) ) : #NEWLINE# #INDENT# entry [ 'link' ] = ( self [ 'link' ] [ : ( protocol_index + 3 ) ] + iri_to_uri ( entry [ 'link' ] [ ( protocol_index + 3 ) : ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# entry [ 'link' ] = iri_to_uri ( entry [ 'link' ] )