コード例 #1
0
ファイル: preferences.py プロジェクト: kaeza/KaeChat
    def commit(self):
        """Called when the user clicks the "OK" button in the preferences
        dialog to actually apply the configuration.

        This method is only called if no `validate()' method returns a false
        value.
        """
        _kc.set_bool("chat", "notices_to_chan", self._notice_chan_var.get())
        _kc.set_bool("chat", "highlights_to_chan", self._hilite_chan_var.get())
        _kc.set("chat", "nick_complete_suffix", self._nickomplete_var.get())
コード例 #2
0
ファイル: __init__.py プロジェクト: kaeza/KaeChat
def save_networks():
    """Save the network list.

    This function stores the `networks' mapping to the (in-memory)
    configuration file.
    """
    for netid in networks:
        sect = "networks/" + netid
        net = networks[netid]
        _kc.set(sect, "name", net.name)
        _kc.set(sect, "address", "%s/%d" % net.address)
        if net.username:
            _kc.set(sect, "username", net.username)
        if net.realname:
            _kc.set(sect, "realname", net.realname)
        if net.nicks:
            _kc.set_list(sect, "nicks", net.nicks)
        _kc.set_bool(sect, "autoconnect", net.autoconnect)
        if net.channels:
            _kc.set_list(sect, "channels", net.channels)
    _kc.save()