can't assign to an OptionDescription

This commit is contained in:
Emmanuel Garette 2013-09-26 22:35:12 +02:00
parent 1d2008fd84
commit 3073940ca4
3 changed files with 23 additions and 13 deletions

View File

@ -185,7 +185,9 @@ class SubConfig(object):
homeconfig, name = self.cfgimpl_get_home_by_path(name)
return homeconfig.__setattr__(name, value)
child = getattr(self.cfgimpl_get_description(), name)
if not isinstance(child, SymLinkOption):
if isinstance(child, OptionDescription):
raise SyntaxError(_("can't assign to an OptionDescription"))
elif not isinstance(child, SymLinkOption):
if self._impl_path is None:
path = name
else:

View File

@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-09-26 22:24+CEST\n"
"POT-Creation-Date: 2013-09-26 22:33+CEST\n"
"PO-Revision-Date: \n"
"Last-Translator: Emmanuel Garette <egarette@cadoles.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -41,23 +41,27 @@ msgstr ""
"pas d'option description trouvé pour cette config (peut être une metaconfig "
"sans meta)"
#: tiramisu/config.py:318
#: tiramisu/config.py:189
msgid "can't assign to an OptionDescription"
msgstr "ne peut pas attribuer une valeur à une OptionDescription"
#: tiramisu/config.py:320
msgid "unknown type_ type {0}for _find"
msgstr "type_ type {0} pour _find inconnu"
#: tiramisu/config.py:357
#: tiramisu/config.py:359
msgid "no option found in config with these criteria"
msgstr "aucune option trouvée dans la config avec ces critères"
#: tiramisu/config.py:407
#: tiramisu/config.py:409
msgid "make_dict can't filtering with value without option"
msgstr "make_dict ne peut filtrer sur une valeur mais sans option"
#: tiramisu/config.py:428
#: tiramisu/config.py:430
msgid "unexpected path {0}, should start with {1}"
msgstr "chemin imprévu {0}, devrait commencer par {1}"
#: tiramisu/config.py:488
#: tiramisu/config.py:490
msgid "opt in getowner must be an option not {0}"
msgstr "opt dans getowner doit être une option pas {0}"

View File

@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2013-09-26 22:24+CEST\n"
"POT-Creation-Date: 2013-09-26 22:33+CEST\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -35,23 +35,27 @@ msgstr ""
msgid "no option description found for this config (may be metaconfig without meta)"
msgstr ""
#: tiramisu/config.py:318
#: tiramisu/config.py:189
msgid "can't assign to an OptionDescription"
msgstr ""
#: tiramisu/config.py:320
msgid "unknown type_ type {0}for _find"
msgstr ""
#: tiramisu/config.py:357
#: tiramisu/config.py:359
msgid "no option found in config with these criteria"
msgstr ""
#: tiramisu/config.py:407
#: tiramisu/config.py:409
msgid "make_dict can't filtering with value without option"
msgstr ""
#: tiramisu/config.py:428
#: tiramisu/config.py:430
msgid "unexpected path {0}, should start with {1}"
msgstr ""
#: tiramisu/config.py:488
#: tiramisu/config.py:490
msgid "opt in getowner must be an option not {0}"
msgstr ""