本文整理汇总了Python中weechat.bar_item_new函数的典型用法代码示例。如果您正苦于以下问题:Python bar_item_new函数的具体用法?Python bar_item_new怎么用?Python bar_item_new使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bar_item_new函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: 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
示例2: toggle_refresh
def toggle_refresh(pointer, name, value):
option_name = name[len('plugins.var.python.' + SCRIPT_NAME + '.'):] # get optionname
# option was removed? remove bar_item from struct
if not weechat.config_get_plugin(option_name):
ptr_bar = weechat.bar_item_search(option_name)
if ptr_bar:
weechat.bar_item_remove(ptr_bar)
return weechat.WEECHAT_RC_OK
# check if option is new or changed
if not weechat.bar_item_search(option_name):
weechat.bar_item_new(option_name,'update_item',option_name)
weechat.bar_item_update(option_name)
return weechat.WEECHAT_RC_OK
开发者ID:alyptik,项目名称:scripts,代码行数:16,代码来源:text_item.py
示例3: main
def main():
if not init(): return
weechat.hook_command(SCRIPT_COMMAND,
SCRIPT_DESC,
"[cmd1 | cmd2]",
" cmd1: comand1\n"
" cmd2: command2\n",
"cmd1 example",
"bee_cmd", "")
weechat.bar_item_new(bar_item, "bee_item_cb", "");
weechat.bar_new(bar_name, "on", "0", "root", "", "top", "horizontal",
"vertical", "0", "0", "default", "default", "default", "0",
bar_item);
return
开发者ID:frumiousbandersnatch,项目名称:weechat-scripts,代码行数:16,代码来源:bee.py
示例4: create_bar_items
def create_bar_items():
ptr_infolist_option = weechat.infolist_get('option','','plugins.var.python.' + SCRIPT_NAME + '.*')
if not ptr_infolist_option:
return
while weechat.infolist_next(ptr_infolist_option):
option_full_name = weechat.infolist_string(ptr_infolist_option, 'full_name')
option_name = option_full_name[len('plugins.var.python.' + SCRIPT_NAME + '.'):] # get optionname
if weechat.bar_item_search(option_name):
weechat.bar_item_update(option_name)
else:
weechat.bar_item_new(option_name,'update_item',option_name)
weechat.bar_item_update(option_name)
weechat.infolist_free(ptr_infolist_option)
开发者ID:Adrian-Revk,项目名称:dotfiles,代码行数:17,代码来源:text_item.py
示例5: create_bar_items
def create_bar_items():
ptr_infolist_option = weechat.infolist_get("option", "", "plugins.var.python." + SCRIPT_NAME + ".*")
if not ptr_infolist_option:
return
while weechat.infolist_next(ptr_infolist_option):
option_full_name = weechat.infolist_string(ptr_infolist_option, "full_name")
option_name = option_full_name[len("plugins.var.python." + SCRIPT_NAME + ".") :] # get optionname
if weechat.bar_item_search(option_name):
weechat.bar_item_update(option_name)
else:
weechat.bar_item_new(option_name, "update_item", option_name)
weechat.bar_item_update(option_name)
weechat.infolist_free(ptr_infolist_option)
开发者ID:weechatter,项目名称:weechat-scripts,代码行数:17,代码来源:text_item.py
示例6: hook_timer
def hook_timer():
global hooks
hooks["timer"] = weechat.hook_timer(int(OPTIONS["refresh"]) * 1000, 0, 0, 'item_update', '')
hooks["bar_item"] = weechat.bar_item_new(SCRIPT_NAME, 'show_item','')
if hooks["timer"] == 0:
weechat.prnt('',"%s: can't enable %s, hook failed" % (weechat.prefix("error"), SCRIPT_NAME))
weechat.bar_item_remove(hooks["bar_item"])
hooks["bar_item"] = ""
return 0
weechat.bar_item_update(SCRIPT_NAME)
return 1
开发者ID:norrs,项目名称:weechat-plugins,代码行数:12,代码来源:logsize.py
示例7: toggle_refresh
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]))
def toggle_refresh(pointer, name, value):
global OPTIONS
option = name[len('plugins.var.python.' + SCRIPT_NAME + '.'):] # get optionname
OPTIONS[option] = value # save new value
return weechat.WEECHAT_RC_OK
# ================================[ main ]===============================
if __name__ == "__main__":
if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE, SCRIPT_DESC, '', ''):
version = weechat.info_get("version_number", "") or 0
# get weechat version (0.3.6) and store it
if int(version) >= 0x00030600:
# init options from your script
init_options()
# create a hook for your options
weechat.hook_config( 'plugins.var.python.' + SCRIPT_NAME + '.*', 'toggle_refresh', '' )
# create a new bar item (for scripts running on weechat >= 0.4.2 see script API for additional arguments)
bar_item = weechat.bar_item_new(SCRIPT_NAME, 'bar_item_cb','')
# create a hook with signal "buffer_switch" for your item
weechat.hook_signal("buffer_switch","update_cb","")
else:
weechat.prnt("","%s%s %s" % (weechat.prefix("error"),SCRIPT_NAME,": needs version 0.3.6 or higher"))
weechat.command("","/wait 1ms /python unload %s" % SCRIPT_NAME)
开发者ID:FiXato,项目名称:weechat-scripts,代码行数:30,代码来源:skeleton.py
示例8: it
# Show the command line when needed, hide it (and update vi_buffer since
# we'd be looking for keystrokes instead) otherwise.
if cmd_text != '':
weechat.command('', "/bar show vi_cmd")
weechat.bar_item_update("cmd_text")
else:
weechat.command('', "/bar hide vi_cmd")
if is_printing(signal_data, pressed_keys):
vi_buffer += signal_data
pressed_keys += signal_data
# Check for any matching bound keys.
weechat.hook_timer(1, 0, 1, "pressed_keys_check", '')
last_time = time.time()
# Clear the buffers after some time.
weechat.hook_timer(1000, 0, 1, "clear_vi_buffers", "check_time")
weechat.bar_item_update("vi_buffer")
return weechat.WEECHAT_RC_OK
weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE,
SCRIPT_DESC, '', '')
weechat.bar_item_new("mode_indicator", "mode_indicator_cb", '')
weechat.bar_item_new("cmd_text", "cmd_text_cb", '')
weechat.bar_item_new("vi_buffer", "vi_buffer_cb", '')
vi_cmd = weechat.bar_new("vi_cmd", "off", "0", "root", '', "bottom",
"vertical", "vertical", "0", "0", "default",
"default", "default", "0", "cmd_text")
weechat.hook_signal("key_pressed", "key_pressed_cb", '')
开发者ID:jnbek,项目名称:_weechat,代码行数:29,代码来源:vimode.py
示例9: cb_hats
# Bar items.
# ----------
def cb_hats(data, item, window):
buf = weechat.current_buffer()
plugin = weechat.buffer_get_string(buf, "localvar_plugin")
if plugin == "irc":
server = weechat.buffer_get_string(buf, "localvar_server")
channel = weechat.buffer_get_string(buf, "localvar_channel")
nick = weechat.buffer_get_string(buf, "localvar_nick")
nicks = weechat.infolist_get("irc_nick", "", "{},{},{}".format(
server, channel, nick))
weechat.infolist_next(nicks)
hats = weechat.infolist_string(nicks, "prefixes")
weechat.infolist_free(nicks)
return hats.replace(" ", "")
return ""
# Main script.
# ============
if __name__ == "__main__":
weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION,
SCRIPT_LICENSE, SCRIPT_DESC, "", "")
# Create bar items and setup hooks.
weechat.bar_item_new("hats", "cb_hats", "")
weechat.hook_print("", "irc_mode", "", 0, "cb_irc_mode", "")
weechat.hook_signal("buffer_switch", "cb_buffer_switch", "")
开发者ID:DarkDefender,项目名称:scripts,代码行数:29,代码来源:hatwidget.py
示例10: return
return (tm.tm_hour*3600+tm.tm_min*60+tm.tm_sec)/1000.0
def kiloseconds_cmd(data, buffer, args):
"""Callback for /ks command"""
weechat.command(buffer,"The current time is " + str(getKiloseconds()) + " ks")
return weechat.WEECHAT_RC_OK
def kiloseconds_cb(data, buffer, args):
"""Callback for the bar item"""
return "%06.3f" % getKiloseconds()
def kiloseconds_update(data,cals):
"""Update the bar item"""
weechat.bar_item_update('kiloseconds')
return weechat.WEECHAT_RC_OK
if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE,
SCRIPT_DESC, '', ''):
weechat.hook_command(SCRIPT_COMMAND,
"Display current time in kiloseconds",
"",
"Add 'kiloseconds' to any bar to have it show the time in kiloseconds.",
"",
"kiloseconds_cmd", "")
weechat.bar_item_new('kiloseconds', 'kiloseconds_cb', '')
weechat.hook_timer(1000,1,0,'kiloseconds_update','')
开发者ID:GunioRobot,项目名称:Kiloseconds,代码行数:29,代码来源:kiloseconds.py
示例11: config_changed
def config_changed(data, option, value):
init_config()
return w.WEECHAT_RC_OK
def tc_action_cb():
global tc_options
if tc_options['warn_command']:
if tc_options['warn_command'] == '$bell':
f = open('/dev/tty', 'w')
f.write('\a')
f.close()
else:
os.system(tc_options['warn_command'])
return w.WEECHAT_RC_OK
if __name__ == "__main__" and import_ok:
if w.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION,
SCRIPT_LICENSE, SCRIPT_DESC,
"", ""):
version = w.info_get("version_number", "") or 0
init_config() # read configuration
tc_bar_item_update() # update status bar display
w.hook_signal('input_text_changed', 'tc_bar_item_update', '')
w.hook_signal('input_text_cursor_moved','tc_bar_item_update','')
w.hook_command_run('/input move_previous_char','command_run_cb','')
w.hook_command_run('/input delete_previous_char','command_run_cb','')
w.hook_signal('buffer_switch','tc_bar_item_update','')
w.hook_config('plugins.var.python.' + SCRIPT_NAME + ".*", "config_changed", "")
w.bar_item_new('tc', 'tc_bar_item', '')
开发者ID:MatthewCox,项目名称:dotfiles,代码行数:30,代码来源:typing_counter.py
示例12: ircrypt_config_init
ircrypt_config_init()
ircrypt_config_read()
ircrypt_check_binary()
weechat.hook_modifier('irc_in_privmsg', 'ircrypt_decrypt_hook', '')
weechat.hook_modifier('irc_out_privmsg', 'ircrypt_encrypt_hook', '')
weechat.hook_command('ircrypt', 'Commands to manage IRCrypt options and execute IRCrypt commands',
'[list]'
'| set-key [-server <server>] <target> <key> '
'| remove-key [-server <server>] <target> '
'| set-cipher [-server <server>] <target> <cipher> '
'| remove-cipher [-server <server>] <target> '
'| plain [-server <server>] [-channel <channel>] <message>',
SCRIPT_HELP_TEXT,
'list || set-key %(irc_channel)|%(nicks)|-server %(irc_servers) %- '
'|| remove-key %(irc_channel)|%(nicks)|-server %(irc_servers) %- '
'|| set-cipher %(irc_channel)|-server %(irc_servers) %- '
'|| remove-cipher |%(irc_channel)|-server %(irc_servers) %- '
'|| plain |-channel %(irc_channel)|-server %(irc_servers) %-',
'ircrypt_command', '')
weechat.bar_item_new('ircrypt', 'ircrypt_encryption_statusbar', '')
weechat.hook_signal('ircrypt_buffer_opened', 'update_encryption_status', '')
def ircrypt_unload_script():
'''Hook to ensure the configuration is properly written to disk when the
script is unloaded.
'''
ircrypt_config_write()
return weechat.WEECHAT_RC_OK
开发者ID:petvoigt,项目名称:ircrypt-weechat,代码行数:30,代码来源:ircrypt.py
示例13: SearchList
servers = SearchList()
for token in slack_api_token.split(','):
servers.append(SlackServer(token))
channels = Meta('channels', servers)
users = Meta('users', servers)
w.hook_config("plugins.var.python." + SCRIPT_NAME + ".*", "config_changed_cb", "")
w.hook_timer(10, 0, 0, "async_queue_cb", "")
w.hook_timer(6000, 0, 0, "slack_connection_persistence_cb", "")
### attach to the weechat hooks we need
w.hook_timer(1000, 0, 0, "typing_update_cb", "")
w.hook_timer(1000, 0, 0, "buffer_list_update_cb", "")
w.hook_timer(1000, 0, 0, "hotlist_cache_update_cb", "")
w.hook_timer(1000 * 3, 0, 0, "slack_never_away_cb", "")
w.hook_timer(1000 * 60* 29, 0, 0, "slack_never_away_cb", "")
w.hook_signal('buffer_closing', "buffer_closing_cb", "")
w.hook_signal('buffer_switch', "buffer_switch_cb", "")
w.hook_signal('window_switch', "buffer_switch_cb", "")
w.hook_signal('input_text_changed', "typing_notification_cb", "")
w.hook_command('slack','Plugin to allow typing notification and sync of read markers for slack.com', 'stuff', 'stuff2', '|'.join(cmds.keys()), 'slack_command_cb', '')
w.hook_command('me','', 'stuff', 'stuff2', '', 'me_command_cb', '')
# w.hook_command('me', 'me_command_cb', '')
w.hook_command_run('/join', 'join_command_cb', '')
w.hook_command_run('/part', 'part_command_cb', '')
w.hook_command_run('/leave', 'part_command_cb', '')
w.bar_item_new('slack_typing_notice', 'typing_bar_item_cb', '')
### END attach to the weechat hooks we need
开发者ID:ishigoemon,项目名称:wee-slack,代码行数:29,代码来源:wee_slack.py
示例14: open
loadproc = open("/proc/loadavg")
load_data = loadproc.read().split(" ")
loadproc.close()
config_items = weechat.config_get_plugin("items")
first_load = load_data[0]
second_load = load_data[1]
third_load = load_data[2]
if config_items == "1":
return load_data[0]
if config_items == "5":
return load_data[1]
if config_items == "15":
return load_data[2]
if config_items == "all":
return "%s %s %s" % (load_data[0], load_data[1], load_data[2])
def load_timer(*args):
weechat.bar_item_update("load")
return weechat.WEECHAT_RC_OK
if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE, SCRIPT_DESC, "", ""):
for option, default_value in settings.iteritems():
if not weechat.config_is_set_plugin(option):
weechat.config_set_plugin(option, default_value)
weechat.bar_item_new("load", "load_item", "")
weechat.bar_item_update("load")
weechat.hook_timer(1000 * 20, 0, 0, "load_timer", "")
开发者ID:fbesser,项目名称:weechat_scripts,代码行数:30,代码来源:load_avg.py
示例15: int
VERSION = weechat.info_get("version_number", "")
if int(VERSION) < 0x01000000:
print_warning("Please upgrade to WeeChat ≥ 1.0.0. Previous versions" " are not supported.")
# Set up script options.
for option, value in vimode_settings.items():
if weechat.config_is_set_plugin(option):
vimode_settings[option] = weechat.config_get_plugin(option)
else:
weechat.config_set_plugin(option, value[0])
vimode_settings[option] = value[0]
weechat.config_set_desc_plugin(option, '%s (default: "%s")' % (value[1], value[0]))
# Warn the user about possible problems if necessary.
if not weechat.config_string_to_boolean(vimode_settings["no_warn"]):
check_warnings()
# Create bar items and setup hooks.
weechat.bar_item_new("mode_indicator", "cb_mode_indicator", "")
weechat.bar_item_new("cmd_text", "cb_cmd_text", "")
weechat.bar_item_new("vi_buffer", "cb_vi_buffer", "")
weechat.bar_item_new("line_numbers", "cb_line_numbers", "")
weechat.bar_new(
"vi_cmd",
"off",
"0",
"root",
"",
"bottom",
"vertical",
"vertical",
"0",
"0",
"default",
开发者ID:tarruda,项目名称:dot-files,代码行数:31,代码来源:vimode.py
示例16: init_options
'Using "aspell.check.real_time" the nick-completion will not work, until all misspelled words in input_line are replaced.\n'
'\n'
'You can bind following commands to key:\n'
' /' + SCRIPT_NAME + ' : to cycle though next suggestion\n'
' /' + SCRIPT_NAME + ' previous : to cycle though previous suggestion\n'
' /' + SCRIPT_NAME + ' replace : to replace misspelled word\n'
'',
'previous|replace',
'auto_suggest_cmd_cb', '')
init_options()
weechat.hook_command_run('/input delete_*', 'input_delete_cb', '')
weechat.hook_command_run('/input move*', 'input_move_cb', '')
weechat.hook_signal ('input_text_changed', 'input_text_changed_cb', '')
# multiline workaround
weechat.hook_signal('input_flow_free', 'multiline_cb', '')
weechat.hook_signal ('aspell_suggest', 'aspell_suggest_cb', '')
weechat.hook_signal ('buffer_switch', 'buffer_switch_cb','')
weechat.hook_signal ('window_switch', 'window_switch_cb','')
if OPTIONS['catch_input_completion'].lower() == "on":
Hooks['catch_input_completion'] = weechat.hook_command_run('/input complete*', 'input_complete_cb', '')
Hooks['catch_input_return'] = weechat.hook_command_run('/input return', 'input_return_cb', '')
weechat.hook_config('plugins.var.python.' + SCRIPT_NAME + '.*', 'toggle_refresh', '')
weechat.bar_item_new('spell_correction', 'show_spell_correction_item_cb', '')
weechat.bar_item_new('spell_suggest', 'show_spell_suggestion_item_cb', '')
# weechat.prnt("","%s" % sys.version_info)
开发者ID:FiXato,项目名称:weechat-scripts,代码行数:30,代码来源:spell_correction.py
示例17:
last_i = cur_i
last_o = cur_o
if not last_i or not last_o:
return ""
i_unit = ""
o_unit = ""
if weechat.config_get_plugin("display_unit") == "on":
i_unit = "KiB/s"
o_unit = "KiB/s"
if i > 1023:
i = i / 1024
i_unit = "MiB/s"
if o > 1023:
o = o / 1024
o_unit = "MiB/s"
return "i: %(in)d %(i_unit)s, o: %(out)d %(o_unit)s" % {"in": i, "out": o, "i_unit": i_unit, "o_unit": o_unit}
if __name__ == "__main__" and import_ok:
if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE, SCRIPT_DESC, "", ""):
# set default settings
for option, default_value in bandwidth_settings.iteritems():
if not weechat.config_is_set_plugin(option):
weechat.config_set_plugin(option, default_value)
# new item
weechat.bar_item_new("bandwidth", "bandwidth_item_cb", "")
weechat.hook_timer(int(weechat.config_get_plugin("refresh_rate")) * 1000, 0, 0, "bandwidth_timer_cb", "")
开发者ID:sitaktif,项目名称:weechat-scripts,代码行数:30,代码来源:bandwidth.py
示例18: which
if loaded:
# We want to highlight on our screen_name.
user = twitter.api.me()
# Find timelined
timelined = which(wc.config_get_plugin("timelined_location"))
if not timelined:
print_error(
"Couldn't find timelined, please set 'plugins.var.python.weetwit.timelined"
)
tl = timelined[0]
setup_timeline(tl, followed=followed)
bar_item = wc.bar_item_new('tweet_counter', 'tcounter_item_cb', '')
# Config change hook.
wc.hook_config("plugins.var.python." + SCRIPT_NAME + ".*",
"storage_cb", "")
# All commands
hook = wc.hook_command("tweet", "Updates your twitter status.",
"[tweet]",
"The text to update with (140 characters max).",
"",
"tweet_cb", "")
hook = wc.hook_command("tinfo", "Lookup info about a certain tweet.",
"[tweet id/@username]",
开发者ID:ainmosni,项目名称:weetwit,代码行数:30,代码来源:weetwit.py
示例19: open
weechat.hook_set(send_hook, 'stdin', proc_data)
else:
proc_data = email + '\n' + passwd + '\n' +\
weechat.config_get_plugin('poll_interval') + '\n'
recv_hook = weechat.hook_process_hashtable(weechat_dir + '/python/wtrecv.py',
{ 'stdin': '' }, 0, 'renderConversations', '')
weechat.hook_set(recv_hook, 'stdin', proc_data)
PIPE=-1
# register plugin
if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE, SCRIPT_DESC, "", "UTF-8"):
buffer = weechat.buffer_new("weeText", "gvOut", "", "buffer_close_cb", "")
weechat_dir = weechat.info_get("weechat_dir","")
key_dir = weechat.config_get_plugin("key_dir")
weechat.bar_item_new('encryption', 'encryption_statusbar', '')
for option, default_value in script_options.iteritems():
if not weechat.config_is_set_plugin(option):
weechat.config_set_plugin(option, default_value)
# get email/passwd and pass to other script
email=weechat.config_get_plugin('email')
passwd = weechat.config_get_plugin('passwd')
if re.search('sec.*data', passwd):
passwd=weechat.string_eval_expression(passwd, {}, {}, {})
# write the helper files
with open(weechat_dir + '/python/wtrecv.py', 'w') as f:
f.write("""#!/usr/bin/env python2
import sys
开发者ID:rxcomm,项目名称:weeText,代码行数:31,代码来源:weetext.py
示例20: int
python2_bin = weechat.info_get("python2_bin", "") or "python"
gweather_hook_process = weechat.hook_process(\
python2_bin + " -c \"import urllib2;\
handler = " + command + ";\
print handler.info().dict['content-type'];\
print handler.read();\
handler.close();\"",
int(weechat.config_get_plugin('timeout')) * 1000, "gweather_data_cb", "")
# The old cached string is returned here. gweather_data_cb() will
# request a new update after the data is fetched and parsed.
return gweather_output
def gweather_update(*kwargs):
weechat.bar_item_update('gweather')
return weechat.WEECHAT_RC_OK
if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE,
SCRIPT_DESC, '', ''):
for option, default_value in settings.iteritems():
if not weechat.config_is_set_plugin(option):
weechat.config_set_plugin(option, default_value)
weechat.bar_item_new('gweather', 'gweather_cb', '')
weechat.bar_item_update('gweather')
weechat.hook_timer(int(weechat.config_get_plugin('interval')) * 1000 * 60,
0, 0, 'gweather_update', '')
开发者ID:KokaKiwi,项目名称:weechat-scripts,代码行数:30,代码来源:gweather.py
注:本文中的weechat.bar_item_new函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论