From 82a91db16e60e7abaec5d6039bb636d89dcd6498 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Wed, 21 Aug 2019 16:24:50 +0200 Subject: [PATCH] prefix metaconfig_prefix with current name --- ChangeLog | 4 ++++ tiramisu/__init__.py | 2 +- tiramisu/config.py | 10 ++++++---- tiramisu/locale/fr/LC_MESSAGES/tiramisu.po | 4 ++-- tiramisu/storage/dictionary/storage.py | 2 +- tiramisu/storage/sqlite3/storage.py | 2 +- 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8006b79..f6d521e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Aug 21 14:24:42 2019 +0200 Emmanuel Garette + * version 3.0 rc12 + * prefix metaconfig_prefix with current name + Mon Aug 19 08:02:27 2019 +0200 Emmanuel Garette * version 3.0 rc11 * Config could have multiple parents diff --git a/tiramisu/__init__.py b/tiramisu/__init__.py index 03b7e2d..d317aa4 100644 --- a/tiramisu/__init__.py +++ b/tiramisu/__init__.py @@ -45,4 +45,4 @@ allfuncs.extend(all_options) del(all_options) __all__ = tuple(allfuncs) del(allfuncs) -__version__ = "3.0rc11" +__version__ = "3.0rc12" diff --git a/tiramisu/config.py b/tiramisu/config.py index 1fdb3c0..7943abc 100644 --- a/tiramisu/config.py +++ b/tiramisu/config.py @@ -692,12 +692,14 @@ class _CommonConfig(SubConfig): child.parents.append(weakref.ref(duplicated_config)) if self.parents: if deep: + if metaconfig_prefix is not None and self._impl_path is not None: + metaconfig_prefix += self._impl_path for parent in self.parents: duplicated_config = parent().duplicate(deep=deep, - storage=storage, - metaconfig_prefix=metaconfig_prefix, - child=duplicated_config, - persistent=persistent) + storage=storage, + metaconfig_prefix=metaconfig_prefix, + child=duplicated_config, + persistent=persistent) else: duplicated_config.parents = self.parents for parent in self.parents: diff --git a/tiramisu/locale/fr/LC_MESSAGES/tiramisu.po b/tiramisu/locale/fr/LC_MESSAGES/tiramisu.po index 8b74072..637ef4c 100644 --- a/tiramisu/locale/fr/LC_MESSAGES/tiramisu.po +++ b/tiramisu/locale/fr/LC_MESSAGES/tiramisu.po @@ -1100,8 +1100,8 @@ msgstr "storage_type est déjà défini, impossible de le redéfinir" #: tiramisu/storage/dictionary/storage.py:44 #: tiramisu/storage/sqlite3/storage.py:129 -msgid "session \"{}\" already used" -msgstr "session \"{}\" en court d'utilisation" +msgid "session \"{}\" already exists" +msgstr "la session \"{}\" existe déjà" #: tiramisu/storage/dictionary/storage.py:46 msgid "a dictionary cannot be persistent" diff --git a/tiramisu/storage/dictionary/storage.py b/tiramisu/storage/dictionary/storage.py index b7269b6..becf891 100644 --- a/tiramisu/storage/dictionary/storage.py +++ b/tiramisu/storage/dictionary/storage.py @@ -41,7 +41,7 @@ class Storage: def __init__(self, session_id, persistent, test=False): if not test and session_id in _list_sessions: - raise ConflictError(_('session "{}" already used').format(session_id)) + raise ConflictError(_('session "{}" already exists').format(session_id)) if persistent: raise ValueError(_('a dictionary cannot be persistent')) self.session_id = session_id diff --git a/tiramisu/storage/sqlite3/storage.py b/tiramisu/storage/sqlite3/storage.py index b5f8df3..c4931fa 100644 --- a/tiramisu/storage/sqlite3/storage.py +++ b/tiramisu/storage/sqlite3/storage.py @@ -126,7 +126,7 @@ class Storage(object): self.execute('INSERT INTO session(session, persistent) VALUES (?, ?)', (session_id, persistent)) except sqlite3.IntegrityError: # pragma: no cover - raise ConflictError(_('session "{}" already used').format(session_id)) + raise ConflictError(_('session "{}" already exists').format(session_id)) self.session_id = self._cursor.lastrowid self.created = True