当前位置: 首页>>代码示例>>Python>>正文


Python weechat.config_set_desc_plugin函数代码示例

本文整理汇总了Python中weechat.config_set_desc_plugin函数的典型用法代码示例。如果您正苦于以下问题:Python config_set_desc_plugin函数的具体用法?Python config_set_desc_plugin怎么用?Python config_set_desc_plugin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了config_set_desc_plugin函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: go_main

def go_main():
    """Entry point."""
    if not weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION,
                            SCRIPT_LICENSE, SCRIPT_DESC,
                            'go_unload_script', ''):
        return
    weechat.hook_command(
        SCRIPT_COMMAND,
        'Quick jump to buffers', '[term(s)]',
        'term(s): directly jump to buffer matching the provided term(s) single'
        'or space dilimited list (without argument, list is displayed)\n\n'
        'You can bind command to a key, for example:\n'
        '  /key bind meta-g /go\n\n'
        'You can use completion key (commonly Tab and shift-Tab) to select '
        'next/previous buffer in list.',
        '%(buffers_names)',
        'go_cmd', '')

    # set default settings
    version = weechat.info_get('version_number', '') or 0
    for option, value in SETTINGS.items():
        if not weechat.config_is_set_plugin(option):
            weechat.config_set_plugin(option, value[0])
        if int(version) >= 0x00030500:
            weechat.config_set_desc_plugin(
                option, '%s (default: "%s")' % (value[1], value[0]))
    weechat.hook_info('go_running',
                      'Return "1" if go is running, otherwise "0"',
                      '',
                      'go_info_running', '')
开发者ID:gilbertw1,项目名称:scripts,代码行数:30,代码来源:go.py

示例2: init_options

def init_options():
    for option,value in OPTIONS.items():
        if not weechat.config_get_plugin(option):
          weechat.config_set_plugin(option, value[0])
        else:
            OPTIONS[option] = weechat.config_get_plugin(option)
        weechat.config_set_desc_plugin(option, '%s (default: "%s")' % (value[1], value[0]))
开发者ID:norrs,项目名称:weechat-plugins,代码行数:7,代码来源:logsize.py

示例3: main

def main():
    if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE, SCRIPT_DESC, "", ""):
        version = int(weechat.info_get("version_number", "")) or 0

        # unset unused setting from older versions of script
        if weechat.config_is_set_plugin("display_unit"):
            weechat.prnt("", "Option plugins.var.python.bandwidth.display_unit no longer used, removing.")
            weechat.config_unset_plugin("display_unit")

        # set default settings
        for option in SCRIPT_SETTINGS.iterkeys():
            if not weechat.config_is_set_plugin(option):
                weechat.config_set_plugin(option, SCRIPT_SETTINGS[option][0])
            if version >= 0x00030500:
                weechat.config_set_desc_plugin(option, SCRIPT_SETTINGS[option][1])

        # ensure sane refresh_rate setting
        if int(weechat.config_get_plugin("refresh_rate")) < 1:
            weechat.prnt(
                "",
                "{}Invalid value for option plugins.var.python.bandwidth.refresh_rate, setting to default of {}".format(
                    weechat.prefix("error"), SCRIPT_SETTINGS["refresh_rate"][0]
                ),
            )
            weechat.config_set_plugin("refresh_rate", SCRIPT_SETTINGS["refresh_rate"][0])

        # create the bandwidth monitor bar item
        weechat.bar_item_new("bandwidth", "bandwidth_item_cb", "")
        # update it every plugins.var.python.bandwidth.refresh_rate seconds
        weechat.hook_timer(int(weechat.config_get_plugin("refresh_rate")) * 1000, 0, 0, "bandwidth_timer_cb", "")
开发者ID:Shrews,项目名称:scripts,代码行数:30,代码来源:bandwidth.py

示例4: init_options

def init_options():
    for option,value in list(OPTIONS.items()):
        if not weechat.config_is_set_plugin(option):
            weechat.config_set_plugin(option, value[0])
            OPTIONS[option] = value[0]
        else:
            OPTIONS[option] = weechat.config_get_plugin(option)
        weechat.config_set_desc_plugin(option, "%s (default: '%s')" % (value[1], value[0]))
开发者ID:weechatter,项目名称:weechat-scripts,代码行数:8,代码来源:bufsize.py

示例5: init_options

def init_options():
  for option,value in OPTIONS.items():
    if not weechat.config_is_set_plugin(option):
      weechat.config_set_plugin(option, value[0])
      toggle_refresh(None, 'plugins.var.python.' + SCRIPT_NAME + '.' + option, value[0])
    else:
      toggle_refresh(None, 'plugins.var.python.' + SCRIPT_NAME + '.' + option, weechat.config_get_plugin(option))
    weechat.config_set_desc_plugin(option, '%s (default: "%s")' % (value[1], value[0]))
开发者ID:DarkDefender,项目名称:scripts,代码行数:8,代码来源:shutup.py

示例6: lb_set_default_settings

def lb_set_default_settings():
  global lb_settings
  # Set default settings
  for option, default_value, description in lb_settings:
     if not weechat.config_is_set_plugin(option):
         weechat.config_set_plugin(option, default_value)
         version = weechat.info_get("version_number", "") or 0
         if int(version) >= 0x00030500:
             weechat.config_set_desc_plugin(option, description)
开发者ID:norrs,项目名称:weechat-plugins,代码行数:9,代码来源:listbuffer.py

示例7: init_options

def init_options():
    global HOOK,OPTIONS
    for option,value in list(OPTIONS.items()):
        weechat.config_set_desc_plugin(option, '%s (default: "%s")' % (value[1], value[0]))
        if not weechat.config_is_set_plugin(option):
            weechat.config_set_plugin(option, value[0])
            OPTIONS[option] = value[0]
        else:
            OPTIONS[option] = weechat.config_get_plugin(option)
开发者ID:DarkDefender,项目名称:scripts,代码行数:9,代码来源:keepnick.py

示例8: init_options

def init_options():
    for option,value in list(OPTIONS.items()):
        if int(version) >= 0x00030500:
            weechat.config_set_desc_plugin(option, '%s (default: "%s")' % (value[1], value[0]))
        if not weechat.config_is_set_plugin(option):
            weechat.config_set_plugin(option, value[0])
            OPTIONS[option] = value[0]
        else:
            OPTIONS[option] = weechat.config_get_plugin(option)
开发者ID:Ratler,项目名称:weechatter-weechat-scripts,代码行数:9,代码来源:newscript.py

示例9: init_settings

def init_settings():
    # Setup default options for pushover
    for option, (default, desc) in default_settings.iteritems():
        if not weechat.config_is_set_plugin(option):
            weechat.config_set_plugin(option, default)
            weechat.config_set_desc_plugin(option, desc)
    for option in required_settings:
        if weechat.config_get_plugin(option) == "":
            weechat.prnt("", "pushover: Please set option: %s" % option)
            weechat.prnt("", "pushover: /set plugins.var.python.pushover.%s STRING" % option)
开发者ID:dickoff,项目名称:weechat-pushover,代码行数:10,代码来源:pushover.py

示例10: init_options

def init_options():
    for option, value in OPTIONS.items():
        if not weechat.config_is_set_plugin(option):
            weechat.config_set_plugin(option, value[0])
            sync_with_options(None, "plugins.var.python." + SCRIPT_NAME + "." + option, value[0])
        else:
            sync_with_options(
                None, "plugins.var.python." + SCRIPT_NAME + "." + option, weechat.config_get_plugin(option)
            )
        weechat.config_set_desc_plugin(option, '%s (default: "%s")' % (value[1], value[0]))
开发者ID:Raimondi,项目名称:weechat_scripts,代码行数:10,代码来源:seamless.py

示例11: init_config

def init_config():
    global tc_default_options, tc_options

    for option,value in list(tc_default_options.items()):
        w.config_set_desc_plugin(option, '%s (default: "%s")' % (value[1], value[0]))
        if not w.config_is_set_plugin(option):
            w.config_set_plugin(option, value[0])
            tc_options[option] = value[0]
        else:
            tc_options[option] = w.config_get_plugin(option)
开发者ID:MatthewCox,项目名称:dotfiles,代码行数:10,代码来源:typing_counter.py

示例12: init_config

def init_config():
    for option, (default_value, description) in SW_CONFIG_DEFAULTS.items():
        if not weechat.config_is_set_plugin(option):
            weechat.config_set_plugin(option, default_value)
            sw_config[option] = default_value
        else:
            sw_config[option] = weechat.config_get_plugin(option)
        weechat.config_set_desc_plugin(option, '%s (default: "%s")' % (description, default_value))

    weechat.hook_config('plugins.var.python.' + SCRIPT_NAME + '.*', 'update_config', '')
开发者ID:Shrews,项目名称:scripts,代码行数:10,代码来源:stick_buffer.py

示例13: nameday_load_config

def nameday_load_config():
    global nameday_settings_default, nameday_settings
    version = weechat.info_get('version_number', '') or 0
    for option, value in nameday_settings_default.items():
        if weechat.config_is_set_plugin(option):
            nameday_settings[option] = weechat.config_get_plugin(option)
        else:
            weechat.config_set_plugin(option, value[0])
            nameday_settings[option] = value[0]
        if int(version) >= 0x00030500:
            weechat.config_set_desc_plugin(option, value[1])
开发者ID:DarkDefender,项目名称:scripts,代码行数:11,代码来源:nameday.py

示例14: url_olde_load_config

def url_olde_load_config():
    global url_olde_settings_default, url_olde_settings
    version = w.info_get('version_number', '') or 0
    for option, value in url_olde_settings_default.items():
        if w.config_is_set_plugin(option):
            url_olde_settings[option] = w.config_get_plugin(option)
        else:
            w.config_set_plugin(option, value[0])
            url_olde_settings[option] = value[0]
        if int(version) >= 0x00030500:
            w.config_set_desc_plugin(option, value[1])
开发者ID:DarkDefender,项目名称:scripts,代码行数:11,代码来源:url_olde.py

示例15: cs_set_default_settings

def cs_set_default_settings():
  global OPTIONS

  # Set default settings
  for option,value in OPTIONS.items():
    if not weechat.config_is_set_plugin(option):
        weechat.config_set_plugin(option, value[0])
        OPTIONS[option] = value[0]
    else:
        OPTIONS[option] = weechat.config_get_plugin(option)
    weechat.config_set_desc_plugin(option, '%s (default: "%s")' % (value[1], value[0]))
开发者ID:DarkDefender,项目名称:scripts,代码行数:11,代码来源:clone_scanner.py


注:本文中的weechat.config_set_desc_plugin函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。