dm: Display message on keypad.
160301
def dm_encode(keypad_area, clear, beep, timeout, line1, line2):
    """"""
    return MessageEncode(
        '2Edm{:1d}{:1d}{:1d}{:05d}{:^<16.16}{:^<16.16}00'
        .format(keypad_area+1, clear, beep, timeout, line1, line2), None
    )
53040
def set_splash_message(self, text):
        """"""
        self.splash_text = text
        self._show_message(text)
        self.timer_ellipsis.start(500)
911801
def message(m, fd=sys.stdout):
    """"""

    if sys.platform == 'win32':
        decoding = sys.stdout.encoding if sys.version_info[0] > 2 else 'cp1252'
        click.echo(MaltegoMessage(message=m).render(fragment=True, encoding='utf-8').decode(decoding), file=fd)
    else:
        click.echo(MaltegoMessage(message=m).render(encoding='utf-8', fragment=True), file=fd)
    exit(0)
1230414
def help_message():
    """"""
    parser = autopep8.create_parser()
    string_io = io.StringIO()
    parser.print_help(string_io)
    # Undo home directory expansion.
    return string_io.getvalue().replace(os.path.expanduser('~'), '~')
375139
def _show(self, message, indent=0, enable_verbose=True):  # pragma: no cover
        
        if enable_verbose:
            print("    " * indent + message)
790637
def _on_message(self, _, msg):
        """"""
        result = json.loads(msg)
        if result["cmd"] == "chat":
            data = {"type": "message", "nick": result["nick"],
                    "text": result["text"]}
            if "trip" in result:
                data["trip"] = result["trip"]
            self._callback(self, data)
        elif result["cmd"] == "onlineSet":
            self._onlineUsers += result["nicks"]
        elif result["cmd"] == "onlineAdd":
            self._onlineUsers.append(result["nick"])
            self._callback(self, {"type": "online add",
                                 "nick": result["nick"]})
        elif result["cmd"] == "onlineRemove":
            self._onlineUsers.remove(result["nick"])
            self._callback(self, {"type": "online remove",
                                 "nick": result["nick"]})
        elif result["cmd"] == "info" and " invited " in result["text"]:
            if "You invited " in result["text"]:
                name = self._nick
            else:
                space = re.search(r"\s", result["text"])
                name = result["text"][:space.start()]
            link = re.search(r"\?", result["text"])
            channel = result["text"][link.end():]
            self._callback(self, {"type": "invite", "nick": name,
                                 "channel": channel})
        elif result["cmd"] == "info" and " IPs " in result["text"]:
            data = result["text"].split()
            self._callback(self, {"type": "stats", "IPs": data[0],
                                 "channels": data[4]})
        elif result["cmd"] == "info" and "Banned " in result["text"]:
            nick = result["text"][len("Banned "):]
            self._callback(self, {"type": "banned", "nick": nick})
        elif result["cmd"] == "info" and "Unbanned " in result["text"]:
            ip = result["text"][len("Unbanned "):]
            self._callback(self, {"type": "unbanned", "ip": ip})
        elif (result["cmd"] == "info"
              and "Server broadcast: " in result["text"]):
            txt = result["text"][len("Server broadcast: "):]
            self._callback(self, {"type": "broadcast", "text": txt})
        elif result["cmd"] == "info":
            self._callback(self, {"type": "list users",
                                 "text": result["text"]})
        elif result["cmd"] == "warn":
            data = {"type": "warn", "warning": result["text"]}
            if "Could not find " in result["text"]:
                data["warning"] = "user to ban not found"
                data["nick"] = result["text"][len("Could not find "):]
            self._callback(self, data)
1314941
function(message) {
      var key = "";
      if (message) {
        var x = message.level &&
        (key += message.level, message.kind &&
          (key += this.delimiter + message.kind, message.rule &&
            (key += this.delimiter + message.rule, message.values.title &&
              (key += this.delimiter + message.values.title))));
            }
            return (key) ? key : "";
          }
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),
        }
1153632
def OnText(self, event):
        """"""

        if not self.ignore_changes:
            post_command_event(self, self.CodeEntryMsg, code=event.GetString())

        self.main_window.grid.grid_renderer.cell_cache.clear()

        event.Skip()
319546
def do_direct_message(dm, opts = {})
      return if dm.sender.screen_name == $bot[:config][:screen_name]
      return do_callbacks(:direct_message, dm, opts) unless dm.text.start_with? $bot[:config][:dm_command_prefix]
      dm_text = dm.text.sub($bot[:config][:dm_command_prefix], '').strip
      return if dm_text.empty?

      return unless /(?<command>[A-Za-z0-9]+)(?:\s*)(?<args>.*)/m =~ dm_text
      command = Regexp.last_match(:command).to_sym
      args = Regexp.last_match :args

      cmd = $bot[:commands][command]
      return say_status :dm, "#{dm.sender.screen_name} tried to issue non-existent command :#{command}, ignoring", :cyan if cmd.nil?
      return say_status :dm, "#{dm.sender.screen_name} tried to issue admin command :#{command}, ignoring", :cyan if cmd[:admin] and !dm.sender.admin?

      say_status :dm, "#{dm.sender.screen_name} issued command :#{command}", :cyan
      cmd[:block].call(args, dm.sender)
    end
200208
def on_keydown_listener(self, widget, value, keycode):
        
        if keycode=="13":
            self.hide()
            self.inputText.set_text(value)
            self.confirm_value(self)
116446
public static void showMessageDialog(Component parent, String msg,
                                         String title, int flags) {
        if (msg.length() > 60) {
            StringBuilder buf = new StringBuilder();
            int len = msg.length();
            int j = 0;
            int i;
            for (i = 0; i < len; i++, j++) {
                char c = msg.charAt(i);
                buf.append(c);
                if (Character.isWhitespace(c)) {
                    int k;
                    for (k = i + 1; k < len; k++) {
                        if (Character.isWhitespace(msg.charAt(k))) {
                            break;
                        }
                    }
                    if (k < len) {
                        int nextWordLen = k - i;
                        if (j + nextWordLen > 60) {
                            buf.append('\n');
                            j = 0;
                        }
                    }
                }
            }
            msg = buf.toString();
        }
        JOptionPane.showMessageDialog(parent, msg, title, flags);
    }
602884
def show_message(self):
        """"""
        print(
            'current version: {current_version}\n'
            'latest version : {latest_version}'.format(
                current_version=self.current_version,
                latest_version=self.latest_version))
1347422
def confirm(text='', title='', buttons=['OK', 'Cancel']):
    """"""
    retVal = messageBoxFunc(0, text, title, MB_OKCANCEL | MB_ICONQUESTION | MB_SETFOREGROUND | MB_TOPMOST)
    if retVal == 1 or len(buttons) == 1:
        return buttons[0]
    elif retVal == 2:
        return buttons[1]
    else:
        assert False, 'Unexpected return value from MessageBox: %s' % (retVal)
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)
421845
def show_messages(self):
        """"""
        string = self.header
        if self.static_message is not None:
            string += self.static_message.to_html()

        for message in self.dynamic_messages:
            string += message.to_html()

        string += self.footer
        print(string)
        self.setHtml(string)
1150674
def printWelcomeMessage(msg, place=10):
    '''  '''
    logging.debug('*' * 30)
    welcome = ' ' * place
    welcome+= msg
    logging.debug(welcome)

    logging.debug('*' * 30 + '\n')