def paintAfterVariableChanges(self, request, response, callback,
                repaintAll, outWriter, window, analyzeLayouts):
        if repaintAll:
            self.makeAllPaintablesDirty(window)

        # Removes application if it has stopped during variable changes
        if not self._application.isRunning():
            self.endApplication(request, response, self._application)
            return

        self.openJsonMessage(outWriter, response)

        # security key
        writeSecurityTokenFlag = \
                request.getAttribute(self._WRITE_SECURITY_TOKEN_FLAG, None)

        if writeSecurityTokenFlag is not None:
            seckey = request.getSession().getAttribute(
                    ApplicationConnection.UIDL_SECURITY_TOKEN_ID, None)
            if seckey is None:
                seckey = str( uuid.uuid4() )
                request.getSession().setAttribute(
                        ApplicationConnection.UIDL_SECURITY_TOKEN_ID, seckey)

            outWriter.write('\"'
                    + ApplicationConnection.UIDL_SECURITY_TOKEN_ID + '\":\"')
            outWriter.write(seckey)
            outWriter.write('\",')

        # If the browser-window has been closed - we do not need to paint
        # it at all
        if window.getName() == self._closingWindowName:
            outWriter.write('\"changes\":[]')
        else:
            # re-get window - may have been changed
            newWindow = self.doGetApplicationWindow(request, callback,
                    self._application, window)
            if newWindow != window:
                window = newWindow
                repaintAll = True

            self.writeUidlResponce(callback, repaintAll, outWriter, window,
                    analyzeLayouts)

        self.closeJsonMessage(outWriter)

        #outWriter.close()
@raise PaintException:
dataset/ETHPy150Open rwl/muntjac/muntjac/terminal/gwt/server/abstract_communication_manager.py/AbstractCommunicationManager.paintAfterVariableChanges