#NEWLINE# def _delta( self , x , isend = 0 ) : #NEWLINE# #INDENT# kwargs = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if ( x . month is not None ) : #NEWLINE# #INDENT# kwargs [ 'month' ] = x . month #NEWLINE# if ( x . weekday is not None ) : #NEWLINE# #INDENT# kwargs [ 'weekday' ] = relativedelta . weekday ( x . weekday , x . week ) #NEWLINE# if ( isend . week > 0 ) : #NEWLINE# #INDENT# kwargs [ 'day' ] = 1 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# kwargs [ 'day' ] = 31 #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if x . day : #NEWLINE# #INDENT# kwargs [ 'day' ] = x . day #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( x . yday is not None ) : #NEWLINE# #INDENT# kwargs [ 'yearday' ] = x . yday #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( x . jyday is not None ) : #NEWLINE# #INDENT# kwargs [ 'nlyearday' ] = x . jyday #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( not kwargs ) : #NEWLINE# #INDENT# if ( not isend ) : #NEWLINE# #INDENT# kwargs [ 'month' ] = 4 #NEWLINE# kwargs [ 'day' ] = 1 #NEWLINE# kwargs [ 'weekday' ] = relativedelta . SU ( ( + 1 ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# kwargs [ 'month' ] = 10 #NEWLINE# kwargs [ 'day' ] = 31 #NEWLINE# kwargs [ 'weekday' ] = relativedelta . SU ( ( - 1 ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( x . time is not None ) : #NEWLINE# #INDENT# kwargs [ 'seconds' ] = x . time #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# kwargs [ 'seconds' ] = 7200 #NEWLINE# #UNINDENT# if isend : #NEWLINE# #INDENT# delta = ( self . _dst_offset - self . _std_offset ) #NEWLINE# kwargs [ 'seconds' ] -= ( delta . seconds + ( delta . days * 86400 ) ) #NEWLINE# #UNINDENT# return relativedelta . relativedelta ( ** kwargs )