#NEWLINE# def _get_week_period( self ) : #NEWLINE# #INDENT# '\n        Returns beginning and an end for a week period.\n        ' #NEWLINE# dt = datetime . datetime ( self . now . year , 1 , 1 ) #NEWLINE# if ( dt . weekday ( ) > 3 ) : #NEWLINE# #INDENT# dt += datetime . timedelta ( ( 7 - dt . weekday ( ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# dt -= datetime . timedelta ( dt . weekday ( ) ) #NEWLINE# #UNINDENT# days = datetime . timedelta ( ( ( int ( self . now . strftime ( '%V' ) ) - 1 ) * 7 ) ) #NEWLINE# start = ( dt + days ) #NEWLINE# end = ( ( dt + days ) + datetime . timedelta ( 6 ) ) . replace ( hour = 23 , minute = 59 , second = 59 , microsecond = 999999 ) #NEWLINE# return ( start . strftime ( self . template ) , end . strftime ( self . template ) )