Python help message

30 Python code examples are found related to " help message". You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.
Example 1
Source File: game_handler.py    From python-zulip-api with Apache License 2.0 6 votes vote down vote up
def help_message(self) -> str:
        return '''** {} Bot Help:**
*Preface all commands with @**{}***
* To start a game in a stream (*recommended*), type
`start game`
* To start a game against another player, type
`start game with @<player-name>`{}
* To play game with the current number of players, type
`play game`
* To quit a game at any time, type
`quit`
* To end a game with a draw, type
`draw`
* To forfeit a game, type
`forfeit`
* To see the leaderboard, type
`leaderboard`
* To withdraw an invitation, type
`cancel game`
* To see rules of this game, type
`rules`
{}'''.format(self.game_name, self.get_bot_username(), self.play_with_computer_help(), self.move_help_message) 
Example 2
Source File: alexa.py    From kanzi with MIT License 6 votes vote down vote up
def prepare_help_message(kodi):
  sample_utterances = get_help_samples()

  response_text = render_template('help', example=sample_utterances.popitem()[1]).encode('utf-8')
  reprompt_text = render_template('help_short', example=sample_utterances.popitem()[1]).encode('utf-8')
  card_title = render_template('help_card').encode('utf-8')
  samples = ''
  for sample in sample_utterances.values():
    samples += '"%s"\n' % (sample)
  card_text = render_template('help_text', examples=samples).encode('utf-8')
  log.info(card_title)

  if not 'queries_keep_open' in session.attributes:
    return statement(response_text).simple_card(card_title, card_text)

  return question(response_text).reprompt(reprompt_text).simple_card(card_title, card_text)


# No intents invoked 
Example 3
Source File: clai_message_builder.py    From clai with MIT License 6 votes vote down vote up
def create_message_help() -> Action:
    text = Colorize().info() \
        .append("CLAI usage:\n"
                "clai [help] [skills [-v]] [orchestrate [name]] [activate [skill_name]] [deactivate [skill_name]] "
                "[manual | automatic] [install [name | url]] \n\n"
                "help           Print help and usage of clai.\n"
                "skills         List available skills. Use -v For a verbose description of each skill.\n"
                "orchestrate    Activate the orchestrator by name. If name is empty, list available orchestrators.\n"
                "activate       Activate the named skill.\n"
                "deactivate     Deactivate the named skill.\n"
                "manual         Disables automatic execution of commands without operator confirmation.\n"
                "auto           Enables automatic execution of commands without operator confirmation.\n"
                "install        Installs a new skill. The required argument may be a local file path\n"
                "               to a skill plugin folder, or it may be a URL to install a skill plugin \n"
                "               over a network connection.\n"
                ) \
        .to_console()

    return Action(
        suggested_command=':',
        description=text,
        execute=True
    ) 
Example 4
Source File: keys.py    From chia-blockchain with Apache License 2.0 6 votes vote down vote up
def help_message():
    print("usage: chia keys command")
    print(f"command can be any of {command_list}")
    print("")
    print(f"chia keys generate  (generates and adds a key to keychain)")
    print(f"chia keys generate_and_print  (generates but does NOT add to keychain)")
    print(f"chia keys show (displays all the keys in keychain)")
    print(f"chia keys add_seed -m [24 words] (add a private key through the mnemonic)")
    print(f"chia keys add -k [extended key] (add an extended private key in hex form)")
    print(
        f"chia keys add_not_extended -k [key] (add a not extended private key in hex form)"
    )
    print(
        f"chia keys delete -f [fingerprint] (delete a key by it's pk fingerprint in hex form)"
    )
    print(f"chia keys delete_all (delete all private keys in keychain)") 
Example 5
Source File: Learned_BTree.py    From Learned-Indexes with MIT License 6 votes vote down vote up
def show_help_message(msg):
    help_message = {'command': 'python Learned_BTree.py -t <Type> -d <Distribution> [-p|-n] [Percent]|[Number] [-c] [New data] [-h]',
                    'type': 'Type: sample, full',
                    'distribution': 'Distribution: random, exponential',
                    'percent': 'Percent: 0.1-1.0, default value = 0.5; sample train data size = 300,000',
                    'number': 'Number: 10,000-1,000,000, default value = 300,000',
                    'new data': 'New Data: INTEGER, 0 for no creating new data file, others for creating, default = 1',
                    'fpError': 'Percent cannot be assigned in full train.',
                    'snError': 'Number cannot be assigned in sample train.',
                    'noTypeError': 'Please choose the type first.',
                    'noDistributionError': 'Please choose the distribution first.'}
    help_message_key = ['command', 'type', 'distribution', 'percent', 'number', 'new data']
    if msg == 'all':
        for k in help_message_key:
            print(help_message[k])

    else:
        print(help_message['command'])
        print('Error! ' + help_message[msg])

# command line 
Example 6
Source File: help.py    From xiaomi_uranus_chatbot with GNU General Public License v3.0 5 votes vote down vote up
def help_main_message(locale):
    """ Generate telegram message of help command """
    message = LOCALIZE.get_text(locale, "help_message").replace(
        "{BOT_INFO['name']}", BOT_INFO['name']).replace(
        "{BOT_INFO['username']}", BOT_INFO['username']
    ).replace("{XFU_WEBSITE}", XFU_WEBSITE)
    buttons = [
        [Button.inline(LOCALIZE.get_text(locale, "Subscriptions"),
                       data="subscriptions_help"),
         Button.inline(LOCALIZE.get_text(locale, "preferred_device"),
                       data="preferred_device_help")],
        [Button.inline(LOCALIZE.get_text(locale, "miui_updates"),
                       data="miui_help"),
         Button.inline(LOCALIZE.get_text(locale, "Firmware"),
                       data="firmware_help")],
        [Button.inline(LOCALIZE.get_text(locale, "Vendor"),
                       data="vendor_help"),
         Button.inline(LOCALIZE.get_text(locale, "xiaomi_eu"),
                       data="eu_help")],
        [Button.inline(LOCALIZE.get_text(locale, "custom_recovery"),
                       data="custom_recovery_help"),
         Button.inline(LOCALIZE.get_text(locale, "devices_specs"),
                       data="specs_help")],
        [Button.inline(LOCALIZE.get_text(locale, "devices_info"),
                       data="info_help"),
         Button.inline(LOCALIZE.get_text(locale, "Miscellaneous"),
                       data="misc_help")]
    ]
    return message, buttons 
Example 7
Source File: base.py    From code-review with Mozilla Public License 2.0 5 votes vote down vote up
def build_help_message(self, files):
        """
        An optional help message aimed at developers to reproduce the issues detection
        A list of relative paths with issues is specified to build a precise message
        By default it's empty (None)
        """ 
Example 8
Source File: views.py    From logtacts with MIT License 5 votes vote down vote up
def help_message():
    return (
        "Hello! I understand:\n"
        "'Add Jane Doe' to add Jane Doe as a contact\n"
        "'Met Jane Doe' to log that you met Jane Doe\n"
        "'Find Jane Doe' to search for Jane in your contacts"
    ) 
Example 9
Source File: __main__.py    From ppci with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def print_help_message():
    print("Welcome to PPCI command line!")
    print()
    print("Please use one of the subcommands below:")
    for cmd in valid_programs:
        print("  $ python -m ppci {} -h".format(cmd))
    print() 
Example 10
Source File: command_line.py    From pheweb with GNU Affero General Public License v3.0 5 votes vote down vote up
def print_help_message():
    from pheweb import version
    print('''\
PheWeb {}

To see more information about a subcommand, run that command followed by `-h`.

Subcommands:

    pheweb phenolist
        prepare a list of phenotypes

    pheweb process
        once a phenolist has been prepared, load all data to be ready to run the server.

    pheweb serve
        host a webserver

    pheweb wsgi
        make wsgi.py, which can be used with gunicorn or other WSGI-compatible webservers.

    pheweb top-hits
        make top-hits.tsv, which contains variants that:
            - have a p-value < 10^-6
            - have a better p-value than every variant within 500kb in the same phenotype.

    pheweb top-loci
        make top-loci.tsv, which contains variants that:
            - have a p-value < 10^-6
            - have a better p-value than every variant within 500kb
            - have a better p-value than every variant within 1Mb in the same phenotype.

    pheweb conf key=value ... <subcommand> <arg>...
        run `pheweb <subcommand> <arg>...` with some configuration changed, overriding values in config.py
'''.format(version.version)) 
Example 11
Source File: view_helpers.py    From django-htk with MIT License 5 votes vote down vote up
def get_resend_confirmation_help_message(resend_confirmation_url_name, email=None):
    query_params = {
        'email' : email,
    }
    resend_confirmation_url = reverse_with_query_params(resend_confirmation_url_name, query_params)
    msg = 'Have you confirmed your email address yet? <a id="resend_confirmation" href="%s">Request another confirmation email</a>.' % resend_confirmation_url
    return mark_safe(msg) 
Example 12
Source File: cityscapesViewer.py    From Detectron-PYTORCH with Apache License 2.0 5 votes vote down vote up
def displayHelpMessage(self):

        message = self.applicationTitle + "\n\n"
        message += "INSTRUCTIONS\n"
        message += " - select a city from drop-down menu\n"
        message += " - browse images and labels using\n"
        message += "   the toolbar buttons or the controls below\n"
        message += "\n"
        message += "CONTROLS\n"
        message += " - select city [o]\n"
        message += " - highlight objects [move mouse]\n"
        message += " - next image [left arrow]\n"
        message += " - previous image [right arrow]\n"
        message += " - toggle autoplay [space]\n"
        message += " - increase/decrease label transparency\n"
        message += "   [ctrl+mousewheel] or [+ / -]\n"
        if self.enableDisparity:
            message += " - show disparity/depth overlay (if available) [d]\n"

        message += " - open zoom window [z]\n"
        message += "       zoom in/out [mousewheel]\n"
        message += "       enlarge/shrink zoom window [shift+mousewheel]\n"
        message += " - select a specific image [i]\n"
        message += " - show path to image below [f]\n"
        message += " - exit viewer [esc]\n"

        QtWidgets.QMessageBox.about(self, "HELP!", message)
        self.update()

    # Decrease label transparency 
Example 13
Source File: game_handler.py    From python-zulip-api with Apache License 2.0 5 votes vote down vote up
def help_message_single_player(self) -> str:
        return '''** {} Bot Help:**
*Preface all commands with @**{}***
* To start a game in a stream, type
`start game`
* To quit a game at any time, type
`quit`
* To see rules of this game, type
`rules`
{}'''.format(self.game_name, self.get_bot_username(), self.move_help_message) 
Example 14
Source File: morsecode.py    From introduction_to_python_TEAMLAB_MOOC with MIT License 5 votes vote down vote up
def get_help_message():
    message = "HELP - International Morse Code List\n"
    morse_code = get_morse_code_dict()

    counter = 0

    for key in sorted(morse_code):
        counter += 1
        message += "%s: %s\t" % (key, morse_code[key])
        if counter % 5 == 0:
            message += "\n"

    return message 
Example 15
Source File: cityscapesViewer.py    From TFSegmentation with Apache License 2.0 5 votes vote down vote up
def displayHelpMessage(self):

        message = self.applicationTitle + "\n\n"
        message += "INSTRUCTIONS\n"
        message += " - select a city from drop-down menu\n"
        message += " - browse images and labels using\n"
        message += "   the toolbar buttons or the controls below\n"
        message += "\n"
        message += "CONTROLS\n"
        message += " - select city [o]\n"
        message += " - highlight objects [move mouse]\n"
        message += " - next image [left arrow]\n"
        message += " - previous image [right arrow]\n"
        message += " - toggle autoplay [space]\n"
        message += " - increase/decrease label transparency\n"
        message += "   [ctrl+mousewheel] or [+ / -]\n"
        if self.enableDisparity:
            message += " - show disparity/depth overlay (if available) [d]\n"

        message += " - open zoom window [z]\n"
        message += "       zoom in/out [mousewheel]\n"
        message += "       enlarge/shrink zoom window [shift+mousewheel]\n"
        message += " - select a specific image [i]\n"
        message += " - show path to image below [f]\n"
        message += " - exit viewer [esc]\n"

        QtGui.QMessageBox.about(self, "HELP!", message)
        self.update()


    # Decrease label transparency 
Example 16
Source File: HighSeasGlobals.py    From Pirates-Online-Rewritten with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def getInboundHelpMessage():
    global LAST_INBOUND_HELP
    choiceList = VO_DICT[VO_CHOICE]['ShipInboundHelp']
    messageChoice = random.choice(choiceList)
    while messageChoice == LAST_INBOUND_HELP and len(choiceList) > 1:
        messageChoice = random.choice(choiceList)

    LAST_INBOUND_HELP = messageChoice
    return messageChoice 
Example 17
Source File: parse_help.py    From commcare-cloud with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def get_filtered_help_message(self, exclude_args):
        exclude_section_numbers = {self.section_index[arg_name]
                                   for arg_name in exclude_args}

        def yield_lines():
            for i, section in enumerate(self.sections):
                if i not in exclude_section_numbers:
                    for line in section:
                        yield line

        return '\n'.join(yield_lines()) 
Example 18
Source File: help.py    From tidb-ansible with Apache License 2.0 5 votes vote down vote up
def print_help_message(self):
        self._display.display("Ask TiDB User Group for help:", color=C.COLOR_WARN)
        self._display.display(
            "It seems that you have encountered some problem. Please describe your operation steps and provide error information as much as possible on https://asktug.com (in Chinese) or https://stackoverflow.com/questions/tagged/tidb (in English). We will do our best to help solve your problem. Thanks. :-)",
            color=C.COLOR_WARN) 
Example 19
Source File: ln2sql.py    From ln2sqlmodule with GNU General Public License v3.0 5 votes vote down vote up
def print_help_message():
    if settings.DEBUG :
        print '\n'
        print 'Usage:'
        print '\tpython ln2sql.py -d <path> -l <path> -i <input-sentence> [-t <path>] [-j <path>]'
        print 'Parameters:'
        print '\t-h\t\t\tprint this help message'
        print '\t-d <path>\t\tpath to SQL dump file'
        print '\t-l <path>\t\tpath to language configuration file'
        print '\t-i <input-sentence>\tinput sentence to parse'
        print '\t-j <path>\t\tpath to JSON output file'
        print '\t-t <path>\t\tpath to thesaurus file'
        print '\n' 
Example 20
Source File: messenger.py    From starter-python-bot with MIT License 5 votes vote down vote up
def write_help_message(self, channel_id):
        bot_uid = self.clients.bot_user_id()
        txt = '{}\n{}\n{}\n{}'.format(
            "I'm your friendly Slack bot written in Python.  I'll *_respond_* to the following commands:",
            "> `hi <@" + bot_uid + ">` - I'll respond with a randomized greeting mentioning your user. :wave:",
            "> `<@" + bot_uid + "> joke` - I'll tell you one of my finest jokes, with a typing pause for effect. :laughing:",
            "> `<@" + bot_uid + "> attachment` - I'll demo a post with an attachment using the Web API. :paperclip:")
        self.send_message(channel_id, txt) 
Example 21
Source File: decorators.py    From botogram with MIT License 5 votes vote down vote up
def help_message_for(func):
    """The return of the decorated function will be the help message of the
    function provided as an argument."""
    def decorator(help_func):
        func._botogram_help_message = help_func
        return help_func
    return decorator 
Example 22
Source File: slack.py    From DeviceNanny with MIT License 5 votes vote down vote up
def help_message(device_name):
    """
    Sends a message to the device checkout slack channel that a device was taken
    without being checked out.
    :param device_name: Name of device taken
    """
    slack.chat.post_message(
        channel,
        "`{}` was taken without being checked out! Please remember to enter your name or ID "
        "after taking a device.".format(device_name),
        as_user=False,
        username="DeviceNanny")
    logging.debug("[slack][help_message] Help message sent.") 
Example 23
Source File: webexteamsbot.py    From webexteamsbot with MIT License 5 votes vote down vote up
def set_help_message(self, msg):
        """
        Configure the banner for the help message.
        Command list will be appended to this later.
        :return:
        """
        self.help_message = msg

    # *** Default Commands included in Bot 
Example 24
Source File: utils.py    From python-netsurv with MIT License 5 votes vote down vote up
def help_message(self, msgids):
        """Display help messages for the given message identifiers"""
        for msgid in msgids:
            try:
                for message_definition in self.get_message_definitions(msgid):
                    print(message_definition.format_help(checkerref=True))
                    print("")
            except UnknownMessageError as ex:
                print(ex)
                print("")
                continue 
Example 25
Source File: artBot.py    From IRCBots with MIT License 5 votes vote down vote up
def printHelpMessage(self):
        if self.painting:
            return

        self.msg(config['channel'], 'Please use one of the following commands:')
        self.msg(config['channel'], 'artBot, help: Ask me for help')
        self.msg(config['channel'], 'artBot, paint <tag>: Paint ASCII message by tag (random by default)')
        self.msg(config['channel'], 'artBot, list-tags: Lists all message tags for painting') 
Example 26
Source File: utils.py    From linter-pylama with MIT License 5 votes vote down vote up
def help_message(self, msgids):
        """display help messages for the given message identifiers"""
        for msgid in msgids:
            try:
                print(self.check_message_id(msgid).format_help(checkerref=True))
                print("")
            except UnknownMessageError as ex:
                print(ex)
                print("")
                continue 
Example 27
Source File: module_interpreter.py    From pysploit-framework with GNU General Public License v2.0 5 votes vote down vote up
def help_message(self):
        print('')
        print('Options:              Require:              Description:              Value:')
        print('--------              --------              ------------              ------')
        for opt,val in obtainer.options.items():
            print("{:23s}".format(opt)+''+'            '.join(val))
        print('')