• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python weechat.config_read函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: 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


示例2: __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


示例3: fish_config_read

def fish_config_read():
    global fish_config_file

    return weechat.config_read(fish_config_file)
开发者ID:KokaKiwi,项目名称:weechat-scripts,代码行数:4,代码来源:fish.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.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 = 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, '', '', '', '', '', '', '', '', '', '')
		self.v3_section      = weechat.config_new_section(self.config_file, 'v3',      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,
			'', '', '', '', '', ''
		)

		weechat.config_new_option(
			self.config_file, self.sorting_section,
			'rules', 'string',
			'Sort rules used by autosort v2.x and below. Not used by autosort anymore.',
			'', 0, 0, '', '', 0,
			'', '', '', '', '', ''
		)

		weechat.config_new_option(
			self.config_file, self.sorting_section,
			'replacements', 'string',
			'Replacement patterns used by autosort v2.x and below. Not used by autosort anymore.',
			'', 0, 0, '', '', 0,
			'', '', '', '', '', ''
		)

		self.__rules = weechat.config_new_option(
			self.config_file, self.v3_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.__helpers = weechat.config_new_option(
			self.config_file, self.v3_section,
			'helpers', 'string',
			'A dictionary helper variables to use in the sorting rules, encoded as JSON. See /help autosort for commands to manipulate these helpers.',
			'', 0, 0, Config.default_helpers, Config.default_helpers, 0,
			'', '', '', '', '', ''
		)

		self.__signals = weechat.config_new_option(
			self.config_file, self.sorting_section,
			'signals', 'string',
			'A space separated list of signals that will cause autosort to resort your buffer list.',
			'', 0, 0, Config.default_signals, Config.default_signals, 0,
			'', '', '', '', '', ''
		)

		self.__signal_delay = weechat.config_new_option(
			self.config_file, self.sorting_section,
			'signal_delay', 'integer',
			'Delay in milliseconds to wait after a signal before sorting the buffer list. This prevents triggering many times if multiple signals arrive in a short time. It can also be needed to wait for buffer localvars to be available.',
			'', 0, 1000, str(Config.default_signal_delay), str(Config.default_signal_delay), 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.')
#.........这里部分代码省略.........
开发者ID:ASKobayashi,项目名称:dotFiles,代码行数:101,代码来源:autosort.py


示例5: WeeNSServer

######################################
# Main
######################################

if __name__ == "__main__":
    if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION,
                        SCRIPT_LICENSE, SCRIPT_DESC, '',
                        'wee_ns_script_unload_cb'):
        weechat.hook_completion('ns_send', 'login completion',
                                'wee_ns_hook_completion_send', '')
        weechat.hook_command('ns', 'weeNetsoul: A netsoul plugin for weechat',
                             ' | '.join("%s%s" % (k, "" if 'desc' not in v
                                                  else " " + v['desc'])
                                        for k, v in hook_cmd_ns.items()),
                             '\n'.join("%s: %s" % (k, v['cb'].__doc__)
                                       for k, v in hook_cmd_ns.items()),
                             ' || '.join("%s%s" % (k, "" if 'compl' not in v
                                                   else " " + v['compl'])
                                         for k, v in hook_cmd_ns.items()),
                             'wee_ns_hook_cmd_ns', '')
        wee_ns_config_file = weechat.config_new(SCRIPT_NAME, '', '')
        wee_ns_conf_serv_sect = weechat.config_new_section(wee_ns_config_file,
                                                           'server', 0, 0,
                                                           ('wee_ns_serv_'
                                                            'sect_read_cb'),
                                                           '', '', '', '', '',
                                                           '', '', '', '')
        server = WeeNSServer()
        weechat.config_read(wee_ns_config_file)
        weechat.config_write(wee_ns_config_file)
开发者ID:DarkDefender,项目名称:scripts,代码行数:30,代码来源:weenetsoul.py


示例6: len

            msg = ' '.join(arglist[2:])
            server.getChatByRecipient(groups[0], groups[1], create = True).send(msg)
        else :
            weechat.prnt(buffer, 'Message recipient must be of type login_x[:fd]')
    elif arglist[0] == 'who' and server.isConnected() and len(arglist) > 1 :
        server._ns_user_cmd_who(arglist[1])
    elif arglist[0] == 'state' and server.isConnected() and len(arglist) > 1 :
        server._ns_state(arglist[1])
    else :
        weechat.prnt(buffer, '%sNo such command, wrong argument count, or you need to (dis)connect' % weechat.prefix('error'))
    return weechat.WEECHAT_RC_OK

######################################
# Main
######################################

if __name__ == "__main__" :
    if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE, SCRIPT_DESC, '', 'weeNS_script_unload_cb'):
        weechat.hook_command('ns', 'weeNetsoul main command', 'connect | disconnect | send <login> <msg> | state <status> | who <login>',
                             "    connect : Connect\n"
                             " disconnect : Diconnect\n"
                             "       send : Send <msg> to <login> (any client) or to <:fd> (unique client)\n"
                             "      state : Change status to <status> (en ligne/actif/whatever)\n"
                             "        who : Show infos about <login>\n",
                             'connect|disconnect|send|state|who', 'weeNS_hook_cmd_ns', '')
        weeNS_config_file = weechat.config_new(SCRIPT_NAME, '', '')
        weeNS_config_server_section = weechat.config_new_section(weeNS_config_file, 'server', 0, 0, 'weeNS_server_section_read_cb', '', '', '',  '', '', '', '', '', '')
        server = weeNSServer()
        weechat.config_read(weeNS_config_file)
        weechat.config_write(weeNS_config_file)
开发者ID:KokaKiwi,项目名称:weechat-scripts,代码行数:30,代码来源:weenetsoul.py


示例7: ug_config_reload_cb

def ug_config_reload_cb(data, config_file):
    """ Reload configuration file. """
    return weechat.config_read(config_file)
开发者ID:bradfier,项目名称:configs,代码行数:3,代码来源:urlgrab.py


示例8: __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


示例9: colorize_config_read

def colorize_config_read():
    """ Read configuration file. """
    global colorize_config_file
    return weechat.config_read(colorize_config_file)
开发者ID:chasinglogic,项目名称:dotfiles,代码行数:4,代码来源:colorize_nicks.py


示例10: bas_config_read

def bas_config_read():
    """Read configuration file."""
    global bas_config_file
    return weechat.config_read(bas_config_file)
开发者ID:AndyHoang,项目名称:dotfiles,代码行数:4,代码来源:buffer_autoset.py


示例11: init_config

def init_config():
    """Set up configuration options and load config file."""
    global CONFIG_FILE
    CONFIG_FILE = weechat.config_new(SCRIPT_NAME, 'config_reload_cb', '')

    global CONFIG_SECTIONS
    CONFIG_SECTIONS = {}

    CONFIG_SECTIONS['general'] = weechat.config_new_section(
        CONFIG_FILE, 'general', 0, 0, '', '', '', '', '', '', '', '', '', '')

    for option, typ, desc, default in [
        ('debug', 'boolean', 'OTR script debugging', 'off'),
        ]:
        weechat.config_new_option(
            CONFIG_FILE, CONFIG_SECTIONS['general'], option, typ, desc, '', 0,
            0, default, default, 0, '', '', '', '', '', '')

    CONFIG_SECTIONS['color'] = weechat.config_new_section(
        CONFIG_FILE, 'color', 0, 0, '', '', '', '', '', '', '', '', '', '')

    for option, desc, default, update_cb in [
        ('status.default', 'status bar default color', 'default',
         'bar_config_update_cb'),
        ('status.encrypted', 'status bar encrypted indicator color', 'green',
         'bar_config_update_cb'),
        ('status.unencrypted', 'status bar unencrypted indicator color',
         'lightred', 'bar_config_update_cb'),
        ('status.authenticated', 'status bar authenticated indicator color',
         'green', 'bar_config_update_cb'),
        ('status.unauthenticated', 'status bar unauthenticated indicator color',
         'lightred', 'bar_config_update_cb'),
        ('status.logged', 'status bar logged indicator color', 'lightred',
         'bar_config_update_cb'),
        ('status.notlogged', 'status bar not logged indicator color',
         'green', 'bar_config_update_cb'),
        ]:
        weechat.config_new_option(
            CONFIG_FILE, CONFIG_SECTIONS['color'], option, 'color', desc, '', 0,
            0, default, default, 0, '', '', update_cb, '', '', '')

    CONFIG_SECTIONS['look'] = weechat.config_new_section(
        CONFIG_FILE, 'look', 0, 0, '', '', '', '', '', '', '', '', '', '')

    for option, desc, default, update_cb in [
        ('bar.prefix', 'prefix for OTR status bar item', 'OTR:',
         'bar_config_update_cb'),
        ('bar.state.encrypted',
         'shown in status bar when conversation is encrypted', 'SEC',
         'bar_config_update_cb'),
        ('bar.state.unencrypted',
         'shown in status bar when conversation is not encrypted', '!SEC',
         'bar_config_update_cb'),
        ('bar.state.authenticated',
         'shown in status bar when peer is authenticated', 'AUTH',
         'bar_config_update_cb'),
        ('bar.state.unauthenticated',
         'shown in status bar when peer is not authenticated', '!AUTH',
         'bar_config_update_cb'),
        ('bar.state.logged',
         'shown in status bar when peer conversation is being logged to disk',
         'LOG',
         'bar_config_update_cb'),
        ('bar.state.notlogged',
         'shown in status bar when peer conversation is not being logged to disk',
         '!LOG',
         'bar_config_update_cb'),
        ('bar.state.separator', 'separator for states in the status bar', ',',
         'bar_config_update_cb'),
        ]:
        weechat.config_new_option(
            CONFIG_FILE, CONFIG_SECTIONS['look'], option, 'string', desc, '',
            0, 0, default, default, 0, '', '', update_cb, '', '', '')

    CONFIG_SECTIONS['policy'] = weechat.config_new_section(
        CONFIG_FILE, 'policy', 1, 1, '', '', '', '', '', '',
        'policy_create_option_cb', '', '', '')

    for option, desc, default in [
        ('default.allow_v2', 'default allow OTR v2 policy', 'on'),
        ('default.require_encryption', 'default require encryption policy',
         'off'),
        ('default.send_tag', 'default send tag policy', 'off'),
        ]:
        weechat.config_new_option(
            CONFIG_FILE, CONFIG_SECTIONS['policy'], option, 'boolean', desc, '',
            0, 0, default, default, 0, '', '', '', '', '', '')

    weechat.config_read(CONFIG_FILE)
开发者ID:frumiousbandersnatch,项目名称:weechat-scripts,代码行数:89,代码来源:otr.py


示例12: theme_config_read

def theme_config_read():
    """Read configuration file."""
    return weechat.config_read(theme_cfg_file)
开发者ID:MatthewCox,项目名称:dotfiles,代码行数:3,代码来源:theme.py


示例13:

    return ""
# }}}


if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE,
                    SCRIPT_DESC, "", "UTF-8"):
    # load config
    config_file = weechat.config_new(SCRIPT_NAME, 'reload_config_cb', '')
    weechat.config_new_section(config_file, 'keys', 1, 1,
                               'keys_read_option_cb', '',
                               '', '',
                               '', '',
                               'keys_create_option_cb', '',
                               '', '')
    weechat.config_read(config_file)

    weechat.hook_command(SCRIPT_NAME,
                         "change weesodium options",
                         "[enable KEY] || "
                         "[disable]",
                         "",
                         "enable %-|| "
                         "disable",
                         "command_cb",
                         "")
    weechat.hook_modifier('irc_in_privmsg', 'in_privmsg_cb', '')
    weechat.hook_modifier('irc_out_privmsg', 'out_privmsg_cb', '')
    weechat.hook_signal('buffer_closing', 'buffer_closing_cb', '')

    statusbar = weechat.bar_item_new(SCRIPT_NAME, 'statusbar_cb', '')
开发者ID:mutantmonkey,项目名称:weesodium,代码行数:30,代码来源:weesodium.py


示例14: config_read

def config_read():
    return weechat.config_read(config_file)
开发者ID:manuelalcocer,项目名称:irc,代码行数:2,代码来源:icecast.py


示例15: colorize_config_read

def colorize_config_read():
    ''' Read configuration file. '''
    global colorize_config_file
    return weechat.config_read(colorize_config_file)
开发者ID:AmusableLemur,项目名称:Dotfiles,代码行数:4,代码来源:colorize_nicks.py


示例16: execbot_config_read

def execbot_config_read():
    ''' Read Execbot configuration file (execbot.conf).'''
    return weechat.config_read(execbot_config_file)
开发者ID:oakkitten,项目名称:scripts,代码行数:3,代码来源:execbot.py


示例17: wg_config_read

def wg_config_read():
    """ Read configuration file. """
    global wg_config_file
    return weechat.config_read(wg_config_file)
开发者ID:zachwlewis,项目名称:dotfiles,代码行数:4,代码来源:weeget.py


示例18: jmh_config_read

def jmh_config_read():
    """ Read jabber config file (jabber.conf). """
    global jmh_config_file
    return weechat.config_read(jmh_config_file)
开发者ID:zsw,项目名称:dotfiles,代码行数:4,代码来源:jabber_message_handler.py


示例19: __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


示例20: ircrypt_config_read

def ircrypt_config_read():
	''' Read IRCrypt configuration file (ircrypt.conf).
	'''
	return weechat.config_read(ircrypt_config_file)
开发者ID:petvoigt,项目名称:ircrypt-weechat,代码行数:4,代码来源:ircrypt.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python weechat.config_set_desc_plugin函数代码示例发布时间:2022-05-26
下一篇:
Python weechat.config_option_set函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap