diff options
author | mathieui <mathieui@mathieui.net> | 2013-05-06 20:20:47 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2013-05-06 20:23:33 +0200 |
commit | 48614d6cf04518a95bad4d9893a63a5c4f99b653 (patch) | |
tree | 90bb646e00189b417fe572943d895c9c4ffc3531 | |
parent | ea5bfbfca4adcc0e5923e3c0b37f50e7e75b5440 (diff) | |
download | poezio-48614d6cf04518a95bad4d9893a63a5c4f99b653.tar.gz poezio-48614d6cf04518a95bad4d9893a63a5c4f99b653.tar.bz2 poezio-48614d6cf04518a95bad4d9893a63a5c4f99b653.tar.xz poezio-48614d6cf04518a95bad4d9893a63a5c4f99b653.zip |
Fix #2286
Also fix the copy of the default config if -f is used
-rw-r--r-- | data/default_config.cfg | 2 | ||||
-rw-r--r-- | doc/source/configuration.rst | 2 | ||||
-rw-r--r-- | src/config.py | 14 | ||||
-rw-r--r-- | src/connection.py | 2 | ||||
-rw-r--r-- | src/core.py | 14 |
5 files changed, 19 insertions, 15 deletions
diff --git a/data/default_config.cfg b/data/default_config.cfg index 6e2f02ec..13b9f8bc 100644 --- a/data/default_config.cfg +++ b/data/default_config.cfg @@ -85,7 +85,7 @@ custom_port = # the rooms you will join automatically on startup, with associated nickname or not # format : room@server.tld/nickname:room2@server.tld/nickname2 # default_nick will be used if "/nickname" is not specified -rooms = poezio@muc.poezio.eu +rooms = # the method that poezio will use to store your bookmarks online # possible values are: privatexml, pep diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst index fb03e1aa..0bd45377 100644 --- a/doc/source/configuration.rst +++ b/doc/source/configuration.rst @@ -433,7 +433,7 @@ section of this documentation. rooms - **Default value:** ``poezio@muc.poezio.eu`` + **Default value:** ``[empty]`` The rooms you will join automatically on startup, with associated nickname or not. diff --git a/src/config.py b/src/config.py index c94bb89a..2134513f 100644 --- a/src/config.py +++ b/src/config.py @@ -14,6 +14,9 @@ DEFSECTION = "Poezio" from gettext import gettext as _ +import logging +log = logging.getLogger(__name__) + from configparser import RawConfigParser, NoOptionError, NoSectionError from os import environ, makedirs, path from shutil import copy2 @@ -238,16 +241,17 @@ CONFIG_HOME = environ.get("XDG_CONFIG_HOME") if not CONFIG_HOME: CONFIG_HOME = path.join(environ.get('HOME'), '.config') CONFIG_PATH = path.join(CONFIG_HOME, 'poezio') + try: makedirs(CONFIG_PATH) except OSError: pass -if not path.isfile(path.join(CONFIG_PATH, 'poezio.cfg')): - copy2(path.join(path.dirname(__file__), '../data/default_config.cfg'), path.join(CONFIG_PATH, 'poezio.cfg')) +options = parse_args(CONFIG_PATH) + +# Copy a default file if none exists +if not path.isfile(options.filename): + copy2(path.join(path.dirname(__file__), '../data/default_config.cfg'), options.filename) firstrun = True -options = parse_args(CONFIG_PATH) config = Config(options.filename) -if firstrun: - config.set('firstrun', True) diff --git a/src/connection.py b/src/connection.py index b72c8d1f..8db237c4 100644 --- a/src/connection.py +++ b/src/connection.py @@ -42,7 +42,7 @@ class Connection(sleekxmpp.ClientXMPP): password = config.get('password', '') or getpass.getpass() else: # anonymous auth self.anon = True - jid = config.get('server', 'anon.louiz.org') + jid = config.get('server', 'anon.jeproteste.info') if resource: jid = '%s/%s' % (jid, resource) password = None diff --git a/src/core.py b/src/core.py index 3b0b490e..dbc65930 100644 --- a/src/core.py +++ b/src/core.py @@ -50,7 +50,7 @@ import bookmark from plugin_manager import PluginManager from data_forms import DataFormsTab -from config import config +from config import config, firstrun from logger import logger from roster import roster from contact import Contact, Resource @@ -330,13 +330,13 @@ class Core(object): default_tab.on_gain_focus() self.tabs.append(default_tab) self.information(_('Welcome to poezio!')) - if config.get('firstrun', ''): + if firstrun: self.information(_( - 'It seems that it is the first time you start poezio.\n' + \ - 'The online help is here http://poezio.eu/en/documentation.php.\n' + \ - 'By default, you are in poezio’s chatroom, where you can ask for help or tell us how great it is.\n' + \ - 'Just press Ctrl-n.' \ - )) + 'It seems that it is the first time you start poezio.\n' + 'The online help is here http://poezio.eu/doc/en/\n' + 'No room is joined by default, but you can join poezio’s chatroom ' + '(with /join poezio@muc.poezio.eu), where you can ask for help or tell us how great it is.' + ), 'Help') self.refresh_window() def on_exception(self, typ, value, trace): |