<s> """<STR_LIT>""" <EOL> __author__ = "<STR_LIT>" <EOL> __email__ = "<STR_LIT>" <EOL> __version__ = "<STR_LIT>" <EOL> __url__ = "<STR_LIT>" <EOL> __description__ = ( <EOL> "<STR_LIT>" ) <EOL> __category__ = "<STR_LIT:date>" <EOL> __license__ = "<STR_LIT>" <EOL> __registrytags__ = "<STR_LIT>" <EOL> import time <EOL> def iso8601_hack_tostring ( t , timezone ) : <EOL> timezone = int ( timezone ) <EOL> if timezone : <EOL> sign = ( timezone < <NUM_LIT:0> ) and "<STR_LIT:+>" or "<STR_LIT:->" <EOL> timezone = abs ( timezone ) <EOL> hours = timezone / ( <NUM_LIT> * <NUM_LIT> ) <EOL> minutes = ( timezone % ( <NUM_LIT> * <NUM_LIT> ) ) / <NUM_LIT> <EOL> tzspecifier = "<STR_LIT>" % ( sign , hours , minutes ) <EOL> else : <EOL> tzspecifier = "<STR_LIT>" <EOL> psecs = t - int ( t ) <EOL> t = time . gmtime ( int ( t ) - timezone ) <EOL> year , month , day , hours , minutes , seconds = t [ : <NUM_LIT:6> ] <EOL> if seconds or psecs : <EOL> if psecs : <EOL> psecs = int ( round ( psecs * <NUM_LIT:100> ) ) <EOL> f = "<STR_LIT>" <EOL> v = ( year , month , day , hours , minutes , seconds , psecs , tzspecifier ) <EOL> else : <EOL> f = "<STR_LIT>" <EOL> v = ( year , month , day , hours , minutes , seconds , tzspecifier ) <EOL> else : <EOL> f = "<STR_LIT>" <EOL> v = ( year , month , day , hours , minutes , tzspecifier ) <EOL> return f % v <EOL> try : <EOL> from xml . utils import iso8601 <EOL> format_date = iso8601 . tostring <EOL> except ( ImportError , AttributeError ) : <EOL> format_date = iso8601_hack_tostring <EOL> def get_formatted_date ( entry ) : <EOL> if not entry : <EOL> return "<STR_LIT>" <EOL> time_tuple = entry [ '<STR_LIT>' ] <EOL> tzoffset = time . timezone <EOL> if time_tuple [ <NUM_LIT:8> ] == <NUM_LIT:1> : <EOL> tzoffset = time . altzone <EOL> return format_date ( time . mktime ( time_tuple ) , tzoffset ) <EOL> def cb_story ( args ) : <EOL> entry = args [ '<STR_LIT>' ] <EOL> entry [ "<STR_LIT>" ] = get_formatted_date ( entry ) <EOL> def cb_head ( args ) : <EOL> entry = args [ "<STR_LIT>" ] <EOL> req = args [ "<STR_LIT>" ] <EOL> data = req . get_data ( ) <EOL> entrylist = data . get ( "<STR_LIT>" , None ) <EOL> if not entrylist : <EOL> return args <EOL> entry [ "<STR_LIT>" ] = get_formatted_date ( entrylist [ <NUM_LIT:0> ] ) <EOL> return args <EOL> cb_foot = cb_head </s>
