Unfortunately, one plugin is conflicting with InaSAFE.

    We are displaying a message about this conflict.

    :returns: Information for the user on how to get started.
    :rtype: safe.messaging.Message
353899
def conflicting_plugin_message():
    
    message = m.Message()
    message.add(LOGO_ELEMENT)
    message.add(m.Heading(tr('Conflicting plugin detected'), **WARNING_STYLE))
    notes = m.Paragraph(conflicting_plugin_string())
    message.add(notes)
    return message
424831
void securityMessageReceived(NextFilter nextFilter, IoSession session, Object message) throws Exception {
        final boolean loggerIsEnabled = logger != null && logger.isTraceEnabled();

        if (! httpRequestMessageReceived(nextFilter, session, message)) return;

        HttpRequestMessage httpRequest = (HttpRequestMessage) message;
        ResourceAddress httpAddress = httpRequest.getLocalAddress();
        
        if (alreadyLoggedIn(httpRequest)) {
            // KG-3232, KG-3267: we should never leave the login context unset
            // for unprotected services.
            if (httpRequest.getLoginContext() == null) {
                setUnprotectedLoginContext(httpRequest);
            }
            if (loggerIsEnabled) {
                logger.trace("HttpSubjectSecurityFilter skipped because we are already allowed or logged in.");
            }

            super.doMessageReceived(nextFilter, session, message);
            return;
        }

        HttpRealmInfo[] realms = httpAddress.getOption(HttpResourceAddress.REALMS);
        if (realms.length == 0) {
            setUnprotectedLoginContext(httpRequest);
            if (loggerIsEnabled) {
                logger.trace("HttpSecurityStandardFilter skipped because no realm is configured.");
            }
            super.doMessageReceived(nextFilter, session, message);
            return;
        }
        
        String challengeIdentity = httpRequest.getHeader(HEADER_SEC_CHALLENGE_IDENTITY);
        LoginContext[] loginContexts = getLoginContexts(challengeIdentity);
        int realmIndex = findCurrentRealm(loginContexts);
        HttpRealmInfo realm = realms[realmIndex];

        AuthenticationTokenExtractor tokenExtractor = DefaultAuthenticationTokenExtractor.INSTANCE;

        //
        // Login using the token; if login fails, the appropriate reply has already been sent from this filter
        // so stop the filter chain here.
        //

        DefaultAuthenticationToken authToken = (DefaultAuthenticationToken) tokenExtractor.extract(httpRequest, realm);

        String expectedChallengeScheme = getBaseAuthScheme(realm.getChallengeScheme());

        // Now set the expected challenge scheme on the AuthToken.  If the
        // client provided a scheme, the above check ensures that the
        // provided scheme matches our expected scheme, so calling setScheme()
        // does not harm anything.  If the client did NOT provide a scheme,
        // this properly sets one, for the benefit of login modules which
        // check for such things.
        if(authToken.getScheme() == null) {
            authToken.setScheme(expectedChallengeScheme);
        }

        // Suspend incoming events into this filter. Will resume after LoginContext.login() completion
        suspendIncoming(session);

        TypedCallbackHandlerMap additionalCallbacks = null;
        if (realmIndex > 0) {
            additionalCallbacks = new TypedCallbackHandlerMap();
            Function<String, Subject> subjects = name -> findNamedSubject(name, realms, realmIndex, loginContexts);
            NamedSubjectCallbackHandler callbackHandler = new NamedSubjectCallbackHandler(subjects);
            additionalCallbacks.put(NamedSubjectCallback.class, callbackHandler);
        }

        // Schedule LoginContext.login() execution using a separate thread
        LoginContextTask loginContextTask = new LoginContextTask(nextFilter, session, httpRequest, authToken, additionalCallbacks, realms, realmIndex, loginContexts);
        scheduler.execute(loginContextTask);
    }
505099
def message(self, message=None):
        
        if message is not None:
            self.response_model.message = message
        return self.response_model.message
475558
def __get_exception_message(self):
        
        exception_info = sys.exc_info()[1]
        if hasattr(exception_info, 'msg'):
            exc_message = exception_info.msg
        elif hasattr(exception_info, 'message'):
            exc_message = exception_info.message
        else:
            exc_message = '(Unknown Exception)'
        return exc_message
1099498
def _handle_conflict(self, name):
        
        err = HTTPConflict('Member "%s" already exists!' % name).exception
        return self.request.get_response(err)
984619
def error(self, message=None):
        
        if self.__parser__:  # pylint: disable-msg=E1101
            self.__parser__.error(message)  # pylint: disable-msg=E1101
        else:
            self.logger.error(message)
            sys.exit(2)
474543
def _checkSetupNeeded(self, message):
        
        # In OpenID 1, we check to see if this is a cancel from
        # immediate mode by the presence of the user_setup_url
        # parameter.
        if message.isOpenID1():
            user_setup_url = message.getArg(OPENID1_NS, 'user_setup_url')
            if user_setup_url is not None:
                raise SetupNeededError(user_setup_url)
498406
async def on_raw_761(self, message):
        
        target, targetmeta = self._parse_user(message.params[0])
        key, visibility = message.params[1:3]
        value = message.params[3] if len(message.params) > 3 else None

        if target not in self._pending['metadata']:
            return
        if target in self.users:
            self._sync_user(target, targetmeta)

        self._metadata_info[target][key] = value
227472
def conflict(self, key, **kwargs):
        
        try:
            msg = self.error_messages[key]
        except KeyError:
            class_name = self.__class__.__name__
            msg = MISSING_ERROR_MESSAGE.format(class_name=class_name, key=key)
            raise AssertionError(msg)
        message_string = msg.format(**kwargs)
        raise Conflict(message_string)
701223
def collision_warning(self, item):
        

        namespace_collisions = [
            "zappa.", "wsgi.", "middleware.", "handler.", "util.", "letsencrypt.", "cli."
        ]
        for namespace_collision in namespace_collisions:
            if item.startswith(namespace_collision):
                click.echo(click.style("Warning!", fg="red", bold=True) +
                           " You may have a namespace collision between " +
                           click.style(item, bold=True) +
                           " and " +
                           click.style(namespace_collision, bold=True) +
                           "! You may want to rename that file.")
706702
def start
      message = 'Guard::Inch is running'
      message << ' in pedantic mode' if options[:pedantic]
      message << ' and inspecting private fields' if options[:private]
      ::Guard::UI.info message
      run_all if options[:all_on_start]
    end
1274490
async def get_message(self, ignore_subscribe_messages=False, timeout=0):
        
        response = await self.parse_response(block=False, timeout=timeout)
        if response:
            return self.handle_message(response, ignore_subscribe_messages)
        return None
1133806
def allowed_info_messages(*info_messages):
    
    def wrapper(func):
        setattr(func, ALLOWED_INFO_MESSAGES, info_messages)
        return func
    return wrapper
290744
def accept(self):
        
        if self.conflicting_plugin_detected:
            display_critical_message_bar(
                tr('Conflicting plugin'),
                conflicting_plugin_string(),
                iface_object=self.iface
            )

        # Start the analysis
        self.impact_function = self.validate_impact_function()
        if not isinstance(self.impact_function, ImpactFunction):
            # This should not happen as the "accept" button should disabled if
            # the impact function is not ready.
            return ANALYSIS_FAILED_BAD_CODE, None
        if not self.impact_function.is_ready:
            LOGGER.info(tr('The impact function should not have been ready.'))
            return ANALYSIS_FAILED_BAD_CODE, None

        self.show_busy()
        self.impact_function.callback = self.progress_callback
        self.impact_function.debug_mode = self.use_debug_action.isChecked()
        self.impact_function.use_rounding = (
            not self.disable_rounding_action.isChecked())

        try:
            status, message = self.impact_function.run()
            message = basestring_to_message(message)
        except BaseException:
            # We have an exception only if we are in debug mode.
            # We want to display the datastore and then
            # we want to re-raise it to get the first aid plugin popup.
            add_debug_layers_to_canvas(self.impact_function)
            disable_busy_cursor()
            raise
        if status == ANALYSIS_FAILED_BAD_INPUT:
            self.hide_busy()
            LOGGER.warning(tr(
                'The impact function could not run because of the inputs.'))
            send_error_message(self, message)
            LOGGER.warning(message.to_text())
            return status, message
        elif status == ANALYSIS_FAILED_BAD_CODE:
            self.hide_busy()
            LOGGER.warning(tr(
                'The impact function could not run because of a bug.'))
            LOGGER.exception(message.to_text())
            send_error_message(self, message)
            return status, message

        LOGGER.info(tr('The impact function could run without errors.'))

        # Add result layer to QGIS
        add_impact_layers_to_canvas(self.impact_function, iface=self.iface)

        # execute this before generating report
        if self.zoom_to_impact_flag:
            self.iface.zoomToActiveLayer()

        qgis_exposure = layer_from_combo(self.exposure_layer_combo)
        if self.hide_exposure_flag and qgis_exposure is not None:
            treeroot = QgsProject.instance().layerTreeRoot()
            treelayer = treeroot.findLayer(qgis_exposure.id())
            if treelayer:
                treelayer.setItemVisibilityChecked(False)

        if setting('generate_report', True, bool):
            LOGGER.info('Reports are going to be generated the analysis.')
            # we only want to generate non pdf/qpt report
            html_components = [standard_impact_report_metadata_html]
            error_code, message = self.impact_function.generate_report(
                html_components)

            if error_code == ImpactReport.REPORT_GENERATION_FAILED:
                self.hide_busy()
                LOGGER.warning(tr(
                    'The impact report could not be generated.'))
                send_error_message(self, message)
                LOGGER.exception(message.to_text())
                return ANALYSIS_FAILED_BAD_CODE, message
        else:
            LOGGER.warning(
                'Reports are not generated because of your settings.')
            display_warning_message_bar(
                tr('Reports'),
                tr('Reports are not going to be generated because of your '
                   'InaSAFE settings. Check your InaSAFE settings, in the '
                    'advanced panel with the developer mode enabled.'),
                duration=10,
                iface_object=self.iface
            )

        if self.impact_function.debug_mode:
            add_debug_layers_to_canvas(self.impact_function)

        if self.aggregation:
            crs = self.aggregation.crs()
        else:
            crs = self.extent.crs
        self.extent.set_next_analysis_extent(
            self.impact_function.analysis_extent, crs)

        # We do not want to check the state of the next IF
        self.hide_busy(check_next_impact=False)
        return ANALYSIS_SUCCESS, None
968363
def main():
    
    log = logging.getLogger(mod_logger + '.main')
    parser = argparse.ArgumentParser(description='This module allows sending email messages.')
    parser.add_argument('-f', '--file', help='Full path to a plain text file', required=False)
    parser.add_argument('-s', '--sender', help='Email address of the sender', required=False)
    parser.add_argument('-r', '--recipient', help='Email address of the recipient', required=False)
    args = parser.parse_args()

    am = AssetMailer()
    err = None
    if args.file:
        try:
            am.send_text_file(text_file=args.file, sender=args.sender, recipient=args.recipient)
        except AssetMailerError:
            _, ex, trace = sys.exc_info()
            err = '{n}: There was a problem sending email with file {f} from sender {s} to recipient {r}:\n{e}'.format(
                n=ex.__class__.__name__, f=args.file, s=args.sender, r=args.recipient, e=str(ex))
            log.error(err)
    else:
        try:
            am.send_cons3rt_agent_logs()
        except AssetMailerError:
            _, ex, trace = sys.exc_info()
            err = '{n}: There was a problem sending cons3rt agent log files:\n{e}'.format(
                n=ex.__class__.__name__, e=str(ex))
            log.error(err)
    if err is None:
        log.info('Successfully send email')
1141215
def options_help():
    

    message = m.Message()
    message.add(m.Brand())
    message.add(heading())
    message.add(content())
    return message
174943
def error_message(e, message=None, cause=None):
    
    if message is None and cause is None:
        return None
    elif message is None:
        return '%s, caused by %r' % (e.__class__, cause)
    elif cause is None:
        return message
    else:
        return '%s, caused by %r' % (message, cause)