本文整理汇总了Python中weechat.config_new函数的典型用法代码示例。如果您正苦于以下问题:Python config_new函数的具体用法?Python config_new怎么用?Python config_new使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了config_new函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: bas_config_init
def bas_config_init():
"""
Initialization of configuration file.
Sections: buffer.
"""
global bas_config_file, bas_options
bas_config_file = weechat.config_new(CONFIG_FILE_NAME,
"bas_config_reload_cb", "")
if bas_config_file == "":
return
# section "look"
section_look = weechat.config_new_section(
bas_config_file, "look", 0, 0, "", "", "", "", "", "", "", "", "", "")
if not section_look:
weechat.config_free(bas_config_file)
return
# options in section "look"
bas_options["look_timer"] = weechat.config_new_option(
bas_config_file, section_look, "timer", "integer",
"Timer used to delay the set of properties (in milliseconds, "
"0 = don't use a timer)",
"", 0, 2147483647, "1", "1", 0, "", "", "", "", "", "")
# section "buffer"
section_buffer = weechat.config_new_section(
bas_config_file, "buffer", 1, 1, "", "", "", "", "", "",
"bas_config_buffer_create_option_cb", "", "", "")
if not section_buffer:
weechat.config_free(bas_config_file)
return
开发者ID:Shrews,项目名称:scripts,代码行数:32,代码来源:buffer_autoset.py
示例2: init_own_config_file
def init_own_config_file():
# set up configuration options and load config file
global CONFIG_FILE, CONFIG_SECTIONS
CONFIG_FILE = weechat.config_new(SCRIPT_NAME, '', '')
CONFIG_SECTIONS = {}
CONFIG_SECTIONS['section_name'] = weechat.config_new_section(
CONFIG_FILE, 'section_name', 0, 0, '', '', '', '', '', '', '', '', '', '')
for option, typ, desc, default in [
('option_name',
'boolean',
'option description',
'off'),
('option_name2',
'boolean',
'option name2 description ',
'on'),
('option_name3',
'string',
'option name3 description',
''),
('option_name4',
'string',
'option name4 description',
'set an default string here'),
]:
weechat.config_new_option(
CONFIG_FILE, CONFIG_SECTIONS['section_name'], option, typ, desc, '', 0,
0, default, default, 0, '', '', '', '', '', '')
weechat.config_read(CONFIG_FILE)
开发者ID:weechatter,项目名称:weechat-scripts,代码行数:31,代码来源:skeleton.py
示例3: theme_config_init
def theme_config_init():
"""Initialization of configuration file. Sections: ???."""
global theme_config_file, theme_config_option
theme_config_file = weechat.config_new(THEME_CONFIG_FILE_NAME,
'theme_config_reload_cb', '')
if not theme_config_file:
return
# section "color"
section_color = weechat.config_new_section(
theme_config_file, 'color', 0, 0, '', '', '', '', '', '', '', '', '', '')
if not section_color:
weechat.config_free(theme_config_file)
return
theme_config_option['color_script'] = weechat.config_new_option(
theme_config_file, section_color,
'script', 'color', 'Color for script names', '', 0, 0,
'cyan', 'cyan', 0, '', '', '', '', '', '')
theme_config_option['color_installed'] = weechat.config_new_option(
theme_config_file, section_color,
'installed', 'color', 'Color for "installed" indicator', '', 0, 0,
'yellow', 'yellow', 0, '', '', '', '', '', '')
theme_config_option['color_running'] = weechat.config_new_option(
theme_config_file, section_color,
'running', 'color', 'Color for "running" indicator', '', 0, 0,
'lightgreen', 'lightgreen', 0, '', '', '', '', '', '')
theme_config_option['color_obsolete'] = weechat.config_new_option(
theme_config_file, section_color,
'obsolete', 'color', 'Color for "obsolete" indicator', '', 0, 0,
'lightmagenta', 'lightmagenta', 0, '', '', '', '', '', '')
theme_config_option['color_unknown'] = weechat.config_new_option(
theme_config_file, section_color,
'unknown', 'color', 'Color for "unknown status" indicator', '', 0, 0,
'lightred', 'lightred', 0, '', '', '', '', '', '')
theme_config_option['color_language'] = weechat.config_new_option(
theme_config_file, section_color,
'language', 'color', 'Color for language names', '', 0, 0,
'lightblue', 'lightblue', 0, '', '', '', '', '', '')
# section "themes"
section_themes = weechat.config_new_section(
theme_config_file, 'themes', 0, 0, '', '', '', '', '', '', '', '', '', '')
if not section_themes:
weechat.config_free(theme_config_file)
return
theme_config_option['themes_url'] = weechat.config_new_option(
theme_config_file, section_themes,
'url', 'string', 'URL for file with list of themes', '', 0, 0,
'http://www.weechat.org/files/themes.json.gz',
'http://www.weechat.org/files/themes.json.gz', 0, '', '', '', '', '', '')
theme_config_option['themes_cache_expire'] = weechat.config_new_option(
theme_config_file, section_themes,
'cache_expire', 'integer', 'Local cache expiration time, in minutes '
'(-1 = never expires, 0 = always expires)', '',
-1, 60*24*365, '60', '60', 0, '', '', '', '', '', '')
theme_config_option['themes_dir'] = weechat.config_new_option(
theme_config_file, section_themes,
'dir', 'string', 'Local directory for themes', '', 0, 0,
'%h/themes', '%h/themes', 0, '', '', '', '', '', '')
开发者ID:archSeer,项目名称:dotfiles-old,代码行数:59,代码来源:theme.py
示例4: __init__
def __init__(self, filename):
''' Initialize the configuration. '''
self.filename = filename
self.config_file = weechat.config_new(self.filename, '', '')
self.sorting_section = None
self.case_sensitive = False
self.group_irc = True
self.rules = []
self.highest = 0
self.__case_sensitive = None
self.__group_irc = None
self.__rules = None
if not self.config_file:
log('Failed to initialize configuration file "{}".'.format(self.filename))
return
self.sorting_section = weechat.config_new_section(self.config_file, 'sorting', False, False, '', '', '', '', '', '', '', '', '', '')
if not self.sorting_section:
log('Failed to initialize section "sorting" of configuration file.')
weechat.config_free(self.config_file)
return
self.__case_sensitive = weechat.config_new_option(
self.config_file, self.sorting_section,
'case_sensitive', 'boolean',
'If this option is on, sorting is case sensitive.',
'', 0, 0, 'off', 'off', 0,
'', '', '', '', '', ''
)
self.__group_irc = weechat.config_new_option(
self.config_file, self.sorting_section,
'group_irc', 'boolean',
'If this option is on, the script pretends that IRC channel/private buffers are renamed to "irc.server.{network}.{channel}" rather than "irc.{network}.{channel}".' +
'This ensures that thsee buffers are grouped with their respective server buffer.',
'', 0, 0, 'on', 'on', 0,
'', '', '', '', '', ''
)
self.__rules = weechat.config_new_option(
self.config_file, self.sorting_section,
'rules', 'string',
'An ordered list of sorting rules encoded as JSON. See /help autosort for commands to manipulate these rules.',
'', 0, 0, Config.default_rules, Config.default_rules, 0,
'', '', '', '', '', ''
)
if weechat.config_read(self.config_file) != weechat.WEECHAT_RC_OK:
log('Failed to load configuration file.')
if weechat.config_write(self.config_file) != weechat.WEECHAT_RC_OK:
log('Failed to write configuration file.')
self.reload()
开发者ID:Shawn-Smith,项目名称:weechat-scripts,代码行数:59,代码来源:autosort.py
示例5: fish_config_init
def fish_config_init():
global fish_config_file, fish_config_section, fish_config_option
fish_config_file = weechat.config_new(CONFIG_FILE_NAME,
"fish_config_reload_cb", "")
if not fish_config_file:
return
# look
fish_config_section["look"] = weechat.config_new_section(fish_config_file,
"look", 0, 0, "", "", "", "", "", "", "", "", "", "")
if not fish_config_section["look"]:
weechat.config_free(fish_config_file)
return
fish_config_option["announce"] = weechat.config_new_option(
fish_config_file, fish_config_section["look"], "announce",
"boolean", "annouce if messages are being encrypted or not", "", 0,
0, "on", "on", 0, "", "", "", "", "", "")
fish_config_option["marker"] = weechat.config_new_option(
fish_config_file, fish_config_section["look"], "marker",
"string", "marker for important FiSH messages", "", 0, 0,
"O<", "O<", 0, "", "", "", "", "", "")
fish_config_option["mark_position"] = weechat.config_new_option(
fish_config_file, fish_config_section["look"], "mark_position",
"integer", "put marker for encrypted INCOMING messages at start or end", "off|begin|end",
0,2, "off", "off", 0, "", "", "", "", "", "")
fish_config_option["mark_encrypted"] = weechat.config_new_option(
fish_config_file, fish_config_section["look"], "mark_encrypted",
"string", "marker for encrypted INCOMING messages", "", 0, 0,
"*", "*", 0, "", "", "", "", "", "")
# color
fish_config_section["color"] = weechat.config_new_section(fish_config_file,
"color", 0, 0, "", "", "", "", "", "", "", "", "", "")
if not fish_config_section["color"]:
weechat.config_free(fish_config_file)
return
fish_config_option["alert"] = weechat.config_new_option(
fish_config_file, fish_config_section["color"], "alert",
"color", "color for important FiSH message markers", "", 0, 0,
"lightblue", "lightblue", 0, "", "", "", "", "", "")
# keys
fish_config_section["keys"] = weechat.config_new_section(fish_config_file,
"keys", 0, 0,
"fish_config_keys_read_cb", "",
"fish_config_keys_write_cb", "", "",
"", "", "", "", "")
if not fish_config_section["keys"]:
weechat.config_free(fish_config_file)
return
开发者ID:KokaKiwi,项目名称:weechat-scripts,代码行数:55,代码来源:fish.py
示例6: execbot_config_init
def execbot_config_init():
'''Init configuration file'''
global execbot_config_file
execbot_config_file = weechat.config_new('execbot', 'execbot_config_reload_cb', '')
if not execbot_config_file:
return
execbot_config_section['allows'] = weechat.config_new_section(
execbot_config_file, 'allows', 0, 0, 'execbot_config_allows_read_cb', '',
'execbot_config_allows_write_cb', '', '', '', '', '', '', '')
if not execbot_config_section['allows']:
weechat.config_free(execbot_config_file)
开发者ID:oakkitten,项目名称:scripts,代码行数:12,代码来源:execbot.py
示例7: theme_config_init
def theme_config_init():
"""Initialization of configuration file. Sections: color, themes."""
global theme_cfg_file, theme_cfg
theme_cfg_file = weechat.config_new(THEME_CONFIG_FILENAME,
'theme_config_reload_cb', '')
# section "color"
section = weechat.config_new_section(
theme_cfg_file, 'color', 0, 0,
'', '', '', '', '', '', '', '', '', '')
theme_cfg['color_script'] = weechat.config_new_option(
theme_cfg_file, section, 'script', 'color',
'Color for script names', '', 0, 0,
'cyan', 'cyan', 0, '', '', '', '', '', '')
theme_cfg['color_installed'] = weechat.config_new_option(
theme_cfg_file, section, 'installed', 'color',
'Color for "installed" indicator', '', 0, 0,
'yellow', 'yellow', 0, '', '', '', '', '', '')
theme_cfg['color_running'] = weechat.config_new_option(
theme_cfg_file, section, 'running', 'color',
'Color for "running" indicator', '', 0, 0,
'lightgreen', 'lightgreen', 0, '', '', '', '', '', '')
theme_cfg['color_obsolete'] = weechat.config_new_option(
theme_cfg_file, section, 'obsolete', 'color',
'Color for "obsolete" indicator', '', 0, 0,
'lightmagenta', 'lightmagenta', 0, '', '', '', '', '', '')
theme_cfg['color_unknown'] = weechat.config_new_option(
theme_cfg_file, section, 'unknown', 'color',
'Color for "unknown status" indicator', '', 0, 0,
'lightred', 'lightred', 0, '', '', '', '', '', '')
theme_cfg['color_language'] = weechat.config_new_option(
theme_cfg_file, section, 'language', 'color',
'Color for language names', '', 0, 0,
'lightblue', 'lightblue', 0, '', '', '', '', '', '')
# section "themes"
section = weechat.config_new_section(
theme_cfg_file, 'themes', 0, 0,
'', '', '', '', '', '', '', '', '', '')
theme_cfg['themes_url'] = weechat.config_new_option(
theme_cfg_file, section,
'url', 'string', 'URL for file with themes (.tar.bz2 file)', '', 0, 0,
THEME_URL, THEME_URL, 0, '', '', '', '', '', '')
theme_cfg['themes_cache_expire'] = weechat.config_new_option(
theme_cfg_file, section,
'cache_expire', 'integer', 'Local cache expiration time, in minutes '
'(-1 = never expires, 0 = always expires)', '',
-1, 60 * 24 * 365, '60', '60', 0, '', '', '', '', '', '')
theme_cfg['themes_dir'] = weechat.config_new_option(
theme_cfg_file, section,
'dir', 'string', 'Local directory for themes', '', 0, 0,
'%h/themes', '%h/themes', 0, '', '', '', '', '', '')
开发者ID:MatthewCox,项目名称:dotfiles,代码行数:52,代码来源:theme.py
示例8: initialize_config
def initialize_config(name):
global config
config = {}
global config_file
config_file = weechat.config_new(name, 'my_config_reload_cb', '')
global config_values
config_values = {}
global config_keys
config_keys = {
'strings' : ['url', 'streams', 'stream_options', 'format']
#'integers' : ['time_delay']
}
# Available colors
global colors
colors = ['white' , 'black', 'blue', 'green', 'lighred', 'red',
'magenta', 'brown', 'yellow', 'lightgreen', 'cyan',
'lightcyan', 'lightblue', 'lightmagenta', 'darkgray', 'gray']
if not config_file:
return
section = weechat.config_new_section(config_file, 'config', 0,0, '', '', '', '', '', '', '', '', '', '')
config['url'] = weechat.config_new_option(config_file, section,
'icecast_json_url', 'string', 'http directory for /status-json.xsl',
'', 0, 0,
'http://icecast.nashgul.com.es/status-json.xsl', 'http://icecast.nashgul.com.es/status-json.xsl', 1,
'', '',
'load_str_vars_cb', '',
'', '')
config['streams'] = weechat.config_new_option(config_file, section,
'streams', 'string', 'mounts to show (without slash and separated by commas)',
'', 0, 0,
'nashgul', 'nashgul', 1,
'check_mounts_cb', '',
'load_str_vars_cb', '',
'', '')
config['stream_options'] = weechat.config_new_option(config_file, section,
'stream_options', 'string', 'stream options to show',
'', 0, 0,
'url,artist,title,listeners', 'url,artist,title,listeners', 1,
'', '',
'load_str_vars_cb', '',
'', '')
config['format'] = weechat.config_new_option(config_file, section,
'output_format', 'string', 'Output string format (%s: attribute, %\'color\'; i.e.: Now playing on %red%s: %blue%s - %s - %s)',
'', 0, 0,
'%redAhora suena en %cyan%s%yellow: %lightblue%s %yellow- %lightblue%s %yellow( %magentaOyentes%yellow: %lightblue%s %yellow)', '%lightredAhora suena en %cyan%s%yellow: %lightblue%s %yellow- %lightblue%s %yellow( %magentaOyentes%yellow: %lightblue%s %yellow)', 1,
'', '',
'load_str_vars_cb', '',
'', '')
开发者ID:manuelalcocer,项目名称:irc,代码行数:49,代码来源:icecast.py
示例9: ircrypt_config_init
def ircrypt_config_init():
''' This method initializes the configuration file. It creates sections and
options in memory and prepares the handling of key sections.
'''
global ircrypt_config_file, ircrypt_config_section, ircrypt_config_option
ircrypt_config_file = weechat.config_new('ircrypt-keyex', 'ircrypt_config_reload_cb', '')
if not ircrypt_config_file:
return
# public key identifier
ircrypt_config_section['asym_id'] = weechat.config_new_section(
ircrypt_config_file, 'asym_id', 0, 0,
'ircrypt_config_asym_id_read_cb', '',
'ircrypt_config_asym_id_write_cb', '', '', '', '', '', '', '')
if not ircrypt_config_section['asym_id']:
weechat.config_free(ircrypt_config_file)
开发者ID:petvoigt,项目名称:ircrypt-weechat,代码行数:16,代码来源:ircrypt-keyex.py
示例10: bas_config_init
def bas_config_init():
"""
Initialization of configuration file.
Sections: buffer.
"""
global bas_config_file
bas_config_file = weechat.config_new(CONFIG_FILE_NAME, "bas_config_reload_cb", "")
if bas_config_file == "":
return
# section "buffer"
section_buffer = weechat.config_new_section(
bas_config_file, "buffer", 1, 1, "", "", "", "", "", "", "bas_config_buffer_create_option_cb", "", "", ""
)
if section_buffer == "":
weechat.config_free(bas_config_file)
return
开发者ID:holomorph,项目名称:scripts,代码行数:17,代码来源:buffer_autoset.py
示例11: colorize_config_init
def colorize_config_init():
'''
Initialization of configuration file.
Sections: look.
'''
global colorize_config_file, colorize_config_option
colorize_config_file = weechat.config_new(CONFIG_FILE_NAME,
"colorize_config_reload_cb", "")
if colorize_config_file == "":
return
# section "look"
section_look = weechat.config_new_section(
colorize_config_file, "look", 0, 0, "", "", "", "", "", "", "", "", "", "")
if section_look == "":
weechat.config_free(colorize_config_file)
return
colorize_config_option["blacklist_channels"] = weechat.config_new_option(
colorize_config_file, section_look, "blacklist_channels",
"string", "Comma separated list of channels", "", 0, 0,
"", "", 0, "", "", "", "", "", "")
colorize_config_option["blacklist_nicks"] = weechat.config_new_option(
colorize_config_file, section_look, "blacklist_nicks",
"string", "Comma separated list of nicks", "", 0, 0,
"so,root", "so,root", 0, "", "", "", "", "", "")
colorize_config_option["min_nick_length"] = weechat.config_new_option(
colorize_config_file, section_look, "min_nick_length",
"integer", "Minimum length nick to colorize", "",
2, 20, "", "", 0, "", "", "", "", "", "")
colorize_config_option["colorize_input"] = weechat.config_new_option(
colorize_config_file, section_look, "colorize_input",
"boolean", "Whether to colorize input", "", 0,
0, "off", "off", 0, "", "", "", "", "", "")
colorize_config_option["ignore_tags"] = weechat.config_new_option(
colorize_config_file, section_look, "ignore_tags",
"string", "Comma separated list of tags to ignore; i.e. irc_join,irc_part,irc_quit", "", 0, 0,
"", "", 0, "", "", "", "", "", "")
colorize_config_option["greedy_matching"] = weechat.config_new_option(
colorize_config_file, section_look, "greedy_matching",
"boolean", "If off, then use lazy matching instead", "", 0,
0, "on", "on", 0, "", "", "", "", "", "")
colorize_config_option["ignore_nicks_in_urls"] = weechat.config_new_option(
colorize_config_file, section_look, "ignore_nicks_in_urls",
"boolean", "If on, don't colorize nicks inside URLs", "", 0,
0, "off", "off", 0, "", "", "", "", "", "")
开发者ID:AmusableLemur,项目名称:Dotfiles,代码行数:45,代码来源:colorize_nicks.py
示例12: setup_config_file
def setup_config_file(self):
"""Initialize the configuration."""
config_file = weechat.config_new(
self._config_name,
self._reload_cb,
self._reload_cb_data)
if not config_file:
return None
for section in SCRIPT_CONFIG:
config_section = weechat.config_new_section(
config_file,
section,
0, 0, "", "", "", "", "", "", "", "", "", ""
)
if not config_section:
weechat.config_free(config_file)
return None
for option_name, props in SCRIPT_CONFIG[section].items():
weechat.config_new_option(
config_file,
config_section,
option_name,
props['type'],
props['desc'],
props['string_values'],
props['min'],
props['max'],
props['default'],
props['default'],
0,
props['check_cb'],
"",
props['change_cb'],
props['change_data'],
props['delete_cb'],
""
)
return config_file
开发者ID:phyber,项目名称:weechat-scripts,代码行数:43,代码来源:whitelist.py
示例13: jmh_config_init
def jmh_config_init():
""" Initialize config file: create sections and options in memory. """
global jmh_config_file, jmh_config_section
jmh_config_file = weechat.config_new("jabber_message_handler",
"jmh_config_reload_cb", "")
if not jmh_config_file:
return
# options
jmh_config_section["options"] = weechat.config_new_section(
jmh_config_file, "options", 0, 0, "", "", "", "", "",
"", "", "", "", "")
if not jmh_config_section["options"]:
weechat.config_free(jmh_config_file)
return
# prototype option = weechat.config_new_option(
# config_file, section,
# name, type, description,
# string_values, min, max, default_value, value, null_value_allowed,
# callback_check_value, callback_check_value_data,
# callback_change, callback_change_data,
# callback_delete, callback_delete_data)
jmh_config_option["enabled"] = weechat.config_new_option(
jmh_config_file, jmh_config_section["options"],
"enabled", "boolean", "jabber_message_handler service enabled",
"", 0, 0, "off", "off", 0,
"", "", "", "", "", "")
jmh_config_option["log"] = weechat.config_new_option(
jmh_config_file, jmh_config_section["options"],
"log", "string", "jabber_message_handler events log file",
"", 0, 0, "~/.weechat/logs/events", "~/.weechat/logs/events", 0,
"", "", "", "", "", "")
jmh_config_option["verbose"] = weechat.config_new_option(
jmh_config_file, jmh_config_section["options"],
"verbose", "boolean", "set verbose on/off",
"", 0, 0, "off", "off", 0,
"", "", "", "", "", "")
开发者ID:zsw,项目名称:dotfiles,代码行数:36,代码来源:jabber_message_handler.py
示例14: __init__
def __init__(self):
UserDict.__init__(self)
self.data = {}
self.config_file = weechat.config_new(CONFIG_FILE_NAME,
"ug_config_reload_cb", "")
if not self.config_file:
return
section_color = weechat.config_new_section(
self.config_file, "color", 0, 0, "", "", "", "", "", "",
"", "", "", "")
section_default = weechat.config_new_section(
self.config_file, "default", 0, 0, "", "", "", "", "", "",
"", "", "", "")
self.data['color_buffer']=weechat.config_new_option(
self.config_file, section_color,
"color_buffer", "color", "Color to display buffer name", "", 0, 0,
"red", "red", 0, "", "", "", "", "", "")
self.data['color_url']=weechat.config_new_option(
self.config_file, section_color,
"color_url", "color", "Color to display urls", "", 0, 0,
"blue", "blue", 0, "", "", "", "", "", "")
self.data['color_time']=weechat.config_new_option(
self.config_file, section_color,
"color_time", "color", "Color to display time", "", 0, 0,
"cyan", "cyan", 0, "", "", "", "", "", "")
self.data['color_buffer_selected']=weechat.config_new_option(
self.config_file, section_color,
"color_buffer_selected", "color",
"Color to display buffer selected name", "", 0, 0, "red", "red",
0, "", "", "", "", "", "")
self.data['color_url_selected']=weechat.config_new_option(
self.config_file, section_color,
"color_url_selected", "color", "Color to display url selected",
"", 0, 0, "blue", "blue", 0, "", "", "", "", "", "")
self.data['color_time_selected']=weechat.config_new_option(
self.config_file, section_color,
"color_time_selected", "color", "Color to display tim selected",
"", 0, 0, "cyan", "cyan", 0, "", "", "", "", "", "")
self.data['color_bg_selected']=weechat.config_new_option(
self.config_file, section_color,
"color_bg_selected", "color", "Background for selected row", "", 0, 0,
"green", "green", 0, "", "", "", "", "", "")
self.data['historysize']=weechat.config_new_option(
self.config_file, section_default,
"historysize", "integer", "Max number of urls to store per buffer",
"", 0, 999, "10", "10", 0, "", "", "", "", "", "")
self.data['method']=weechat.config_new_option(
self.config_file, section_default,
"method", "string", """Where to launch URLs
If 'local', runs %localcmd%.
If 'remote' runs the following command:
'%remodecmd%'""", "", 0, 0,
"local", "local", 0, "", "", "", "", "", "")
self.data['localcmd']=weechat.config_new_option(
self.config_file, section_default,
"localcmd", "string", """Local command to execute""", "", 0, 0,
"firefox %s", "firefox %s", 0, "", "", "", "", "", "")
remotecmd="ssh -x localhost -i ~/.ssh/id_rsa -C \"export DISPLAY=\":0.0\" && firefox %s\""
self.data['remotecmd']=weechat.config_new_option(
self.config_file, section_default,
"remotecmd", "string", remotecmd, "", 0, 0,
remotecmd, remotecmd, 0, "", "", "", "", "", "")
self.data['url_log']=weechat.config_new_option(
self.config_file, section_default,
"url_log", "string", """log location""", "", 0, 0,
"~/.weechat/urls.log", "~/.weechat/urls.log", 0, "", "", "", "", "", "")
self.data['time_format']=weechat.config_new_option(
self.config_file, section_default,
"time_format", "string", """TIme format""", "", 0, 0,
"%H:%M:%S", "%H:%M:%S", 0, "", "", "", "", "", "")
self.data['output_main_buffer']=weechat.config_new_option(
self.config_file, section_default,
"output_main_buffer", "boolean",
"""Print text to main buffer or current one""", "", 0, 0, "1", "1",
0, "", "", "", "", "", "")
weechat.config_read(self.config_file)
开发者ID:bradfier,项目名称:configs,代码行数:92,代码来源:urlgrab.py
示例15: wg_config_init
def wg_config_init():
"""
Initialization of configuration file.
Sections: color, scripts.
"""
global wg_config_file, wg_config_option
wg_config_file = weechat.config_new(CONFIG_FILE_NAME,
"wg_config_reload_cb", "")
if wg_config_file == "":
return
# section "color"
section_color = weechat.config_new_section(
wg_config_file, "color", 0, 0, "", "", "", "", "", "", "", "", "", "")
if section_color == "":
weechat.config_free(wg_config_file)
return
wg_config_option["color_script"] = weechat.config_new_option(
wg_config_file, section_color,
"script", "color", "Color for script names", "", 0, 0,
"cyan", "cyan", 0, "", "", "", "", "", "")
wg_config_option["color_installed"] = weechat.config_new_option(
wg_config_file, section_color,
"installed", "color", "Color for \"installed\" indicator", "", 0, 0,
"yellow", "yellow", 0, "", "", "", "", "", "")
wg_config_option["color_running"] = weechat.config_new_option(
wg_config_file, section_color,
"running", "color", "Color for \"running\" indicator", "", 0, 0,
"lightgreen", "lightgreen", 0, "", "", "", "", "", "")
wg_config_option["color_obsolete"] = weechat.config_new_option(
wg_config_file, section_color,
"obsolete", "color", "Color for \"obsolete\" indicator", "", 0, 0,
"lightmagenta", "lightmagenta", 0, "", "", "", "", "", "")
wg_config_option["color_unknown"] = weechat.config_new_option(
wg_config_file, section_color,
"unknown", "color", "Color for \"unknown status\" indicator", "", 0, 0,
"lightred", "lightred", 0, "", "", "", "", "", "")
wg_config_option["color_language"] = weechat.config_new_option(
wg_config_file, section_color,
"language", "color", "Color for language names", "", 0, 0,
"lightblue", "lightblue", 0, "", "", "", "", "", "")
# section "scripts"
section_scripts = weechat.config_new_section(
wg_config_file, "scripts", 0, 0, "", "", "", "", "", "", "", "", "", "")
if section_scripts == "":
weechat.config_free(wg_config_file)
return
wg_config_option["scripts_url"] = weechat.config_new_option(
wg_config_file, section_scripts,
"url", "string", "URL for file with list of plugins", "", 0, 0,
"http://www.weechat.org/files/plugins.xml.gz",
"http://www.weechat.org/files/plugins.xml.gz", 0, "", "", "", "", "", "")
wg_config_option["scripts_dir"] = weechat.config_new_option(
wg_config_file, section_scripts,
"dir", "string", "Local cache directory for" + SCRIPT_NAME, "", 0, 0,
"%h/" + SCRIPT_NAME, "%h/" + SCRIPT_NAME, 0, "", "", "", "", "", "")
wg_config_option["scripts_cache_expire"] = weechat.config_new_option(
wg_config_file, section_scripts,
"cache_expire", "integer", "Local cache expiration time, in minutes "
"(-1 = never expires, 0 = always expires)", "",
-1, 60*24*365, "60", "60", 0, "", "", "", "", "", "")
开发者ID:zachwlewis,项目名称:dotfiles,代码行数:62,代码来源:weeget.py
示例16: __init__
def __init__(self, filename):
''' Initialize the configuration. '''
self.filename = filename
self.config_file = weechat.config_new(self.filename, '', '')
self.sorting_section = None
self.case_sensitive = False
self.group_irc = True
self.rules = []
self.replacements = []
self.signals = []
self.sort_on_config = True
self.__case_sensitive = None
self.__group_irc = None
self.__rules = None
self.__replacements = None
self.__signals = None
self.__sort_on_config = None
if not self.config_file:
log('Failed to initialize configuration file "{0}".'.format(self.filename))
return
self.sorting_section = weechat.config_new_section(self.config_file, 'sorting', False, False, '', '', '', '', '', '', '', '', '', '')
if not self.sorting_section:
log('Failed to initialize section "sorting" of configuration file.')
weechat.config_free(self.config_file)
return
self.__case_sensitive = weechat.config_new_option(
self.config_file, self.sorting_section,
'case_sensitive', 'boolean',
'If this option is on, sorting is case sensitive.',
'', 0, 0, 'off', 'off', 0,
'', '', '', '', '', ''
)
self.__group_irc = weechat.config_new_option(
self.config_file, self.sorting_section,
'group_irc', 'boolean',
'If this option is on, the script pretends that IRC channel/private buffers are renamed to "irc.server.{network}.{channel}" rather than "irc.{network}.{channel}".' +
'This ensures that these buffers are grouped with their respective server buffer.',
'', 0, 0, 'on', 'on', 0,
'', '', '', '', '', ''
)
self.__rules = weechat.config_new_option(
self.config_file, self.sorting_section,
'rules', 'string',
'An ordered list of sorting rules encoded as JSON. See /help autosort for commands to manipulate these rules.',
'', 0, 0, Config.default_rules, Config.default_rules, 0,
'', '', '', '', '', ''
)
self.__replacements = weechat.config_new_option(
self.config_file, self.sorting_section,
'replacements', 'string',
'An ordered list of replacement patterns to use on buffer name components, encoded as JSON. See /help autosort for commands to manipulate these replacements.',
'', 0, 0, Config.default_replacements, Config.default_replacements, 0,
'', '', '', '', '', ''
)
self.__signals = weechat.config_new_option(
self.config_file, self.sorting_section,
'signals', 'string',
'The signals that will cause autosort to resort your buffer list. Seperate signals with spaces.',
'', 0, 0, Config.default_signals, Config.default_signals, 0,
'', '', '', '', '', ''
)
self.__sort_on_config = weechat.config_new_option(
self.config_file, self.sorting_section,
'sort_on_config_change', 'boolean',
'Decides if the buffer list should be sorted when autosort configuration changes.',
'', 0, 0, 'on', 'on', 0,
'', '', '', '', '', ''
)
if weechat.config_read(self.config_file) != weechat.WEECHAT_RC_OK:
log('Failed to load configuration file.')
if weechat.config_write(self.config_file) != weechat.WEECHAT_RC_OK:
log('Failed to write configuration file.')
self.reload()
开发者ID:0xdkay,项目名称:dotfiles,代码行数:88,代码来源:autosort.py
示例17: __init__
def __init__(self, filename):
''' Initialize the configuration. '''
self.filename = filename
self.config_file = weechat.config_new(self.filename, '', '')
self.sorting_section = None
self.v3_section = None
self.case_sensitive = False
self.rules = []
self.helpers = {}
self.signals = []
self.signal_delay = Config.default_signal_delay,
self.sort_on_config = True
self.__case_sensitive = None
self.__rules = None
self.__helpers = None
self.__signals = None
self.__signal_delay = None
self.__sort_on_config = N
|
请发表评论