prefix metaconfig_prefix with current name

This commit is contained in:
Emmanuel Garette 2019-08-21 16:24:50 +02:00
parent 5ff47ac5c9
commit 82a91db16e
6 changed files with 15 additions and 9 deletions

View file

@ -1,3 +1,7 @@
Mon Aug 21 14:24:42 2019 +0200 Emmanuel Garette <egarette@cadoles.com>
* version 3.0 rc12
* prefix metaconfig_prefix with current name
Mon Aug 19 08:02:27 2019 +0200 Emmanuel Garette <egarette@cadoles.com> Mon Aug 19 08:02:27 2019 +0200 Emmanuel Garette <egarette@cadoles.com>
* version 3.0 rc11 * version 3.0 rc11
* Config could have multiple parents * Config could have multiple parents

View file

@ -45,4 +45,4 @@ allfuncs.extend(all_options)
del(all_options) del(all_options)
__all__ = tuple(allfuncs) __all__ = tuple(allfuncs)
del(allfuncs) del(allfuncs)
__version__ = "3.0rc11" __version__ = "3.0rc12"

View file

@ -692,12 +692,14 @@ class _CommonConfig(SubConfig):
child.parents.append(weakref.ref(duplicated_config)) child.parents.append(weakref.ref(duplicated_config))
if self.parents: if self.parents:
if deep: 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: for parent in self.parents:
duplicated_config = parent().duplicate(deep=deep, duplicated_config = parent().duplicate(deep=deep,
storage=storage, storage=storage,
metaconfig_prefix=metaconfig_prefix, metaconfig_prefix=metaconfig_prefix,
child=duplicated_config, child=duplicated_config,
persistent=persistent) persistent=persistent)
else: else:
duplicated_config.parents = self.parents duplicated_config.parents = self.parents
for parent in self.parents: for parent in self.parents:

View file

@ -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/dictionary/storage.py:44
#: tiramisu/storage/sqlite3/storage.py:129 #: tiramisu/storage/sqlite3/storage.py:129
msgid "session \"{}\" already used" msgid "session \"{}\" already exists"
msgstr "session \"{}\" en court d'utilisation" msgstr "la session \"{}\" existe déjà"
#: tiramisu/storage/dictionary/storage.py:46 #: tiramisu/storage/dictionary/storage.py:46
msgid "a dictionary cannot be persistent" msgid "a dictionary cannot be persistent"

View file

@ -41,7 +41,7 @@ class Storage:
def __init__(self, session_id, persistent, test=False): def __init__(self, session_id, persistent, test=False):
if not test and session_id in _list_sessions: 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: if persistent:
raise ValueError(_('a dictionary cannot be persistent')) raise ValueError(_('a dictionary cannot be persistent'))
self.session_id = session_id self.session_id = session_id

View file

@ -126,7 +126,7 @@ class Storage(object):
self.execute('INSERT INTO session(session, persistent) VALUES (?, ?)', self.execute('INSERT INTO session(session, persistent) VALUES (?, ?)',
(session_id, persistent)) (session_id, persistent))
except sqlite3.IntegrityError: # pragma: no cover 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.session_id = self._cursor.lastrowid
self.created = True self.created = True