#NEWLINE# def cleanup( self ) : #NEWLINE# #INDENT# "\n        Updates the website and/or init files and restarts websites if needed.\n\n        There's no need to call this method since provy's lifecycle will make sure it is called.\n        " #NEWLINE# super ( DjangoRole , self ) . cleanup ( ) #NEWLINE# if ( SITES_KEY in self . context ) : #NEWLINE# #INDENT# for website in self . context [ SITES_KEY ] : #NEWLINE# #INDENT# updated = self . _update_init_script ( website ) #NEWLINE# settings_updated = self . _update_settings ( website ) #NEWLINE# if website . use_supervisor : #NEWLINE# #INDENT# self . _update_supervisor_program ( website ) #NEWLINE# #UNINDENT# if ( updated or updated ) : #NEWLINE# #INDENT# self . _ensure_restart ( website ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( ( MUST_RESTART_KEY in self . context ) and self . context [ MUST_RESTART_KEY ] ) : #NEWLINE# #INDENT# if self . restart_supervisor_on_changes : #NEWLINE# #INDENT# with self . using ( SupervisorRole ) as role : #NEWLINE# #INDENT# role . ensure_restart ( ) #NEWLINE# #UNINDENT# #UNINDENT# for site in self . context [ MUST_RESTART_KEY ] : #NEWLINE# #INDENT# self . _restart ( site )