Style for a success message.
171375
def success(self, cmd, desc=''):
        '''  '''
        return self._label_desc(cmd, desc, self.success_color)
852742
def colorize(style, msg, resp):
    
    code = resp.status.split(maxsplit=1)[0]
    if code[0] == '2':
        # Put 2XX first, since it should be the common case
        msg = style.HTTP_SUCCESS(msg)
    elif code[0] == '1':
        msg = style.HTTP_INFO(msg)
    elif code == '304':
        msg = style.HTTP_NOT_MODIFIED(msg)
    elif code[0] == '3':
        msg = style.HTTP_REDIRECT(msg)
    elif code == '404':
        msg = style.HTTP_NOT_FOUND(msg)
    elif code[0] == '4':
        msg = style.HTTP_BAD_REQUEST(msg)
    else:
        # Any 5XX, or any other response
        msg = style.HTTP_SERVER_ERROR(msg)
    return msg
411036
public function output(string $type, string $style, string $message, $status = true)
    {
        $text = '....';

        if ($status === true) {
            $text .= '<success>OK</>';
        } elseif ($status === false) {
            $text = '';
        } else {
            $text .= "<info>{$status}</>";
        }

        $type = "<{$style}>{$type}</>";

        $this->output->writeln(
            sprintf(
                '%s: %s %s',
                $type,
                $message,
                $text
            )
        );
    }
816107
public function success($title, $content, $icon = true, $iconSmall = true)
    {
        $this->message('success', $title, $content, $icon, $iconSmall);
    }
29909
def display_dialog(self, *args, **kwargs):
        """"""
        form = kwargs.pop('form_instance', None)
        success_message = kwargs.pop('success_message', None)

        if not form:
            form = self.get_form_class()(initial=kwargs, instance=self.object)

        if not hasattr(form, "helper"):
            form.helper = FormHelper()
        form.helper.form_tag = False

        return {
            'title': self.title.format(
                model_name=self.get_model_config().model_name,
                object=str(self.object) if self.object else '',
            ),
            'content': self.render_to_string(self.template, {
                'form': form,
                'success_message': success_message,
            }),
            'submit_label': self.submit_label,
            'success': bool(success_message),
        }
446158
function success() {

  var args = [].slice.call(arguments);
  let succesOptions = Object.assign({}, options);;
  let message = defaultMessage;

  if ( args.length ) {
    args.forEach(function(arg) {
      switch(typeof arg) {
        case 'object':
          succesOptions = Object.assign(succesOptions, arg);
        break;
        case 'string':
          message = succesOptions.messages[arg] || arg;
        break;
      }
    });
  }

  let first = true;
  let logType = "Created";
  let prefix = typeof succesOptions.prefix !== 'undefined' ? succesOptions.prefix + ' ' : '';
  let suffix = typeof succesOptions.suffix !== 'undefined' ? ' ' + succesOptions.suffix : '';

  message = prefix + message + suffix;

  if (caches.includes(message) && message !== defaultMessage) {
    logType = "Updated";
  }

  caches.push(message);

  if ( typeof succesOptions.extra !== 'undefined') {
    var extra = typeof succesOptions.extra == 'object' ? succesOptions.extra : [succesOptions.extra];
    extra.forEach(file => {
      log(logType, file, message);
    })
    succesOptions.extra = undefined;
  }

  return notify({
    icon     : _icon(),
    subtitle : succesOptions.project,
    title    : logType + " <%= file.relative %>",
    message  : (file) => {

      let filepath = path.relative(process.cwd(), file.path);

      if (typeof succesOptions.exclusions !== 'undefined' && filepath.includes(succesOptions.exclusions)) {
        return false;
      } else {
        log(logType, filepath, message);
      }

      if (first == false) { return false; }
      first = false;

      if ( options.popups ) {
        return message;
      }
    }
  });
}
153503
def message(self, text):
        """"""
        line = 0
        # Iterate through each character.
        for char in text:
            # Advance to next line if character is a new line.
            if char == '\n':
                line += 1
                # Move to left or right side depending on text direction.
                col = 0 if self.displaymode & LCD_ENTRYLEFT > 0 else self._cols-1
                self.set_cursor(col, line)
            # Write the character to the display.
            else:
                self.write8(ord(char), True)
1295944
def add_success(self, group=None, type_='', field='', description=''):
        """"""
        group = group or '(200)'
        group = int(group.lower()[1:-1])
        self.retcode = self.retcode or group
        if group != self.retcode:
            raise ValueError('Two or more retcodes!')
        type_ = type_ or '{String}'
        p = Param(type_, field, description)
        self.params['responce'][p.field] = p
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')
1179630
def submit_btn(self, value, success=None):
        """"""
        self.press("css=input[value='{}']".format(value))
        if success is not None:
            assert self.is_available(*success)
410642
def underline(self, msg):
        """"""
        return click.style(msg, underline=True) if self.colorize else msg
596636
def success(request, message, extra_tags='', fail_silently=False):
    """"""
    add_message(request, constants.SUCCESS, message, extra_tags=extra_tags,
                fail_silently=fail_silently)
1255379
def success(self):
        """"""
        self._check_valid()
        return self._problem._p.get_status() == qsoptex.SolutionStatus.OPTIMAL
747189
function composeColoredMessage(color, label, message) {
        if (typeof message !== 'string') {
            message = JSON.stringify(message);
        }

        return color + label + ': ' + reset + message;
    }
521300
protected function _process()
	{
		$this->_msg( 'Adding product text performance data', 0 );


		$attribute = array(
			'plain', 'checked', 'striped', 'curled', 'colored', 'bubbled', 'geometric', 'quilted', 'pimpled', 'dotted',
			'light', 'heavy', 'simple', 'clear', 'cool', 'thin', 'thick', 'airy', 'breezy', 'blowy',
			'dark', 'gloomy', 'shiny', 'big', 'tight', 'alpaca', 'horsehair', 'viscose', 'polyester', 'mohair',
			'brocade', 'chiffon', 'cotton', 'damask', 'denim', 'flannel', 'jersey', 'satin', 'seersucker', 'tweed',
			'linen', 'satin', 'silk', 'sheen', 'velvet', 'wool', 'sisal', 'jute', 'angora', 'cashmere',
		);
		$articles = array(
			'shirt', 'skirt', 'jacket', 'pants', 'socks', 'blouse', 'slip', 'sweater', 'dress', 'top',
			'anorak', 'babydoll', 'swimsuit', 'trunks', 'bathrobe', 'beret', 'bra', 'bikini', 'blazer', 'bodysuit',
			'bolero', 'bowler', 'trousers', 'bustier', 'cape', 'catsuit', 'chucks', 'corduroys', 'corsage', 'cutaway',
			'lingerie', 'tricorn', 'bow tie', 'tails', 'leggings', 'galoshes', 'string', 'belt', 'hotpants', 'hat',
			'jumpsuit', 'jumper', 'caftan', 'hood', 'kimono', 'headscarf', 'scarf', 'corset', 'costume', 'tie',
			'cummerbund', 'robe', 'underpants', 'dungarees', 'undershirt', 'camisole', 'mantle', 'bodice', 'topless', 'moonboots',
			'cap', 'nightie', 'negligee', 'overalls', 'parka', 'poncho', 'bloomers', 'pumps', 'pajamas', 'farthingale',
			'sari', 'veil', 'apron', 'swimsuit', 'shorts', 'tuxedo', 'stocking', 'suspender', 'tanga', 'tankini',
			'toga', 'tunic', 'turban', 'jerkin', 'coat', 'suit', 'vest', 'gloves', 'bag', 'briefcase',
			'shoes', 'sandals', 'flip-flops', 'ballerinas', 'slingbacks', 'clogs', 'moccasins', 'sneakers', 'boots', 'slippers',
		);
		$size = array(
			'',
			'(9XS)', '(8XS)', '(7XS)', '(6XS)', '(5XS)', '(4XS)', '(3XS)', '(2XS)', '(XS)', '(S)',
			'(SS-M)', '(S-M)', '(M)', '(M-L)', '(M-LL)',
			'(L)', '(XL)', '(2XL)', '(3XL)', '(4XL)', '(5XL)', '(6XL)', '(7XL)', '(8XL)', '(9XL)',
		);


		$context = $this->_getContext();
		$textManager = MShop_Factory::createManager( $context, 'text' );
		$attrManager = MShop_Factory::createManager( $context, 'attribute' );
		$productListManager = MShop_Factory::createManager( $context, 'product/list' );


		$attrSearch = $attrManager->createSearch();
		$attrSearch->setConditions( $attrSearch->compare( '==', 'attribute.type.code', 'color' ) );
		$attrSearch->setSlice( 0, 1000 );

		$attrIds = $attrManager->searchItems( $attrSearch );


		$textListItem = $this->_getProductListItem( 'text', 'default' );
		$textTypes = $this->_getTextTypeIds();

		$textItem = $textManager->createItem();
		$textItem->setLanguageId( 'en' );
		$textItem->setDomain( 'product' );
		$textItem->setStatus( 1 );


		$search = $productListManager->createSearch();
		$expr = array(
			$search->compare( '==', 'product.list.domain', 'attribute' ),
			$search->compare( '==', 'product.list.type.code', 'variant' ),
		);
		$search->setConditions( $search->combine( '&&', $expr ) );
		$search->setSortations( array( $search->sort( '+', 'product.list.id' ) ) );


		$this->_txBegin();

		$start = 0;

		do
		{
			$result = $productListManager->searchItems( $search );

			foreach ( $result as $listItem )
			{
				$refId = $listItem->getRefId();

				if( !isset( $attrIds[$refId] ) ) {
					continue;
				}

				$id = $listItem->getParentId();
				$text = $attrIds[$refId]->getName() . ' ' . current( $attribute ) . ' ' . current( $articles ) . ' ' . current( $size );


				$textItem->setId( null );
				$textItem->setTypeId( $textTypes['name'] );
				$textItem->setLabel( $text );
				$textItem->setContent( $text );
				$textManager->saveItem( $textItem );

				$textListItem->setId( null );
				$textListItem->setParentId( $id );
				$textListItem->setRefId( $textItem->getId() );
				$productListManager->saveItem( $textListItem, false );


				$textItem->setId( null );
				$textItem->setTypeId( $textTypes['short'] );
				$textItem->setLabel( 'Short ' . $text );
				$textItem->setContent( 'Short description for ' . $text );
				$textManager->saveItem( $textItem );

				$textListItem->setId( null );
				$textListItem->setParentId( $id );
				$textListItem->setRefId( $textItem->getId() );
				$productListManager->saveItem( $textListItem, false );


				$textItem->setId( null );
				$textItem->setTypeId( $textTypes['long'] );
				$textItem->setLabel( 'Long ' . $text );
				$textItem->setContent( 'Long description for ' . $text . '. This may include some "lorem ipsum" text' );
				$textManager->saveItem( $textItem );

				$textListItem->setId( null );
				$textListItem->setParentId( $id );
				$textListItem->setRefId( $textItem->getId() );
				$productListManager->saveItem( $textListItem, false );


				if( current( $attribute ) === false )
				{
					reset( $attribute );
					next( $articles );

					if( current( $articles ) === false ) {
						reset( $articles );
						next( $size );

						if( current( $size ) === false ) {
							reset( $size );
						}
					}
				}
			}

			$count = count( $result );
			$start += $count;
			$search->setSlice( $start );
		}
		while( $count == $search->getSliceSize() );

		$this->_txCommit();


		$this->_status( 'done' );
	}
572366
def build_message(self, stat, value):
        """"""
        return ' '.join((self.prefix + str(stat), str(value), str(round(time()))))
709181
def succeed(self, text=None):
        
        return self.stop_and_persist(symbol=LogSymbols.SUCCESS.value, text=text)