Display a success message
555955
def success(msg, *args, **kwargs):
    ''''''
    echo('{0} {1}'.format(green(OK), white(msg)), *args, **kwargs)
332231
def success_response(**data):
    """"""
    data_out = {}
    data_out["status"] = "success"
    data_out.update(data)
    js = dumps(data_out, default=date_handler)
    return Response(js, status=200, mimetype="application/json")
908462
public function success($str = 'Success', $sub_header = null)
    {
        // by using this hook you can overwrite default behavior of this method
        if ($this->hookHasCallbacks('displaySuccess')) {
            return $this->hook('displaySuccess', [$str, $sub_header]);
        }

        /* below code works, but pollutes output with bad id=xx
        $success = new Message([$str, 'id'=>false, 'type'=>'success', 'icon'=>'check']);
        $success->app = $this->app;
        $success->init();
        $success->text->addParagraph($sub_header);
         */
        $success = $this->app->loadTemplate($this->successTemplate);
        $success['header'] = $str;

        if ($sub_header) {
            $success['message'] = $sub_header;
        } else {
            $success->del('p');
        }

        $js = $this->js()
            ->html($success->render());

        return $js;
    }
634200
def handle_dialog(self, *args, **kwargs):
        """"""
        form = self.get_form_class()(self.request.POST, initial=kwargs, instance=self.object)

        success_message = None
        if form.is_valid():
            obj = form.save()
            success_message = self.success_message.format(
                model_name=self.get_model_config().model_name.capitalize(),
                object=str(obj),
            )
        return self.display_dialog(*args, form_instance=form, success_message=success_message, **kwargs)
1147817
def success_response(field=None, data=None, request_type=""):
    """"""
    data_out = {}
    data_out["status"] = "success"
    if field:
        data_out[field] = data
    print("{} request successful.".format(request_type))
    js = dumps(data_out, default=date_handler)
    return Response(js, status=200, mimetype='application/json')
320356
def notifySolved(self, identifier, title):
        
        notify(self.workbench, u"Congratulations", u"Congratulations! You "
               "have completed the '{title}' exercise.".format(title=title))
        return {}
1329539
def success(self):
        
        return self.ack.upper() in (self.config.ACK_SUCCESS,
                                    self.config.ACK_SUCCESS_WITH_WARNING)
1206973
def displayStatusMessage(self, msgObj):
        

        # Ensure the message ends with a newline character.
        msg = msgObj.data
        if not msg.endswith('\n'):
            msg = msg + '\n'

        # Display the message in the status field.
        self.qteLabel.setText(msg)
666961
public function SuccessContent() {
		if ($object = $this->NewObject()) {
			$message = $this->Data()->SuccessMessage;
			$message = str_replace('$Title', $object->Title, $message);
			$message = str_replace('$Link', $object->Link('?stage=Stage'), $message);
			return $message;
		}
	}
1108791
def success(self, msg, *args, **kw):
        """"""
        if self.isEnabledFor(SUCCESS):
            self._log(SUCCESS, msg, args, **kw)
567515
def progress(self, *msg):
        
        label = colors.purple("Progress")
        self._msg(label, *msg)
29838
function success($id=false){
		if ($id!==false)
			$this->nid = $id;
		$this->ready=true;
	}
300966
function success(response, body) {
  var content = _.assign(body || {}, {success: true});
  send(response, content, StatusCode.ok);
}
383016
def _onsuccess(self, result):
        
        if KSER_METRICS_ENABLED == "yes":
            KSER_TASKS_STATUS.labels(
                __hostname__, self.__class__.path, 'SUCCESS'
            ).inc()
        if result:
            result = self.result + result
        else:
            result = self.result
        logger.info(
            "{}.Success: {}[{}]: {}".format(
                self.__class__.__name__, self.__class__.path, self.uuid, result
            ),
            extra=dict(
                kmsg=Message(
                    self.uuid, entrypoint=self.__class__.path,
                    params=self.params, metadata=self.metadata
                ).dump(),
                kresult=ResultSchema().dump(result) if result else dict()
            )
        )
        return self.onsuccess(result)
36573
def display_status():
    """"""
    def print_status(msg, color):
        """Print the status message.

        Args:
            msg: The message to display (e.g. OK or FAILED).
            color: The ANSI color code to use in displaying the message.
        """
        print('\r' if sys.stdout.isatty() else '\t', end='')
        print('{}{}[{color}{msg}{}]{}'.format(
            Cursor.FORWARD(_ncols() - 8),
            Style.BRIGHT,
            Fore.RESET,
            Style.RESET_ALL,
            color=color,
            msg=msg[:6].upper().center(6)
        ))
        sys.stdout.flush()

    try:
        yield
    except Status as e:
        _LOGGER.debug(e)
        print_status(e.msg, e.color)
        if e.exc:
            raise e.exc  # pylint: disable=raising-bad-type
    except (KeyboardInterrupt, EOFError):
        raise
    except Exception:
        print_status('FAILED', Fore.RED)
        raise
    else:
        print_status('OK', Fore.GREEN)
615039
def Message(self, text):
        
        self.Display(text)
        self.sconf.cached = 1
        self.did_show_result = 0
244748
def display_message(self, clear, beep, timeout, line1, line2):
        """"""
        self._elk.send(
            dm_encode(self._index, clear, beep, timeout, line1, line2)
        )