From b3d04a1f6825e67068e6f67236460b20aab01674 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Mon, 24 Mar 2014 21:13:26 +0100 Subject: [PATCH 1/5] update warning's message --- tiramisu/option.py | 6 +- translations/fr/tiramisu.po | 290 ++++++++++++++++++------------------ translations/tiramisu.pot | 288 +++++++++++++++++------------------ 3 files changed, 292 insertions(+), 292 deletions(-) diff --git a/tiramisu/option.py b/tiramisu/option.py index fee61b5..30277e2 100644 --- a/tiramisu/option.py +++ b/tiramisu/option.py @@ -802,13 +802,13 @@ class IPOption(Option): ip = IP('{0}/32'.format(value)) if not self._allow_reserved and ip.iptype() == 'RESERVED': if warnings_only: - msg = _("IP shouldn't be in reserved class") + msg = _("IP is in reserved class") else: msg = _("invalid IP, mustn't be in reserved class") raise ValueError(msg) if self._private_only and not ip.iptype() == 'PRIVATE': if warnings_only: - msg = _("IP should be in private class") + msg = _("IP is not in private class") else: msg = _("invalid IP, must be in private class") raise ValueError(msg) @@ -921,7 +921,7 @@ class NetworkOption(Option): ip = IP(value) if ip.iptype() == 'RESERVED': if warnings_only: - msg = _("network address shouldn't be in reserved class") + msg = _("network address is in reserved class") else: msg = _("invalid network address, mustn't be in reserved class") raise ValueError(msg) diff --git a/translations/fr/tiramisu.po b/translations/fr/tiramisu.po index 3dee004..0e1b339 100644 --- a/translations/fr/tiramisu.po +++ b/translations/fr/tiramisu.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Tiramisu\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-03-12 21:49+CET\n" +"POT-Creation-Date: 2014-03-24 19:54+CET\n" "PO-Revision-Date: \n" "Last-Translator: Emmanuel Garette \n" "Language-Team: Tiramisu's team \n" @@ -14,115 +14,115 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" "X-Poedit-SourceCharset: UTF-8\n" -#: tiramisu/autolib.py:162 +#: tiramisu/autolib.py:161 msgid "" "unable to carry out a calculation, option {0} has properties: {1} for: {2}" msgstr "" "impossible d'effectuer le calcul, l'option {0} a les propriétés : {1} pour : " "{2}" -#: tiramisu/config.py:52 +#: tiramisu/config.py:51 msgid "descr must be an optiondescription, not {0}" msgstr "descr doit être une optiondescription pas un {0}" -#: tiramisu/config.py:127 +#: tiramisu/config.py:126 msgid "unknown group_type: {0}" msgstr "group_type inconnu: {0}" -#: tiramisu/config.py:164 tiramisu/setting.py:339 tiramisu/value.py:57 -#: tiramisu/value.py:485 +#: tiramisu/config.py:163 tiramisu/setting.py:334 tiramisu/value.py:55 +#: tiramisu/value.py:483 msgid "the context does not exist anymore" msgstr "le context n'existe plus" -#: tiramisu/config.py:169 +#: tiramisu/config.py:168 msgid "no option description found for this config (may be GroupConfig)" msgstr "" "pas d'option description trouvé pour cette config (peut être un GroupConfig)" -#: tiramisu/config.py:195 +#: tiramisu/config.py:194 msgid "can't assign to an OptionDescription" msgstr "ne peut pas attribuer une valeur à une OptionDescription" -#: tiramisu/config.py:325 +#: tiramisu/config.py:324 msgid "unknown type_ type {0}for _find" msgstr "type_ type {0} pour _find inconnu" -#: tiramisu/config.py:364 +#: tiramisu/config.py:363 msgid "no option found in config with these criteria" msgstr "aucune option trouvée dans la config avec ces critères" -#: tiramisu/config.py:414 +#: tiramisu/config.py:413 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:435 +#: tiramisu/config.py:434 msgid "unexpected path {0}, should start with {1}" msgstr "chemin imprévu {0}, devrait commencer par {1}" -#: tiramisu/config.py:489 +#: tiramisu/config.py:491 msgid "opt in getowner must be an option not {0}" msgstr "opt dans getowner doit être une option pas {0}" -#: tiramisu/config.py:532 +#: tiramisu/config.py:534 msgid "cannot serialize Config with MetaConfig" msgstr "impossible de sérialiser une Config avec une MetaConfig" -#: tiramisu/config.py:546 +#: tiramisu/config.py:548 msgid "this storage is not serialisable, could be a none persistent storage" msgstr "ce storage n'est sérialisable, devrait être une storage non persistant" -#: tiramisu/config.py:609 +#: tiramisu/config.py:611 msgid "metaconfig's children must be a list" msgstr "enfants d'une metaconfig doit être une liste" -#: tiramisu/config.py:703 +#: tiramisu/config.py:705 msgid "metaconfig's children should be config, not {0}" msgstr "enfants d'une metaconfig doit être une config, pas {0}" -#: tiramisu/config.py:707 +#: tiramisu/config.py:709 msgid "child has already a metaconfig's" msgstr "enfant a déjà une metaconfig" -#: tiramisu/config.py:711 +#: tiramisu/config.py:713 msgid "all config in metaconfig must have the same optiondescription" msgstr "" "toutes les configs d'une metaconfig doivent avoir la même optiondescription" -#: tiramisu/option.py:67 +#: tiramisu/option.py:66 msgid "invalid name: {0} for option" msgstr "nom invalide : {0} pour l'option" -#: tiramisu/option.py:76 +#: tiramisu/option.py:75 msgid "invalid properties type {0} for {1}, must be a tuple" msgstr "type des properties invalide {0} pour {1}, doit être un tuple" -#: tiramisu/option.py:114 +#: tiramisu/option.py:113 msgid "'{0}' ({1}) object attribute '{2}' is read-only" msgstr "l'attribut {2} de l'objet '{0}' ({1}) est en lecture seule" -#: tiramisu/option.py:141 tiramisu/value.py:395 +#: tiramisu/option.py:140 tiramisu/value.py:393 msgid "information's item not found: {0}" msgstr "aucune config spécifiée alors que c'est nécessaire" -#: tiramisu/option.py:203 +#: tiramisu/option.py:202 msgid "cannot serialize Option, only in OptionDescription" msgstr "ne peut serialiser une Option, seulement via une OptionDescription" -#: tiramisu/option.py:306 +#: tiramisu/option.py:305 msgid "a default_multi is set whereas multi is False in option: {0}" msgstr "" "une default_multi est renseignée alors que multi est False dans l'option : " "{0}" -#: tiramisu/option.py:312 +#: tiramisu/option.py:311 msgid "invalid default_multi value {0} for option {1}: {2}" msgstr "la valeur default_multi est invalide {0} pour l'option {1} : {2}" -#: tiramisu/option.py:317 +#: tiramisu/option.py:316 msgid "default value not allowed if option: {0} is calculated" msgstr "la valeur par défaut n'est pas possible si l'option {0} est calculée" -#: tiramisu/option.py:320 +#: tiramisu/option.py:319 msgid "" "params defined for a callback function but no callback defined yet for " "option {0}" @@ -130,289 +130,289 @@ msgstr "" "params définis pour une fonction callback mais par de callback encore " "définis pour l'option {0}" -#: tiramisu/option.py:425 tiramisu/option.py:450 +#: tiramisu/option.py:424 tiramisu/option.py:454 msgid "invalid value for option {0}: {1}" msgstr "valeur invalide pour l'option {0} : {1}" -#: tiramisu/option.py:444 +#: tiramisu/option.py:448 msgid "warning on the value of the option {0}: {1}" msgstr "avertissement sur la valeur de l'option {0} : {1}" -#: tiramisu/option.py:461 +#: tiramisu/option.py:465 msgid "invalid value {0} for option {1} which must be a list" msgstr "valeur invalide pour l'option {0} : {1} laquelle doit être une liste" -#: tiramisu/option.py:519 +#: tiramisu/option.py:523 msgid "consistency must be set with an option" msgstr "consistency doit être configuré avec une option" -#: tiramisu/option.py:521 +#: tiramisu/option.py:525 msgid "cannot add consistency with itself" msgstr "ne peut ajouter une consistency avec lui même" -#: tiramisu/option.py:523 +#: tiramisu/option.py:527 msgid "every options in consistency must be multi or none" msgstr "" "toutes les options d'une consistency doivent être multi ou ne pas l'être" -#: tiramisu/option.py:544 +#: tiramisu/option.py:548 msgid "same value for {0} and {1}, should be different" msgstr "même valeur pour {0} et {1}, devrait être différent" -#: tiramisu/option.py:546 +#: tiramisu/option.py:550 msgid "same value for {0} and {1}, must be different" msgstr "même valeur pour {0} et {1}, doit être différent" -#: tiramisu/option.py:640 +#: tiramisu/option.py:644 msgid "values must be a tuple for {0}" msgstr "values doit être un tuple pour {0}" -#: tiramisu/option.py:643 +#: tiramisu/option.py:647 msgid "open_values must be a boolean for {0}" msgstr "open_values doit être un booléen pour {0}" -#: tiramisu/option.py:665 +#: tiramisu/option.py:669 msgid "value {0} is not permitted, only {1} is allowed" msgstr "valeur {0} n'est pas permis, seules {1} sont autorisées" -#: tiramisu/option.py:677 +#: tiramisu/option.py:681 msgid "invalid boolean" msgstr "booléen invalide" -#: tiramisu/option.py:687 +#: tiramisu/option.py:691 msgid "invalid integer" msgstr "nombre invalide" -#: tiramisu/option.py:697 +#: tiramisu/option.py:701 msgid "invalid float" msgstr "invalide nombre flottan" -#: tiramisu/option.py:707 +#: tiramisu/option.py:711 msgid "invalid string" msgstr "invalide caractère" -#: tiramisu/option.py:724 +#: tiramisu/option.py:728 msgid "invalid unicode" msgstr "invalide unicode" -#: tiramisu/option.py:736 +#: tiramisu/option.py:740 msgid "malformed symlinkoption must be an option for symlink {0}" msgstr "symlinkoption mal formé, doit être une option pour symlink {0}" -#: tiramisu/option.py:787 tiramisu/option.py:790 tiramisu/option.py:795 +#: tiramisu/option.py:791 tiramisu/option.py:794 tiramisu/option.py:799 msgid "invalid IP" msgstr "adresse IP invalide" -#: tiramisu/option.py:801 -msgid "IP shouldn't be in reserved class" -msgstr "l'adresse IP ne devrait pas être d'une classe réservée" +#: tiramisu/option.py:805 +msgid "IP is in reserved class" +msgstr "l'adresse IP est dans une plage d'adresse réservée" -#: tiramisu/option.py:803 +#: tiramisu/option.py:807 msgid "invalid IP, mustn't be in reserved class" msgstr "adresse IP invalide, ne doit pas être dans une classe réservée" -#: tiramisu/option.py:807 -msgid "IP should be in private class" -msgstr "l'adresse IP devrait être dans une classe privée" +#: tiramisu/option.py:811 +msgid "IP is not in private class" +msgstr "l'adresse IP n'est pas dans une plage d'adressage privée" -#: tiramisu/option.py:809 +#: tiramisu/option.py:813 msgid "invalid IP, must be in private class" msgstr "adresse IP invalide, doit être dans la classe privée" -#: tiramisu/option.py:814 tiramisu/option.py:989 +#: tiramisu/option.py:818 tiramisu/option.py:993 msgid "invalid len for vals" msgstr "longueur invalide pour vals" -#: tiramisu/option.py:820 +#: tiramisu/option.py:824 msgid "IP {0} ({1}) not in network {2} ({3}) with netmask {4} ({5})" msgstr "IP {0} ({1}) pas dans le réseau {2} ({3}) avec le masque {4} ({5})" -#: tiramisu/option.py:823 +#: tiramisu/option.py:827 msgid "invalid IP {0} ({1}) not in network {2} ({3}) with netmask {4} ({5})" msgstr "" "IP invalide {0} ({1}) pas dans le réseau {2} ({3}) avec le masque {4} ({5})" -#: tiramisu/option.py:864 +#: tiramisu/option.py:868 msgid "inconsistency in allowed range" msgstr "inconsistence dans la plage autorisée" -#: tiramisu/option.py:869 +#: tiramisu/option.py:873 msgid "max value is empty" msgstr "la valeur maximum est vide" -#: tiramisu/option.py:886 +#: tiramisu/option.py:890 msgid "invalid port, range must have two values only" msgstr "port invalide, une plage doit avoir deux valeurs seulement" -#: tiramisu/option.py:889 +#: tiramisu/option.py:893 msgid "invalid port, first port in range must be smaller than the second one" msgstr "" "port invalide, le premier port d'une plage doit être plus petit que le second" -#: tiramisu/option.py:898 +#: tiramisu/option.py:902 msgid "invalid port" msgstr "port invalide" -#: tiramisu/option.py:900 +#: tiramisu/option.py:904 msgid "invalid port, must be an between {0} and {1}" msgstr "port invalide, port doit être entre {0} et {1}" -#: tiramisu/option.py:914 +#: tiramisu/option.py:918 msgid "invalid network address" msgstr "adresse réseau invalide" -#: tiramisu/option.py:920 -msgid "network address shouldn't be in reserved class" -msgstr "l'adresse réseau ne devait pas être dans la classe réservée" +#: tiramisu/option.py:924 +msgid "network address is in reserved class" +msgstr "l'adresse réseau est pas dans une plage d'adresse réservée" -#: tiramisu/option.py:922 +#: tiramisu/option.py:926 msgid "invalid network address, mustn't be in reserved class" msgstr "adresse réseau invalide, ne doit pas être dans la classe réservée" -#: tiramisu/option.py:935 +#: tiramisu/option.py:939 msgid "invalid netmask address" msgstr "masque de sous-réseau invalide" -#: tiramisu/option.py:952 +#: tiramisu/option.py:956 msgid "invalid len for opts" msgstr "longueur invalide pour opts" -#: tiramisu/option.py:966 +#: tiramisu/option.py:970 msgid "invalid IP {0} ({1}) with netmask {2}, this IP is a network" msgstr "IP invalide {0} ({1}) avec masque {2}, cette IP est un réseau" -#: tiramisu/option.py:971 +#: tiramisu/option.py:975 msgid "invalid network {0} ({1}) with netmask {2}" msgstr "réseau invalide {0} ({1}) avec masque {2}" -#: tiramisu/option.py:985 +#: tiramisu/option.py:989 msgid "invalid broadcast address" msgstr "adresse de broadcast invalide" -#: tiramisu/option.py:994 +#: tiramisu/option.py:998 msgid "" "invalid broadcast {0} ({1}) with network {2} ({3}) and netmask {4} ({5})" msgstr "" "Broadcast invalide {0} ({1}) avec le réseau {2} ({3}) et le masque {4} ({5})" -#: tiramisu/option.py:1016 +#: tiramisu/option.py:1020 msgid "unknown type_ {0} for hostname" msgstr "type_ inconnu {0} pour le nom d'hôte" -#: tiramisu/option.py:1019 +#: tiramisu/option.py:1023 msgid "allow_ip must be a boolean" msgstr "allow_ip doit être un booléen" -#: tiramisu/option.py:1021 +#: tiramisu/option.py:1025 msgid "allow_without_dot must be a boolean" msgstr "allow_without_dot doit être un booléen" -#: tiramisu/option.py:1065 +#: tiramisu/option.py:1069 msgid "invalid domainname, must have dot" msgstr "nom de domaine invalide, doit avoir un point" -#: tiramisu/option.py:1067 +#: tiramisu/option.py:1071 msgid "invalid domainname's length (max 255)" msgstr "longueur du nom de domaine invalide (maximum {1})" -#: tiramisu/option.py:1069 +#: tiramisu/option.py:1073 msgid "invalid domainname's length (min 2)" msgstr "longueur du nom de domaine invalide (minimum 2)" -#: tiramisu/option.py:1071 +#: tiramisu/option.py:1075 msgid "invalid domainname" msgstr "nom de domaine invalide" -#: tiramisu/option.py:1084 +#: tiramisu/option.py:1088 msgid "invalid email address, must contains one @" msgstr "adresse email invalide, doit contenir un @" -#: tiramisu/option.py:1087 +#: tiramisu/option.py:1091 msgid "invalid username in email address" msgstr "nom d'utilisateur invalide dans une adresse email" -#: tiramisu/option.py:1100 +#: tiramisu/option.py:1104 msgid "invalid url, must start with http:// or https://" msgstr "URL invalide, doit démarrer avec http:// ou https://" -#: tiramisu/option.py:1119 +#: tiramisu/option.py:1123 msgid "invalid url, port must be an between 0 and 65536" msgstr "URL invalide, port doit être entre 0 et 65536" -#: tiramisu/option.py:1125 +#: tiramisu/option.py:1129 msgid "invalid url, must ends with filename" msgstr "URL invalide, doit finir avec un nom de fichier" -#: tiramisu/option.py:1137 +#: tiramisu/option.py:1141 msgid "invalid username" msgstr "utilisateur invalide" -#: tiramisu/option.py:1148 +#: tiramisu/option.py:1152 msgid "invalid filename" msgstr "nom de fichier invalide" -#: tiramisu/option.py:1175 +#: tiramisu/option.py:1179 msgid "duplicate option name: {0}" msgstr "nom de l'option dupliqué : {0}" -#: tiramisu/option.py:1193 +#: tiramisu/option.py:1197 msgid "unknown Option {0} in OptionDescription {1}" msgstr "Option {0} inconnue pour l'OptionDescription {1}" -#: tiramisu/option.py:1244 +#: tiramisu/option.py:1248 msgid "duplicate option: {0}" msgstr "option dupliquée : {0}" -#: tiramisu/option.py:1275 +#: tiramisu/option.py:1279 msgid "consistency with option {0} which is not in Config" msgstr "consistency avec l'option {0} qui n'est pas dans une Config" -#: tiramisu/option.py:1283 +#: tiramisu/option.py:1287 msgid "no option for path {0}" msgstr "pas d'option pour le chemin {0}" -#: tiramisu/option.py:1289 +#: tiramisu/option.py:1293 msgid "no option {0} found" msgstr "pas d'option {0} trouvée" -#: tiramisu/option.py:1299 +#: tiramisu/option.py:1303 msgid "cannot change group_type if already set (old {0}, new {1})" msgstr "ne peut changer group_type si déjà spécifié (ancien {0}, nouveau {1})" -#: tiramisu/option.py:1311 +#: tiramisu/option.py:1315 msgid "master group {0} shall not have a subgroup" msgstr "groupe maître {0} ne doit pas avoir de sous-groupe" -#: tiramisu/option.py:1314 +#: tiramisu/option.py:1318 msgid "master group {0} shall not have a symlinkoption" msgstr "groupe maître {0} ne doit pas avoir de symlinkoption" -#: tiramisu/option.py:1317 +#: tiramisu/option.py:1321 msgid "not allowed option {0} in group {1}: this option is not a multi" msgstr "" "option non autorisée {0} dans le groupe {1} : cette option n'est pas une " "multi" -#: tiramisu/option.py:1327 +#: tiramisu/option.py:1331 msgid "master group with wrong master name for {0}" msgstr "le groupe maître avec un nom de maître érroné pour {0}" -#: tiramisu/option.py:1335 +#: tiramisu/option.py:1339 msgid "callback of master's option shall not refered a slave's ones" msgstr "" "callback d'une variable maitre ne devrait pas référencer des variables " "esclaves" -#: tiramisu/option.py:1343 +#: tiramisu/option.py:1347 msgid "group_type: {0} not allowed" msgstr "group_type : {0} non autorisé" -#: tiramisu/option.py:1443 +#: tiramisu/option.py:1444 msgid "malformed requirements type for option: {0}, must be a dict" msgstr "" "type requirements malformé pour l'option : {0}, doit être un dictionnaire" -#: tiramisu/option.py:1460 +#: tiramisu/option.py:1461 msgid "" "malformed requirements for option: {0} require must have option, expected " "and action keys" @@ -420,110 +420,110 @@ msgstr "" "requirements malformé pour l'option : {0} l'exigence doit avoir les clefs " "option, expected et action" -#: tiramisu/option.py:1465 +#: tiramisu/option.py:1466 msgid "malformed requirements for option: {0} inverse must be boolean" msgstr "" "requirements mal formés pour l'option : {0} inverse doit être un booléen" -#: tiramisu/option.py:1469 +#: tiramisu/option.py:1470 msgid "malformed requirements for option: {0} transitive must be boolean" msgstr "" "requirements mal formés pour l'option : {0} transitive doit être booléen" -#: tiramisu/option.py:1473 +#: tiramisu/option.py:1474 msgid "malformed requirements for option: {0} same_action must be boolean" msgstr "" "requirements mal formés pour l'option : {0} same_action doit être un booléen" -#: tiramisu/option.py:1477 +#: tiramisu/option.py:1478 msgid "malformed requirements must be an option in option {0}" msgstr "requirements mal formés doit être une option dans l'option {0}" -#: tiramisu/option.py:1480 +#: tiramisu/option.py:1481 msgid "malformed requirements option {0} must not be a multi" msgstr "requirements mal formés l'option {0} ne doit pas être une multi" -#: tiramisu/option.py:1486 +#: tiramisu/option.py:1487 msgid "" "malformed requirements second argument must be valid for option {0}: {1}" msgstr "" "requirements mal formés deuxième argument doit être valide pour l'option " "{0} : {1}" -#: tiramisu/option.py:1491 +#: tiramisu/option.py:1492 msgid "inconsistency in action types for option: {0} action: {1}" msgstr "incohérence dans les types action pour l'option : {0} action {1}" -#: tiramisu/option.py:1516 +#: tiramisu/option.py:1517 msgid "{0} must be a function" msgstr "{0} doit être une fonction" -#: tiramisu/option.py:1519 +#: tiramisu/option.py:1520 msgid "{0}_params must be a dict" msgstr "{0}_params doit être un dict" -#: tiramisu/option.py:1522 +#: tiramisu/option.py:1523 msgid "{0}_params with key {1} mustn't have length different to 1" msgstr "" "{0}_params avec la clef {1} ne doit pas avoir une longueur différent de 1" -#: tiramisu/option.py:1526 +#: tiramisu/option.py:1527 msgid "{0}_params must be tuple for key \"{1}\"" msgstr "{0}_params doit être un tuple pour la clef \"{1}\"" -#: tiramisu/option.py:1532 +#: tiramisu/option.py:1533 msgid "validator not support tuple" msgstr "validator n'accepte pas de tuple" -#: tiramisu/option.py:1535 +#: tiramisu/option.py:1536 msgid "{0}_params must have an option not a {0} for first argument" msgstr "{0}_params doit avoir une option pas un {0} pour premier argument" -#: tiramisu/option.py:1539 +#: tiramisu/option.py:1540 msgid "{0}_params must have a boolean not a {0} for second argument" msgstr "{0}_params doit avoir un booléen pas un {0} pour second argument" -#: tiramisu/setting.py:116 +#: tiramisu/setting.py:111 msgid "can't rebind {0}" msgstr "ne peut redéfinir ({0})" -#: tiramisu/setting.py:121 +#: tiramisu/setting.py:116 msgid "can't unbind {0}" msgstr "ne peut supprimer ({0})" -#: tiramisu/setting.py:272 +#: tiramisu/setting.py:267 msgid "cannot append {0} property for option {1}: this property is calculated" msgstr "" "ne peut ajouter la propriété {0} dans l'option {1}: cette propriété est " "calculée" -#: tiramisu/setting.py:363 +#: tiramisu/setting.py:358 msgid "opt and all_properties must not be set together in reset" msgstr "opt et all_properties ne doit pas être renseigné ensemble dans reset" -#: tiramisu/setting.py:378 +#: tiramisu/setting.py:373 msgid "if opt is not None, path should not be None in _getproperties" msgstr "" "si opt n'est pas None, path devrait ne pas être à None dans _getproperties" -#: tiramisu/setting.py:487 +#: tiramisu/setting.py:482 msgid "cannot change the value for option {0} this option is frozen" msgstr "" "ne peut modifier la valeur de l'option {0} cette option n'est pas modifiable" -#: tiramisu/setting.py:493 +#: tiramisu/setting.py:488 msgid "trying to access to an option named: {0} with properties {1}" msgstr "tentative d'accès à une option nommée : {0} avec les propriétés {1}" -#: tiramisu/setting.py:511 +#: tiramisu/setting.py:506 msgid "permissive must be a tuple" msgstr "permissive doit être un tuple" -#: tiramisu/setting.py:518 tiramisu/value.py:334 +#: tiramisu/setting.py:513 tiramisu/value.py:332 msgid "invalid generic owner {0}" msgstr "invalide owner générique {0}" -#: tiramisu/setting.py:606 +#: tiramisu/setting.py:601 msgid "" "malformed requirements imbrication detected for option: '{0}' with " "requirement on: '{1}'" @@ -531,77 +531,77 @@ msgstr "" "imbrication de requirements mal formés detectée pour l'option : '{0}' avec " "requirement sur : '{1}'" -#: tiramisu/setting.py:617 +#: tiramisu/setting.py:612 msgid "option '{0}' has requirement's property error: {1} {2}" msgstr "l'option '{0}' a une erreur de propriété pour le requirement : {1} {2}" -#: tiramisu/storage/__init__.py:52 +#: tiramisu/storage/__init__.py:47 msgid "storage_type is already set, cannot rebind it" msgstr "storage_type est déjà défini, impossible de le redéfinir" -#: tiramisu/storage/__init__.py:86 +#: tiramisu/storage/__init__.py:81 msgid "option {0} not already exists in storage {1}" msgstr "option {0} n'existe pas dans l'espace de stockage {1}" -#: tiramisu/storage/dictionary/storage.py:39 +#: tiramisu/storage/dictionary/storage.py:37 msgid "dictionary storage cannot delete session" msgstr "" "impossible de supprimer une session dans un espace de stockage dictionary" -#: tiramisu/storage/dictionary/storage.py:50 +#: tiramisu/storage/dictionary/storage.py:48 msgid "session already used" msgstr "session déjà utilisée" -#: tiramisu/storage/dictionary/storage.py:52 +#: tiramisu/storage/dictionary/storage.py:50 msgid "a dictionary cannot be persistent" msgstr "un espace de stockage dictionary ne peut être persistant" -#: tiramisu/value.py:341 +#: tiramisu/value.py:339 msgid "no value for {0} cannot change owner to {1}" msgstr "pas de valeur pour {0} ne peut changer d'utilisateur pour {1}" -#: tiramisu/value.py:423 +#: tiramisu/value.py:421 msgid "can force cache only if cache is actived in config" msgstr "" "peut force la mise en cache seulement si le cache est activé dans la config" -#: tiramisu/value.py:462 +#: tiramisu/value.py:460 msgid "{0} is already a Multi " msgstr "{0} est déjà une Multi" -#: tiramisu/value.py:498 tiramisu/value.py:562 +#: tiramisu/value.py:496 tiramisu/value.py:560 msgid "invalid len for the slave: {0} which has {1} as master" msgstr "longueur invalide pour une esclave : {0} qui a {1} comme maître" -#: tiramisu/value.py:534 +#: tiramisu/value.py:532 msgid "cannot append a value on a multi option {0} which is a slave" msgstr "ne peut ajouter une valeur sur l'option multi {0} qui est une esclave" -#: tiramisu/value.py:572 +#: tiramisu/value.py:570 msgid "cannot sort multi option {0} if master or slave" msgstr "ne peut trier une option multi {0} pour une maître ou une esclave" -#: tiramisu/value.py:576 +#: tiramisu/value.py:574 msgid "cmp is not permitted in python v3 or greater" msgstr "cmp n'est pas permis en python v3 ou supérieure" -#: tiramisu/value.py:585 +#: tiramisu/value.py:583 msgid "cannot reverse multi option {0} if master or slave" msgstr "ne peut inverser une option multi {0} pour une maître ou une esclave" -#: tiramisu/value.py:593 +#: tiramisu/value.py:591 msgid "cannot insert multi option {0} if master or slave" msgstr "ne peut insérer une option multi {0} pour une maître ou une esclave" -#: tiramisu/value.py:601 +#: tiramisu/value.py:599 msgid "cannot extend multi option {0} if master or slave" msgstr "ne peut étendre une option multi {0} pour une maître ou une esclave" -#: tiramisu/value.py:612 +#: tiramisu/value.py:610 msgid "invalid value {0} for option {1}: {2}" msgstr "valeur invalide {0} pour l'option {1} : {2}" -#: tiramisu/value.py:630 +#: tiramisu/value.py:628 msgid "cannot pop a value on a multi option {0} which is a slave" msgstr "ne peut supprimer une valeur dans l'option multi {0} qui est esclave" diff --git a/translations/tiramisu.pot b/translations/tiramisu.pot index 81a388e..eb41967 100644 --- a/translations/tiramisu.pot +++ b/translations/tiramisu.pot @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2014-03-12 21:49+CET\n" +"POT-Creation-Date: 2014-03-24 19:54+CET\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -15,552 +15,552 @@ msgstr "" "Generated-By: pygettext.py 1.5\n" -#: tiramisu/autolib.py:162 +#: tiramisu/autolib.py:161 msgid "unable to carry out a calculation, option {0} has properties: {1} for: {2}" msgstr "" -#: tiramisu/config.py:52 +#: tiramisu/config.py:51 msgid "descr must be an optiondescription, not {0}" msgstr "" -#: tiramisu/config.py:127 +#: tiramisu/config.py:126 msgid "unknown group_type: {0}" msgstr "" -#: tiramisu/config.py:164 tiramisu/setting.py:339 tiramisu/value.py:57 -#: tiramisu/value.py:485 +#: tiramisu/config.py:163 tiramisu/setting.py:334 tiramisu/value.py:55 +#: tiramisu/value.py:483 msgid "the context does not exist anymore" msgstr "" -#: tiramisu/config.py:169 +#: tiramisu/config.py:168 msgid "no option description found for this config (may be GroupConfig)" msgstr "" -#: tiramisu/config.py:195 +#: tiramisu/config.py:194 msgid "can't assign to an OptionDescription" msgstr "" -#: tiramisu/config.py:325 +#: tiramisu/config.py:324 msgid "unknown type_ type {0}for _find" msgstr "" -#: tiramisu/config.py:364 +#: tiramisu/config.py:363 msgid "no option found in config with these criteria" msgstr "" -#: tiramisu/config.py:414 +#: tiramisu/config.py:413 msgid "make_dict can't filtering with value without option" msgstr "" -#: tiramisu/config.py:435 +#: tiramisu/config.py:434 msgid "unexpected path {0}, should start with {1}" msgstr "" -#: tiramisu/config.py:489 +#: tiramisu/config.py:491 msgid "opt in getowner must be an option not {0}" msgstr "" -#: tiramisu/config.py:532 +#: tiramisu/config.py:534 msgid "cannot serialize Config with MetaConfig" msgstr "" -#: tiramisu/config.py:546 +#: tiramisu/config.py:548 msgid "this storage is not serialisable, could be a none persistent storage" msgstr "" -#: tiramisu/config.py:609 +#: tiramisu/config.py:611 msgid "metaconfig's children must be a list" msgstr "" -#: tiramisu/config.py:703 +#: tiramisu/config.py:705 msgid "metaconfig's children should be config, not {0}" msgstr "" -#: tiramisu/config.py:707 +#: tiramisu/config.py:709 msgid "child has already a metaconfig's" msgstr "" -#: tiramisu/config.py:711 +#: tiramisu/config.py:713 msgid "all config in metaconfig must have the same optiondescription" msgstr "" -#: tiramisu/option.py:67 +#: tiramisu/option.py:66 msgid "invalid name: {0} for option" msgstr "" -#: tiramisu/option.py:76 +#: tiramisu/option.py:75 msgid "invalid properties type {0} for {1}, must be a tuple" msgstr "" -#: tiramisu/option.py:114 +#: tiramisu/option.py:113 msgid "'{0}' ({1}) object attribute '{2}' is read-only" msgstr "" -#: tiramisu/option.py:141 tiramisu/value.py:395 +#: tiramisu/option.py:140 tiramisu/value.py:393 msgid "information's item not found: {0}" msgstr "" -#: tiramisu/option.py:203 +#: tiramisu/option.py:202 msgid "cannot serialize Option, only in OptionDescription" msgstr "" -#: tiramisu/option.py:306 +#: tiramisu/option.py:305 msgid "a default_multi is set whereas multi is False in option: {0}" msgstr "" -#: tiramisu/option.py:312 +#: tiramisu/option.py:311 msgid "invalid default_multi value {0} for option {1}: {2}" msgstr "" -#: tiramisu/option.py:317 +#: tiramisu/option.py:316 msgid "default value not allowed if option: {0} is calculated" msgstr "" -#: tiramisu/option.py:320 +#: tiramisu/option.py:319 msgid "params defined for a callback function but no callback defined yet for option {0}" msgstr "" -#: tiramisu/option.py:425 tiramisu/option.py:450 +#: tiramisu/option.py:424 tiramisu/option.py:454 msgid "invalid value for option {0}: {1}" msgstr "" -#: tiramisu/option.py:444 +#: tiramisu/option.py:448 msgid "warning on the value of the option {0}: {1}" msgstr "" -#: tiramisu/option.py:461 +#: tiramisu/option.py:465 msgid "invalid value {0} for option {1} which must be a list" msgstr "" -#: tiramisu/option.py:519 +#: tiramisu/option.py:523 msgid "consistency must be set with an option" msgstr "" -#: tiramisu/option.py:521 +#: tiramisu/option.py:525 msgid "cannot add consistency with itself" msgstr "" -#: tiramisu/option.py:523 +#: tiramisu/option.py:527 msgid "every options in consistency must be multi or none" msgstr "" -#: tiramisu/option.py:544 +#: tiramisu/option.py:548 msgid "same value for {0} and {1}, should be different" msgstr "" -#: tiramisu/option.py:546 +#: tiramisu/option.py:550 msgid "same value for {0} and {1}, must be different" msgstr "" -#: tiramisu/option.py:640 +#: tiramisu/option.py:644 msgid "values must be a tuple for {0}" msgstr "" -#: tiramisu/option.py:643 +#: tiramisu/option.py:647 msgid "open_values must be a boolean for {0}" msgstr "" -#: tiramisu/option.py:665 +#: tiramisu/option.py:669 msgid "value {0} is not permitted, only {1} is allowed" msgstr "" -#: tiramisu/option.py:677 +#: tiramisu/option.py:681 msgid "invalid boolean" msgstr "" -#: tiramisu/option.py:687 +#: tiramisu/option.py:691 msgid "invalid integer" msgstr "" -#: tiramisu/option.py:697 +#: tiramisu/option.py:701 msgid "invalid float" msgstr "" -#: tiramisu/option.py:707 +#: tiramisu/option.py:711 msgid "invalid string" msgstr "" -#: tiramisu/option.py:724 +#: tiramisu/option.py:728 msgid "invalid unicode" msgstr "" -#: tiramisu/option.py:736 +#: tiramisu/option.py:740 msgid "malformed symlinkoption must be an option for symlink {0}" msgstr "" -#: tiramisu/option.py:787 tiramisu/option.py:790 tiramisu/option.py:795 +#: tiramisu/option.py:791 tiramisu/option.py:794 tiramisu/option.py:799 msgid "invalid IP" msgstr "" -#: tiramisu/option.py:801 -msgid "IP shouldn't be in reserved class" -msgstr "" - -#: tiramisu/option.py:803 -msgid "invalid IP, mustn't be in reserved class" +#: tiramisu/option.py:805 +msgid "IP is in reserved class" msgstr "" #: tiramisu/option.py:807 -msgid "IP should be in private class" +msgid "invalid IP, mustn't be in reserved class" msgstr "" -#: tiramisu/option.py:809 +#: tiramisu/option.py:811 +msgid "IP is not in private class" +msgstr "" + +#: tiramisu/option.py:813 msgid "invalid IP, must be in private class" msgstr "" -#: tiramisu/option.py:814 tiramisu/option.py:989 +#: tiramisu/option.py:818 tiramisu/option.py:993 msgid "invalid len for vals" msgstr "" -#: tiramisu/option.py:820 +#: tiramisu/option.py:824 msgid "IP {0} ({1}) not in network {2} ({3}) with netmask {4} ({5})" msgstr "" -#: tiramisu/option.py:823 +#: tiramisu/option.py:827 msgid "invalid IP {0} ({1}) not in network {2} ({3}) with netmask {4} ({5})" msgstr "" -#: tiramisu/option.py:864 +#: tiramisu/option.py:868 msgid "inconsistency in allowed range" msgstr "" -#: tiramisu/option.py:869 +#: tiramisu/option.py:873 msgid "max value is empty" msgstr "" -#: tiramisu/option.py:886 +#: tiramisu/option.py:890 msgid "invalid port, range must have two values only" msgstr "" -#: tiramisu/option.py:889 +#: tiramisu/option.py:893 msgid "invalid port, first port in range must be smaller than the second one" msgstr "" -#: tiramisu/option.py:898 +#: tiramisu/option.py:902 msgid "invalid port" msgstr "" -#: tiramisu/option.py:900 +#: tiramisu/option.py:904 msgid "invalid port, must be an between {0} and {1}" msgstr "" -#: tiramisu/option.py:914 +#: tiramisu/option.py:918 msgid "invalid network address" msgstr "" -#: tiramisu/option.py:920 -msgid "network address shouldn't be in reserved class" +#: tiramisu/option.py:924 +msgid "network address is in reserved class" msgstr "" -#: tiramisu/option.py:922 +#: tiramisu/option.py:926 msgid "invalid network address, mustn't be in reserved class" msgstr "" -#: tiramisu/option.py:935 +#: tiramisu/option.py:939 msgid "invalid netmask address" msgstr "" -#: tiramisu/option.py:952 +#: tiramisu/option.py:956 msgid "invalid len for opts" msgstr "" -#: tiramisu/option.py:966 +#: tiramisu/option.py:970 msgid "invalid IP {0} ({1}) with netmask {2}, this IP is a network" msgstr "" -#: tiramisu/option.py:971 +#: tiramisu/option.py:975 msgid "invalid network {0} ({1}) with netmask {2}" msgstr "" -#: tiramisu/option.py:985 +#: tiramisu/option.py:989 msgid "invalid broadcast address" msgstr "" -#: tiramisu/option.py:994 +#: tiramisu/option.py:998 msgid "invalid broadcast {0} ({1}) with network {2} ({3}) and netmask {4} ({5})" msgstr "" -#: tiramisu/option.py:1016 +#: tiramisu/option.py:1020 msgid "unknown type_ {0} for hostname" msgstr "" -#: tiramisu/option.py:1019 +#: tiramisu/option.py:1023 msgid "allow_ip must be a boolean" msgstr "" -#: tiramisu/option.py:1021 +#: tiramisu/option.py:1025 msgid "allow_without_dot must be a boolean" msgstr "" -#: tiramisu/option.py:1065 +#: tiramisu/option.py:1069 msgid "invalid domainname, must have dot" msgstr "" -#: tiramisu/option.py:1067 +#: tiramisu/option.py:1071 msgid "invalid domainname's length (max 255)" msgstr "" -#: tiramisu/option.py:1069 +#: tiramisu/option.py:1073 msgid "invalid domainname's length (min 2)" msgstr "" -#: tiramisu/option.py:1071 +#: tiramisu/option.py:1075 msgid "invalid domainname" msgstr "" -#: tiramisu/option.py:1084 +#: tiramisu/option.py:1088 msgid "invalid email address, must contains one @" msgstr "" -#: tiramisu/option.py:1087 +#: tiramisu/option.py:1091 msgid "invalid username in email address" msgstr "" -#: tiramisu/option.py:1100 +#: tiramisu/option.py:1104 msgid "invalid url, must start with http:// or https://" msgstr "" -#: tiramisu/option.py:1119 +#: tiramisu/option.py:1123 msgid "invalid url, port must be an between 0 and 65536" msgstr "" -#: tiramisu/option.py:1125 +#: tiramisu/option.py:1129 msgid "invalid url, must ends with filename" msgstr "" -#: tiramisu/option.py:1137 +#: tiramisu/option.py:1141 msgid "invalid username" msgstr "" -#: tiramisu/option.py:1148 +#: tiramisu/option.py:1152 msgid "invalid filename" msgstr "" -#: tiramisu/option.py:1175 +#: tiramisu/option.py:1179 msgid "duplicate option name: {0}" msgstr "" -#: tiramisu/option.py:1193 +#: tiramisu/option.py:1197 msgid "unknown Option {0} in OptionDescription {1}" msgstr "" -#: tiramisu/option.py:1244 +#: tiramisu/option.py:1248 msgid "duplicate option: {0}" msgstr "" -#: tiramisu/option.py:1275 +#: tiramisu/option.py:1279 msgid "consistency with option {0} which is not in Config" msgstr "" -#: tiramisu/option.py:1283 +#: tiramisu/option.py:1287 msgid "no option for path {0}" msgstr "" -#: tiramisu/option.py:1289 +#: tiramisu/option.py:1293 msgid "no option {0} found" msgstr "" -#: tiramisu/option.py:1299 +#: tiramisu/option.py:1303 msgid "cannot change group_type if already set (old {0}, new {1})" msgstr "" -#: tiramisu/option.py:1311 +#: tiramisu/option.py:1315 msgid "master group {0} shall not have a subgroup" msgstr "" -#: tiramisu/option.py:1314 +#: tiramisu/option.py:1318 msgid "master group {0} shall not have a symlinkoption" msgstr "" -#: tiramisu/option.py:1317 +#: tiramisu/option.py:1321 msgid "not allowed option {0} in group {1}: this option is not a multi" msgstr "" -#: tiramisu/option.py:1327 +#: tiramisu/option.py:1331 msgid "master group with wrong master name for {0}" msgstr "" -#: tiramisu/option.py:1335 +#: tiramisu/option.py:1339 msgid "callback of master's option shall not refered a slave's ones" msgstr "" -#: tiramisu/option.py:1343 +#: tiramisu/option.py:1347 msgid "group_type: {0} not allowed" msgstr "" -#: tiramisu/option.py:1443 +#: tiramisu/option.py:1444 msgid "malformed requirements type for option: {0}, must be a dict" msgstr "" -#: tiramisu/option.py:1460 +#: tiramisu/option.py:1461 msgid "malformed requirements for option: {0} require must have option, expected and action keys" msgstr "" -#: tiramisu/option.py:1465 +#: tiramisu/option.py:1466 msgid "malformed requirements for option: {0} inverse must be boolean" msgstr "" -#: tiramisu/option.py:1469 +#: tiramisu/option.py:1470 msgid "malformed requirements for option: {0} transitive must be boolean" msgstr "" -#: tiramisu/option.py:1473 +#: tiramisu/option.py:1474 msgid "malformed requirements for option: {0} same_action must be boolean" msgstr "" -#: tiramisu/option.py:1477 +#: tiramisu/option.py:1478 msgid "malformed requirements must be an option in option {0}" msgstr "" -#: tiramisu/option.py:1480 +#: tiramisu/option.py:1481 msgid "malformed requirements option {0} must not be a multi" msgstr "" -#: tiramisu/option.py:1486 +#: tiramisu/option.py:1487 msgid "malformed requirements second argument must be valid for option {0}: {1}" msgstr "" -#: tiramisu/option.py:1491 +#: tiramisu/option.py:1492 msgid "inconsistency in action types for option: {0} action: {1}" msgstr "" -#: tiramisu/option.py:1516 +#: tiramisu/option.py:1517 msgid "{0} must be a function" msgstr "" -#: tiramisu/option.py:1519 +#: tiramisu/option.py:1520 msgid "{0}_params must be a dict" msgstr "" -#: tiramisu/option.py:1522 +#: tiramisu/option.py:1523 msgid "{0}_params with key {1} mustn't have length different to 1" msgstr "" -#: tiramisu/option.py:1526 +#: tiramisu/option.py:1527 msgid "{0}_params must be tuple for key \"{1}\"" msgstr "" -#: tiramisu/option.py:1532 +#: tiramisu/option.py:1533 msgid "validator not support tuple" msgstr "" -#: tiramisu/option.py:1535 +#: tiramisu/option.py:1536 msgid "{0}_params must have an option not a {0} for first argument" msgstr "" -#: tiramisu/option.py:1539 +#: tiramisu/option.py:1540 msgid "{0}_params must have a boolean not a {0} for second argument" msgstr "" -#: tiramisu/setting.py:116 +#: tiramisu/setting.py:111 msgid "can't rebind {0}" msgstr "" -#: tiramisu/setting.py:121 +#: tiramisu/setting.py:116 msgid "can't unbind {0}" msgstr "" -#: tiramisu/setting.py:272 +#: tiramisu/setting.py:267 msgid "cannot append {0} property for option {1}: this property is calculated" msgstr "" -#: tiramisu/setting.py:363 +#: tiramisu/setting.py:358 msgid "opt and all_properties must not be set together in reset" msgstr "" -#: tiramisu/setting.py:378 +#: tiramisu/setting.py:373 msgid "if opt is not None, path should not be None in _getproperties" msgstr "" -#: tiramisu/setting.py:487 +#: tiramisu/setting.py:482 msgid "cannot change the value for option {0} this option is frozen" msgstr "" -#: tiramisu/setting.py:493 +#: tiramisu/setting.py:488 msgid "trying to access to an option named: {0} with properties {1}" msgstr "" -#: tiramisu/setting.py:511 +#: tiramisu/setting.py:506 msgid "permissive must be a tuple" msgstr "" -#: tiramisu/setting.py:518 tiramisu/value.py:334 +#: tiramisu/setting.py:513 tiramisu/value.py:332 msgid "invalid generic owner {0}" msgstr "" -#: tiramisu/setting.py:606 +#: tiramisu/setting.py:601 msgid "malformed requirements imbrication detected for option: '{0}' with requirement on: '{1}'" msgstr "" -#: tiramisu/setting.py:617 +#: tiramisu/setting.py:612 msgid "option '{0}' has requirement's property error: {1} {2}" msgstr "" -#: tiramisu/storage/__init__.py:52 +#: tiramisu/storage/__init__.py:47 msgid "storage_type is already set, cannot rebind it" msgstr "" -#: tiramisu/storage/__init__.py:86 +#: tiramisu/storage/__init__.py:81 msgid "option {0} not already exists in storage {1}" msgstr "" -#: tiramisu/storage/dictionary/storage.py:39 +#: tiramisu/storage/dictionary/storage.py:37 msgid "dictionary storage cannot delete session" msgstr "" -#: tiramisu/storage/dictionary/storage.py:50 +#: tiramisu/storage/dictionary/storage.py:48 msgid "session already used" msgstr "" -#: tiramisu/storage/dictionary/storage.py:52 +#: tiramisu/storage/dictionary/storage.py:50 msgid "a dictionary cannot be persistent" msgstr "" -#: tiramisu/value.py:341 +#: tiramisu/value.py:339 msgid "no value for {0} cannot change owner to {1}" msgstr "" -#: tiramisu/value.py:423 +#: tiramisu/value.py:421 msgid "can force cache only if cache is actived in config" msgstr "" -#: tiramisu/value.py:462 +#: tiramisu/value.py:460 msgid "{0} is already a Multi " msgstr "" -#: tiramisu/value.py:498 tiramisu/value.py:562 +#: tiramisu/value.py:496 tiramisu/value.py:560 msgid "invalid len for the slave: {0} which has {1} as master" msgstr "" -#: tiramisu/value.py:534 +#: tiramisu/value.py:532 msgid "cannot append a value on a multi option {0} which is a slave" msgstr "" -#: tiramisu/value.py:572 +#: tiramisu/value.py:570 msgid "cannot sort multi option {0} if master or slave" msgstr "" -#: tiramisu/value.py:576 +#: tiramisu/value.py:574 msgid "cmp is not permitted in python v3 or greater" msgstr "" -#: tiramisu/value.py:585 +#: tiramisu/value.py:583 msgid "cannot reverse multi option {0} if master or slave" msgstr "" -#: tiramisu/value.py:593 +#: tiramisu/value.py:591 msgid "cannot insert multi option {0} if master or slave" msgstr "" -#: tiramisu/value.py:601 +#: tiramisu/value.py:599 msgid "cannot extend multi option {0} if master or slave" msgstr "" -#: tiramisu/value.py:612 +#: tiramisu/value.py:610 msgid "invalid value {0} for option {1}: {2}" msgstr "" -#: tiramisu/value.py:630 +#: tiramisu/value.py:628 msgid "cannot pop a value on a multi option {0} which is a slave" msgstr "" From 835d6d6da03c2e88263d580640b92511b92a1980 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Wed, 26 Mar 2014 19:44:49 +0100 Subject: [PATCH 2/5] context could be useful in a callback, now we can retrieve context in a function (be careful to infinite loop) --- test/test_option_calculation.py | 30 ++++++++++++++ tiramisu/autolib.py | 69 ++++++++++++++++++--------------- tiramisu/option.py | 35 ++++++++++------- 3 files changed, 89 insertions(+), 45 deletions(-) diff --git a/test/test_option_calculation.py b/test/test_option_calculation.py index 89f9291..ad1b54f 100644 --- a/test/test_option_calculation.py +++ b/test/test_option_calculation.py @@ -44,6 +44,13 @@ def return_calc(i, j, k): return i + j + k +def is_config(config, **kwargs): + if isinstance(config, Config): + return 'yes' + else: + return 'no' + + def make_description(): gcoption = ChoiceOption('name', 'GC name', ('ref', 'framework'), 'ref') gcdummy = BoolOption('dummy', 'dummy', default=False) @@ -254,6 +261,29 @@ def test_callback_invalid(): raises(ValueError, "StrOption('val2', '', callback=return_value, callback_params={'': 'string'})") raises(ValueError, "StrOption('val4', '', callback=return_value, callback_params={'value': (('string', False),)})") raises(ValueError, "StrOption('val4', '', callback=return_value, callback_params={'value': ((val1, 'string'),)})") + raises(ValueError, "StrOption('val4', '', callback=return_value, callback_params={'value': ((val1, False, 'unknown'),)})") + raises(ValueError, "StrOption('val4', '', callback=return_value, callback_params={'value': ((val1,),)})") + + +def test_callback_with_context(): + val1 = StrOption("val1", "", callback=is_config, callback_params={'': ((None,),), 'value': ('string',)}) + maconfig = OptionDescription('rootconfig', '', [val1]) + cfg = Config(maconfig) + assert cfg.val1 == 'yes' + + +def test_callback_with_context_named(): + val1 = StrOption("val1", "", callback=is_config, callback_params={'config': ((None,),)}) + maconfig = OptionDescription('rootconfig', '', [val1]) + cfg = Config(maconfig) + assert cfg.val1 == 'yes' + + +def test_callback_with_error(): + val1 = StrOption("val1", "", callback=is_config, callback_params={'': ('string',), 'value': ('string',)}) + maconfig = OptionDescription('rootconfig', '', [val1]) + cfg = Config(maconfig) + assert cfg.val1 == 'no' def test_callback_value(): diff --git a/tiramisu/autolib.py b/tiramisu/autolib.py index 0b97644..e837f79 100644 --- a/tiramisu/autolib.py +++ b/tiramisu/autolib.py @@ -145,39 +145,44 @@ def carry_out_calculation(option, config, callback, callback_params, for key, callbacks in callback_params.items(): for callbk in callbacks: if isinstance(callbk, tuple): - # callbk is something link (opt, True|False) - opt, force_permissive = callbk - path = config.cfgimpl_get_description().impl_get_path_by_opt( - opt) - # get value - try: - value = config._getattr(path, force_permissive=True, validate=False) - # convert to list, not modifie this multi - if value.__class__.__name__ == 'Multi': - value = list(value) - except PropertiesOptionError as err: - if force_permissive: - continue - raise ConfigError(_('unable to carry out a calculation, ' - 'option {0} has properties: {1} for: ' - '{2}').format(opt._name, - err.proptype, - option._name)) + if len(callbk) == 1: + tcparams.setdefault(key, []).append((config, False)) + else: + # callbk is something link (opt, True|False) + opt, force_permissive = callbk + path = config.cfgimpl_get_description( + ).impl_get_path_by_opt(opt) + # get value + try: + value = config._getattr(path, force_permissive=True, + validate=False) + # convert to list, not modifie this multi + if value.__class__.__name__ == 'Multi': + value = list(value) + except PropertiesOptionError as err: + if force_permissive: + continue + raise ConfigError(_('unable to carry out a calculation' + ', option {0} has properties: {1} ' + 'for: {2}').format(opt._name, + err.proptype, + option._name)) - is_multi = False - if opt.impl_is_multi(): - #opt is master, search if option is a slave - if opt.impl_get_multitype() == multitypes.master: - if option in opt.impl_get_master_slaves(): - is_multi = True - #opt is slave, search if option is an other slaves - elif opt.impl_get_multitype() == multitypes.slave: - if option in opt.impl_get_master_slaves().impl_get_master_slaves(): - is_multi = True - if is_multi: - len_multi = len(value) - one_is_multi = True - tcparams.setdefault(key, []).append((value, is_multi)) + is_multi = False + if opt.impl_is_multi(): + #opt is master, search if option is a slave + if opt.impl_get_multitype() == multitypes.master: + if option in opt.impl_get_master_slaves(): + is_multi = True + #opt is slave, search if option is an other slaves + elif opt.impl_get_multitype() == multitypes.slave: + if option in opt.impl_get_master_slaves( + ).impl_get_master_slaves(): + is_multi = True + if is_multi: + len_multi = len(value) + one_is_multi = True + tcparams.setdefault(key, []).append((value, is_multi)) else: # callbk is a value and not a multi tcparams.setdefault(key, []).append((callbk, False)) diff --git a/tiramisu/option.py b/tiramisu/option.py index 30277e2..d8853df 100644 --- a/tiramisu/option.py +++ b/tiramisu/option.py @@ -1528,16 +1528,25 @@ def validate_callback(callback, callback_params, type_): ).format(type_, key)) for callbk in callbacks: if isinstance(callbk, tuple): - option, force_permissive = callbk - if type_ == 'validator' and not force_permissive: - raise ValueError(_('validator not support tuple')) - if not isinstance(option, Option) and not \ - isinstance(option, SymLinkOption): - raise ValueError(_('{0}_params must have an option ' - 'not a {0} for first argument' - ).format(type_, type(option))) - if force_permissive not in [True, False]: - raise ValueError(_('{0}_params must have a boolean' - ' not a {0} for second argument' - ).format(type_, type( - force_permissive))) + if len(callbk) == 1: + if callbk != (None,): + raise ValueError(_('{0}_params with length of ' + 'tuple as 1 must only have ' + 'None as first value')) + elif len(callbk) != 2: + raise ValueError(_('{0}_params must only 1 or 2 as ' + 'length')) + else: + option, force_permissive = callbk + if type_ == 'validator' and not force_permissive: + raise ValueError(_('validator not support tuple')) + if not isinstance(option, Option) and not \ + isinstance(option, SymLinkOption): + raise ValueError(_('{0}_params must have an option' + ' not a {0} for first argument' + ).format(type_, type(option))) + if force_permissive not in [True, False]: + raise ValueError(_('{0}_params must have a boolean' + ' not a {0} for second argument' + ).format(type_, type( + force_permissive))) From 84f0095c2f3fc26ce696edcfa8e9b0d5a9a6971f Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Wed, 26 Mar 2014 20:47:30 +0100 Subject: [PATCH 3/5] update translation --- tiramisu/option.py | 4 ++-- translations/fr/tiramisu.po | 19 +++++++++++++++---- translations/tiramisu.pot | 16 ++++++++++++---- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/tiramisu/option.py b/tiramisu/option.py index d8853df..eeab2f9 100644 --- a/tiramisu/option.py +++ b/tiramisu/option.py @@ -1534,8 +1534,8 @@ def validate_callback(callback, callback_params, type_): 'tuple as 1 must only have ' 'None as first value')) elif len(callbk) != 2: - raise ValueError(_('{0}_params must only 1 or 2 as ' - 'length')) + raise ValueError(_('{0}_params must only have 1 or 2 ' + 'as length')) else: option, force_permissive = callbk if type_ == 'validator' and not force_permissive: diff --git a/translations/fr/tiramisu.po b/translations/fr/tiramisu.po index 0e1b339..ab01ec6 100644 --- a/translations/fr/tiramisu.po +++ b/translations/fr/tiramisu.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Tiramisu\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-03-24 19:54+CET\n" +"POT-Creation-Date: 2014-03-26 20:46+CET\n" "PO-Revision-Date: \n" "Last-Translator: Emmanuel Garette \n" "Language-Team: Tiramisu's team \n" @@ -14,7 +14,7 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" "X-Poedit-SourceCharset: UTF-8\n" -#: tiramisu/autolib.py:161 +#: tiramisu/autolib.py:165 msgid "" "unable to carry out a calculation, option {0} has properties: {1} for: {2}" msgstr "" @@ -472,14 +472,25 @@ msgid "{0}_params must be tuple for key \"{1}\"" msgstr "{0}_params doit être un tuple pour la clef \"{1}\"" #: tiramisu/option.py:1533 +msgid "{0}_params with length of tuple as 1 must only have None as first value" +msgstr "" +"{0}_params avec un tuple de longueur 1 doit seulement avoir None comme " +"première valeur" + +#: tiramisu/option.py:1537 +#, fuzzy +msgid "{0}_params must only have 1 or 2 as length" +msgstr "{0}_params doit seulement avoir une longueur de 1 ou 2" + +#: tiramisu/option.py:1542 msgid "validator not support tuple" msgstr "validator n'accepte pas de tuple" -#: tiramisu/option.py:1536 +#: tiramisu/option.py:1545 msgid "{0}_params must have an option not a {0} for first argument" msgstr "{0}_params doit avoir une option pas un {0} pour premier argument" -#: tiramisu/option.py:1540 +#: tiramisu/option.py:1549 msgid "{0}_params must have a boolean not a {0} for second argument" msgstr "{0}_params doit avoir un booléen pas un {0} pour second argument" diff --git a/translations/tiramisu.pot b/translations/tiramisu.pot index eb41967..1bf9361 100644 --- a/translations/tiramisu.pot +++ b/translations/tiramisu.pot @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2014-03-24 19:54+CET\n" +"POT-Creation-Date: 2014-03-26 20:46+CET\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -15,7 +15,7 @@ msgstr "" "Generated-By: pygettext.py 1.5\n" -#: tiramisu/autolib.py:161 +#: tiramisu/autolib.py:165 msgid "unable to carry out a calculation, option {0} has properties: {1} for: {2}" msgstr "" @@ -441,14 +441,22 @@ msgid "{0}_params must be tuple for key \"{1}\"" msgstr "" #: tiramisu/option.py:1533 +msgid "{0}_params with length of tuple as 1 must only have None as first value" +msgstr "" + +#: tiramisu/option.py:1537 +msgid "{0}_params must only have 1 or 2 as length" +msgstr "" + +#: tiramisu/option.py:1542 msgid "validator not support tuple" msgstr "" -#: tiramisu/option.py:1536 +#: tiramisu/option.py:1545 msgid "{0}_params must have an option not a {0} for first argument" msgstr "" -#: tiramisu/option.py:1540 +#: tiramisu/option.py:1549 msgid "{0}_params must have a boolean not a {0} for second argument" msgstr "" From 712db2875e0dac7c7e0d6c88b551d4bdff2992c6 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Fri, 28 Mar 2014 17:35:27 +0100 Subject: [PATCH 4/5] force_store_value works now with permissive --- test/test_freeze.py | 13 ++++++++++++- tiramisu/value.py | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/test/test_freeze.py b/test/test_freeze.py index cda1406..f279c47 100644 --- a/test/test_freeze.py +++ b/test/test_freeze.py @@ -22,13 +22,14 @@ def make_description_freeze(): boolop = BoolOption('boolop', 'Test boolean option op', default=[True], multi=True) wantref_option = BoolOption('wantref', 'Test requires', default=False, properties=('force_store_value',), requires=({'option': booloption, 'expected': True, 'action': 'hidden'},)) + wantref2_option = BoolOption('wantref2', 'Test requires', default=False, properties=('force_store_value', 'hidden')) wantframework_option = BoolOption('wantframework', 'Test requires', default=False, requires=({'option': booloption, 'expected': True, 'action': 'hidden'},)) gcgroup = OptionDescription('gc', '', [gcoption, gcdummy, floatoption]) descr = OptionDescription('tiramisu', '', [gcgroup, booloption, objspaceoption, - wantref_option, stroption, + wantref_option, wantref2_option, stroption, wantframework_option, intoption, boolop]) return descr @@ -153,3 +154,13 @@ def test_force_store_value_ro(): assert conf.getowner(conf.unwrap_from_path('wantref')) == 'default' conf.wantref assert conf.getowner(conf.unwrap_from_path('wantref')) == 'user' + + +def test_force_store_value_hidden(): + descr = make_description_freeze() + conf = Config(descr) + conf.cfgimpl_get_settings().setpermissive(('hidden',)) + conf.read_write() + assert conf.getowner(conf.unwrap_from_path('wantref2')) == 'default' + conf._getattr('wantref2', force_permissive=True) + assert conf.getowner(conf.unwrap_from_path('wantref2')) == 'user' diff --git a/tiramisu/value.py b/tiramisu/value.py index 968f0e4..d66f85d 100644 --- a/tiramisu/value.py +++ b/tiramisu/value.py @@ -243,7 +243,8 @@ class Values(object): opt.impl_validate(value, context, 'validator' in setting) if config_error is None and self._is_default_owner(path) and \ 'force_store_value' in setting[opt]: - self.setitem(opt, value, path, is_write=False) + self.setitem(opt, value, path, is_write=False, + force_permissive=force_permissive) if validate_properties: setting.validate_properties(opt, False, False, value=value, path=path, force_permissive=force_permissive, From ff5376a382f4fc48b16f695357bbe1de3b4cd021 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Sat, 29 Mar 2014 20:31:56 +0100 Subject: [PATCH 5/5] properties are check now in getowner get_modified_values works good with force_store_value --- test/test_freeze.py | 75 ++++++++++++++++++++++++++--- test/test_mandatory.py | 8 ++-- test/test_option_owner.py | 10 +++- tiramisu/config.py | 5 +- tiramisu/option.py | 14 ++++-- tiramisu/setting.py | 31 ++++++++---- tiramisu/value.py | 43 ++++++++++------- translations/fr/tiramisu.po | 96 ++++++++++++++++++++----------------- translations/tiramisu.pot | 92 ++++++++++++++++++----------------- 9 files changed, 242 insertions(+), 132 deletions(-) diff --git a/test/test_freeze.py b/test/test_freeze.py index f279c47..362f26f 100644 --- a/test/test_freeze.py +++ b/test/test_freeze.py @@ -142,18 +142,27 @@ def test_freeze_get_multi(): def test_force_store_value(): descr = make_description_freeze() conf = Config(descr) - assert conf.getowner(conf.unwrap_from_path('wantref')) == 'default' + assert conf.cfgimpl_get_values()._p_.get_modified_values() == {} conf.wantref - assert conf.getowner(conf.unwrap_from_path('wantref')) == 'user' + assert conf.cfgimpl_get_values()._p_.get_modified_values() == {'wantref': ('user', False)} + + +def test_force_store_value_no_requirement(): + booloption = BoolOption('bool', 'Test boolean option', default=True) + try: + BoolOption('wantref', 'Test requires', default=False, + requires=({'option': booloption, 'expected': True, 'action': 'force_store_value'},)) + except ValueError: + pass def test_force_store_value_ro(): descr = make_description_freeze() conf = Config(descr) conf.read_only() - assert conf.getowner(conf.unwrap_from_path('wantref')) == 'default' + assert conf.cfgimpl_get_values()._p_.get_modified_values() == {} conf.wantref - assert conf.getowner(conf.unwrap_from_path('wantref')) == 'user' + assert conf.cfgimpl_get_values()._p_.get_modified_values() == {'wantref': ('user', False)} def test_force_store_value_hidden(): @@ -161,6 +170,60 @@ def test_force_store_value_hidden(): conf = Config(descr) conf.cfgimpl_get_settings().setpermissive(('hidden',)) conf.read_write() - assert conf.getowner(conf.unwrap_from_path('wantref2')) == 'default' + assert conf.cfgimpl_get_values()._p_.get_modified_values() == {} conf._getattr('wantref2', force_permissive=True) - assert conf.getowner(conf.unwrap_from_path('wantref2')) == 'user' + assert conf.cfgimpl_get_values()._p_.get_modified_values() == {'wantref2': ('user', False)} + + +def test_force_store_value_owner(): + descr = make_description_freeze() + conf = Config(descr) + assert conf.cfgimpl_get_values()._p_.get_modified_values() == {} + conf.getowner(conf.unwrap_from_path('wantref')) + assert conf.cfgimpl_get_values()._p_.get_modified_values() == {'wantref': ('user', False)} + + +def test_force_store_value_owner_ro(): + descr = make_description_freeze() + conf = Config(descr) + conf.read_only() + assert conf.cfgimpl_get_values()._p_.get_modified_values() == {} + conf.getowner(conf.unwrap_from_path('wantref')) + assert conf.cfgimpl_get_values()._p_.get_modified_values() == {'wantref': ('user', False)} + + +def test_force_store_value_owner_hidden(): + descr = make_description_freeze() + conf = Config(descr) + conf.cfgimpl_get_settings().setpermissive(('hidden',)) + conf.read_write() + assert conf.cfgimpl_get_values()._p_.get_modified_values() == {} + conf.getowner(conf.unwrap_from_path('wantref2'), force_permissive=True) + assert conf.cfgimpl_get_values()._p_.get_modified_values() == {'wantref2': ('user', False)} + + +def test_force_store_value_modified(): + descr = make_description_freeze() + conf = Config(descr) + assert conf.cfgimpl_get_values()._p_.get_modified_values() == {} + conf.cfgimpl_get_values().get_modified_values() + assert conf.cfgimpl_get_values()._p_.get_modified_values() == {'wantref': ('user', False), 'wantref2': ('user', False)} + + +def test_force_store_value_modified_ro(): + descr = make_description_freeze() + conf = Config(descr) + conf.read_only() + assert conf.cfgimpl_get_values()._p_.get_modified_values() == {} + conf.cfgimpl_get_values().get_modified_values() + assert conf.cfgimpl_get_values()._p_.get_modified_values() == {'wantref': ('user', False), 'wantref2': ('user', False)} + + +def test_force_store_value_modified_hidden(): + descr = make_description_freeze() + conf = Config(descr) + conf.cfgimpl_get_settings().setpermissive(('hidden',)) + conf.read_write() + assert conf.cfgimpl_get_values()._p_.get_modified_values() == {} + conf.cfgimpl_get_values().get_modified_values() + assert conf.cfgimpl_get_values()._p_.get_modified_values() == {'wantref': ('user', False), 'wantref2': ('user', False)} diff --git a/test/test_mandatory.py b/test/test_mandatory.py index 5b9878a..26c8e4b 100644 --- a/test/test_mandatory.py +++ b/test/test_mandatory.py @@ -99,8 +99,8 @@ def test_mandatory_multi_none(): descr = make_description() config = Config(descr) config.str3 = [None] - config.read_only() assert config.getowner(config.unwrap_from_path('str3')) == 'user' + config.read_only() prop = [] try: config.str3 @@ -109,8 +109,8 @@ def test_mandatory_multi_none(): assert 'mandatory' in prop config.read_write() config.str3 = ['yes', None] - config.read_only() assert config.getowner(config.unwrap_from_path('str3')) == 'user' + config.read_only() prop = [] try: config.str3 @@ -123,8 +123,8 @@ def test_mandatory_multi_empty(): descr = make_description() config = Config(descr) config.str3 = [''] - config.read_only() assert config.getowner(config.unwrap_from_path('str3')) == 'user' + config.read_only() prop = [] try: config.str3 @@ -133,8 +133,8 @@ def test_mandatory_multi_empty(): assert 'mandatory' in prop config.read_write() config.str3 = ['yes', ''] - config.read_only() assert config.getowner(config.unwrap_from_path('str3')) == 'user' + config.read_only() prop = [] try: config.str3 diff --git a/test/test_option_owner.py b/test/test_option_owner.py index d4c3f6b..1880bc4 100644 --- a/test/test_option_owner.py +++ b/test/test_option_owner.py @@ -5,7 +5,7 @@ from tiramisu.setting import owners from tiramisu.config import Config from tiramisu.option import ChoiceOption, BoolOption, IntOption, FloatOption, \ StrOption, OptionDescription -from tiramisu.error import ConfigError, ConstError +from tiramisu.error import ConfigError, ConstError, PropertiesOptionError def make_description(): @@ -41,6 +41,14 @@ def test_default_owner(): assert cfg.getowner(gcdummy) == owners.user +def test_hidden_owner(): + gcdummy = BoolOption('dummy', 'dummy', default=False, properties=('hidden',)) + descr = OptionDescription('tiramisu', '', [gcdummy]) + cfg = Config(descr) + cfg.read_write() + raises(PropertiesOptionError, "cfg.getowner(gcdummy)") + + def test_addowner(): gcdummy = BoolOption('dummy', 'dummy', default=False) descr = OptionDescription('tiramisu', '', [gcdummy]) diff --git a/tiramisu/config.py b/tiramisu/config.py index 2a882a1..8fc8e2d 100644 --- a/tiramisu/config.py +++ b/tiramisu/config.py @@ -483,14 +483,15 @@ class _CommonConfig(SubConfig): "read write is a global config's setting, see `settings.py`" self.cfgimpl_get_settings().read_write() - def getowner(self, opt): + def getowner(self, opt, force_permissive=False): """convenience method to retrieve an option's owner from the config itself """ if not isinstance(opt, Option) and not isinstance(opt, SymLinkOption): raise TypeError(_('opt in getowner must be an option not {0}' '').format(type(opt))) - return self.cfgimpl_get_values().getowner(opt) + return self.cfgimpl_get_values().getowner(opt, + force_permissive=force_permissive) def unwrap_from_path(self, path, force_permissive=False): """convenience method to extract and Option() object from the Config() diff --git a/tiramisu/option.py b/tiramisu/option.py index eeab2f9..f4a53aa 100644 --- a/tiramisu/option.py +++ b/tiramisu/option.py @@ -1461,6 +1461,10 @@ def validate_requires_arg(requires, name): raise ValueError(_("malformed requirements for option: {0}" " require must have option, expected and" " action keys").format(name)) + if action == 'force_store_value': + raise ValueError(_("malformed requirements for option: {0}" + " action cannot be force_store_value" + ).format(name)) inverse = require.get('inverse', False) if inverse not in [True, False]: raise ValueError(_('malformed requirements for option: {0}' @@ -1543,10 +1547,10 @@ def validate_callback(callback, callback_params, type_): if not isinstance(option, Option) and not \ isinstance(option, SymLinkOption): raise ValueError(_('{0}_params must have an option' - ' not a {0} for first argument' - ).format(type_, type(option))) + ' not a {0} for first argument' + ).format(type_, type(option))) if force_permissive not in [True, False]: raise ValueError(_('{0}_params must have a boolean' - ' not a {0} for second argument' - ).format(type_, type( - force_permissive))) + ' not a {0} for second argument' + ).format(type_, type( + force_permissive))) diff --git a/tiramisu/setting.py b/tiramisu/setting.py index 6ba84d7..8a7ae13 100644 --- a/tiramisu/setting.py +++ b/tiramisu/setting.py @@ -365,7 +365,10 @@ class Settings(object): self._p_.reset_properties(_path) self._getcontext().cfgimpl_reset_cache() - def _getproperties(self, opt=None, path=None, is_apply_req=True): + def _getproperties(self, opt=None, path=None, _is_apply_req=True): + """ + be careful, _is_apply_req doesn't copy properties + """ if opt is None: props = copy(self._p_.getproperties(path, default_properties)) else: @@ -379,15 +382,16 @@ class Settings(object): is_cached, props = self._p_.getcache(path, ntime) if is_cached: return copy(props) - props = copy(self._p_.getproperties(path, opt._properties)) - if is_apply_req: + props = self._p_.getproperties(path, opt._properties) + if _is_apply_req: + props = copy(props) props |= self.apply_requires(opt, path) - if 'cache' in self: - if 'expire' in self: - if ntime is None: - ntime = int(time()) - ntime = ntime + expires_time - self._p_.setcache(path, copy(props), ntime) + if 'cache' in self: + if 'expire' in self: + if ntime is None: + ntime = int(time()) + ntime = ntime + expires_time + self._p_.setcache(path, copy(props), ntime) return props def append(self, propname): @@ -640,6 +644,15 @@ class Settings(object): def get_modified_permissives(self): return self._p_.get_modified_permissives() + def get_with_property(self, propname): + opts, paths = self._getcontext().cfgimpl_get_description( + )._cache_paths + for index in range(0, len(paths)): + opt = opts[index] + path = paths[index] + if propname in self._getproperties(opt, path, False): + yield (opt, path) + def __getstate__(self): return {'_p_': self._p_, '_owner': str(self._owner)} diff --git a/tiramisu/value.py b/tiramisu/value.py index d66f85d..e5c6111 100644 --- a/tiramisu/value.py +++ b/tiramisu/value.py @@ -88,6 +88,11 @@ class Values(object): return value def get_modified_values(self): + context = self._getcontext() + if context._impl_descr is not None: + for opt, path in context.cfgimpl_get_settings( + ).get_with_property('force_store_value'): + self._getowner(opt, path, force_permissive=True) return self._p_.get_modified_values() def __contains__(self, opt): @@ -196,7 +201,7 @@ class Values(object): # if value has callback and is not set # or frozen with force_default_on_freeze if opt.impl_has_callback() and ( - self._is_default_owner(path) or + self._is_default_owner(opt, path, validate_properties=False) or (is_frozen and 'force_default_on_freeze' in setting[opt])): lenmaster = None no_value_slave = False @@ -241,7 +246,8 @@ class Values(object): value = Multi(value, self.context, opt, path, validate=validate) if config_error is None and validate: opt.impl_validate(value, context, 'validator' in setting) - if config_error is None and self._is_default_owner(path) and \ + if config_error is None and \ + self._is_default_owner(opt, path, validate_properties=False) and \ 'force_store_value' in setting[opt]: self.setitem(opt, value, path, is_write=False, force_permissive=force_permissive) @@ -303,23 +309,27 @@ class Values(object): value = list(value) self._p_.setvalue(path, value, owner) - def getowner(self, opt): + def getowner(self, opt, force_permissive=False): """ retrieves the option's owner :param opt: the `option.Option` object + :param force_permissive: behaves as if the permissive property + was present :returns: a `setting.owners.Owner` object """ if isinstance(opt, SymLinkOption): opt = opt._opt path = self._get_opt_path(opt) - return self._getowner(path) + return self._getowner(opt, path, force_permissive=force_permissive) - def _getowner(self, path): - owner = self._p_.getowner(path, owners.default) + def _getowner(self, opt, path, validate_properties=True, force_permissive=False): meta = self._getcontext().cfgimpl_get_meta() + if validate_properties: + self._getitem(opt, path, True, force_permissive, None, True) + owner = self._p_.getowner(path, owners.default) if owner is owners.default and meta is not None: - owner = meta.cfgimpl_get_values()._getowner(path) + owner = meta.cfgimpl_get_values()._getowner(opt, path) return owner def setowner(self, opt, owner): @@ -333,25 +343,25 @@ class Values(object): raise TypeError(_("invalid generic owner {0}").format(str(owner))) path = self._get_opt_path(opt) - self._setowner(path, owner) + self._setowner(opt, path, owner) - def _setowner(self, path, owner): - if self._getowner(path) == owners.default: + def _setowner(self, opt, path, owner): + if self._getowner(opt, path) == owners.default: raise ConfigError(_('no value for {0} cannot change owner to {1}' '').format(path, owner)) self._p_.setowner(path, owner) - def is_default_owner(self, opt): + def is_default_owner(self, opt, validate_properties=True): """ :param config: *must* be only the **parent** config (not the toplevel config) :return: boolean """ path = self._get_opt_path(opt) - return self._is_default_owner(path) + return self._is_default_owner(opt, path, validate_properties) - def _is_default_owner(self, path): - return self._getowner(path) == owners.default + def _is_default_owner(self, opt, path, validate_properties=True): + return self._getowner(opt, path, validate_properties) == owners.default def reset_cache(self, only_expired): """ @@ -550,7 +560,8 @@ class Multi(list): if not force and self.opt.impl_get_multitype() == multitypes.master: for slave in self.opt.impl_get_master_slaves(): path = values._get_opt_path(slave) - if not values._is_default_owner(path): + if not values._is_default_owner(slave, path, + validate_properties=False): if slave.impl_has_callback(): dvalue = values._getcallback_value(slave, index=index) else: @@ -631,7 +642,7 @@ class Multi(list): if self.opt.impl_get_multitype() == multitypes.master: for slave in self.opt.impl_get_master_slaves(): values = context.cfgimpl_get_values() - if not values.is_default_owner(slave): + if not values.is_default_owner(slave, validate_properties=False): #get multi without valid properties values.getitem(slave, validate=False, validate_properties=False diff --git a/translations/fr/tiramisu.po b/translations/fr/tiramisu.po index ab01ec6..eb14d72 100644 --- a/translations/fr/tiramisu.po +++ b/translations/fr/tiramisu.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Tiramisu\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-03-26 20:46+CET\n" +"POT-Creation-Date: 2014-03-29 19:01+CET\n" "PO-Revision-Date: \n" "Last-Translator: Emmanuel Garette \n" "Language-Team: Tiramisu's team \n" @@ -30,7 +30,7 @@ msgid "unknown group_type: {0}" msgstr "group_type inconnu: {0}" #: tiramisu/config.py:163 tiramisu/setting.py:334 tiramisu/value.py:55 -#: tiramisu/value.py:483 +#: tiramisu/value.py:500 msgid "the context does not exist anymore" msgstr "le context n'existe plus" @@ -63,27 +63,27 @@ msgstr "chemin imprévu {0}, devrait commencer par {1}" msgid "opt in getowner must be an option not {0}" msgstr "opt dans getowner doit être une option pas {0}" -#: tiramisu/config.py:534 +#: tiramisu/config.py:535 msgid "cannot serialize Config with MetaConfig" msgstr "impossible de sérialiser une Config avec une MetaConfig" -#: tiramisu/config.py:548 +#: tiramisu/config.py:549 msgid "this storage is not serialisable, could be a none persistent storage" msgstr "ce storage n'est sérialisable, devrait être une storage non persistant" -#: tiramisu/config.py:611 +#: tiramisu/config.py:612 msgid "metaconfig's children must be a list" msgstr "enfants d'une metaconfig doit être une liste" -#: tiramisu/config.py:705 +#: tiramisu/config.py:706 msgid "metaconfig's children should be config, not {0}" msgstr "enfants d'une metaconfig doit être une config, pas {0}" -#: tiramisu/config.py:709 +#: tiramisu/config.py:710 msgid "child has already a metaconfig's" msgstr "enfant a déjà une metaconfig" -#: tiramisu/config.py:713 +#: tiramisu/config.py:714 msgid "all config in metaconfig must have the same optiondescription" msgstr "" "toutes les configs d'une metaconfig doivent avoir la même optiondescription" @@ -100,7 +100,7 @@ msgstr "type des properties invalide {0} pour {1}, doit être un tuple" msgid "'{0}' ({1}) object attribute '{2}' is read-only" msgstr "l'attribut {2} de l'objet '{0}' ({1}) est en lecture seule" -#: tiramisu/option.py:140 tiramisu/value.py:393 +#: tiramisu/option.py:140 tiramisu/value.py:410 msgid "information's item not found: {0}" msgstr "aucune config spécifiée alors que c'est nécessaire" @@ -420,77 +420,83 @@ msgstr "" "requirements malformé pour l'option : {0} l'exigence doit avoir les clefs " "option, expected et action" -#: tiramisu/option.py:1466 +#: tiramisu/option.py:1465 +msgid "" +"malformed requirements for option: {0} action cannot be force_store_value" +msgstr "" +"requirements mal formés pour l'option : {0} action ne peut pas être " +"force_store_value" + +#: tiramisu/option.py:1470 msgid "malformed requirements for option: {0} inverse must be boolean" msgstr "" "requirements mal formés pour l'option : {0} inverse doit être un booléen" -#: tiramisu/option.py:1470 +#: tiramisu/option.py:1474 msgid "malformed requirements for option: {0} transitive must be boolean" msgstr "" "requirements mal formés pour l'option : {0} transitive doit être booléen" -#: tiramisu/option.py:1474 +#: tiramisu/option.py:1478 msgid "malformed requirements for option: {0} same_action must be boolean" msgstr "" "requirements mal formés pour l'option : {0} same_action doit être un booléen" -#: tiramisu/option.py:1478 +#: tiramisu/option.py:1482 msgid "malformed requirements must be an option in option {0}" msgstr "requirements mal formés doit être une option dans l'option {0}" -#: tiramisu/option.py:1481 +#: tiramisu/option.py:1485 msgid "malformed requirements option {0} must not be a multi" msgstr "requirements mal formés l'option {0} ne doit pas être une multi" -#: tiramisu/option.py:1487 +#: tiramisu/option.py:1491 msgid "" "malformed requirements second argument must be valid for option {0}: {1}" msgstr "" "requirements mal formés deuxième argument doit être valide pour l'option " "{0} : {1}" -#: tiramisu/option.py:1492 +#: tiramisu/option.py:1496 msgid "inconsistency in action types for option: {0} action: {1}" msgstr "incohérence dans les types action pour l'option : {0} action {1}" -#: tiramisu/option.py:1517 +#: tiramisu/option.py:1521 msgid "{0} must be a function" msgstr "{0} doit être une fonction" -#: tiramisu/option.py:1520 +#: tiramisu/option.py:1524 msgid "{0}_params must be a dict" msgstr "{0}_params doit être un dict" -#: tiramisu/option.py:1523 +#: tiramisu/option.py:1527 msgid "{0}_params with key {1} mustn't have length different to 1" msgstr "" "{0}_params avec la clef {1} ne doit pas avoir une longueur différent de 1" -#: tiramisu/option.py:1527 +#: tiramisu/option.py:1531 msgid "{0}_params must be tuple for key \"{1}\"" msgstr "{0}_params doit être un tuple pour la clef \"{1}\"" -#: tiramisu/option.py:1533 +#: tiramisu/option.py:1537 msgid "{0}_params with length of tuple as 1 must only have None as first value" msgstr "" "{0}_params avec un tuple de longueur 1 doit seulement avoir None comme " "première valeur" -#: tiramisu/option.py:1537 -#, fuzzy +#: tiramisu/option.py:1541 msgid "{0}_params must only have 1 or 2 as length" msgstr "{0}_params doit seulement avoir une longueur de 1 ou 2" -#: tiramisu/option.py:1542 +#: tiramisu/option.py:1546 msgid "validator not support tuple" msgstr "validator n'accepte pas de tuple" -#: tiramisu/option.py:1545 +#: tiramisu/option.py:1549 msgid "{0}_params must have an option not a {0} for first argument" msgstr "{0}_params doit avoir une option pas un {0} pour premier argument" -#: tiramisu/option.py:1549 +#: tiramisu/option.py:1553 msgid "{0}_params must have a boolean not a {0} for second argument" msgstr "{0}_params doit avoir un booléen pas un {0} pour second argument" @@ -512,29 +518,29 @@ msgstr "" msgid "opt and all_properties must not be set together in reset" msgstr "opt et all_properties ne doit pas être renseigné ensemble dans reset" -#: tiramisu/setting.py:373 +#: tiramisu/setting.py:376 msgid "if opt is not None, path should not be None in _getproperties" msgstr "" "si opt n'est pas None, path devrait ne pas être à None dans _getproperties" -#: tiramisu/setting.py:482 +#: tiramisu/setting.py:486 msgid "cannot change the value for option {0} this option is frozen" msgstr "" "ne peut modifier la valeur de l'option {0} cette option n'est pas modifiable" -#: tiramisu/setting.py:488 +#: tiramisu/setting.py:492 msgid "trying to access to an option named: {0} with properties {1}" msgstr "tentative d'accès à une option nommée : {0} avec les propriétés {1}" -#: tiramisu/setting.py:506 +#: tiramisu/setting.py:510 msgid "permissive must be a tuple" msgstr "permissive doit être un tuple" -#: tiramisu/setting.py:513 tiramisu/value.py:332 +#: tiramisu/setting.py:517 tiramisu/value.py:349 msgid "invalid generic owner {0}" msgstr "invalide owner générique {0}" -#: tiramisu/setting.py:601 +#: tiramisu/setting.py:605 msgid "" "malformed requirements imbrication detected for option: '{0}' with " "requirement on: '{1}'" @@ -542,7 +548,7 @@ msgstr "" "imbrication de requirements mal formés detectée pour l'option : '{0}' avec " "requirement sur : '{1}'" -#: tiramisu/setting.py:612 +#: tiramisu/setting.py:616 msgid "option '{0}' has requirement's property error: {1} {2}" msgstr "l'option '{0}' a une erreur de propriété pour le requirement : {1} {2}" @@ -567,52 +573,52 @@ msgstr "session déjà utilisée" msgid "a dictionary cannot be persistent" msgstr "un espace de stockage dictionary ne peut être persistant" -#: tiramisu/value.py:339 +#: tiramisu/value.py:356 msgid "no value for {0} cannot change owner to {1}" msgstr "pas de valeur pour {0} ne peut changer d'utilisateur pour {1}" -#: tiramisu/value.py:421 +#: tiramisu/value.py:438 msgid "can force cache only if cache is actived in config" msgstr "" "peut force la mise en cache seulement si le cache est activé dans la config" -#: tiramisu/value.py:460 +#: tiramisu/value.py:477 msgid "{0} is already a Multi " msgstr "{0} est déjà une Multi" -#: tiramisu/value.py:496 tiramisu/value.py:560 +#: tiramisu/value.py:513 tiramisu/value.py:577 msgid "invalid len for the slave: {0} which has {1} as master" msgstr "longueur invalide pour une esclave : {0} qui a {1} comme maître" -#: tiramisu/value.py:532 +#: tiramisu/value.py:549 msgid "cannot append a value on a multi option {0} which is a slave" msgstr "ne peut ajouter une valeur sur l'option multi {0} qui est une esclave" -#: tiramisu/value.py:570 +#: tiramisu/value.py:587 msgid "cannot sort multi option {0} if master or slave" msgstr "ne peut trier une option multi {0} pour une maître ou une esclave" -#: tiramisu/value.py:574 +#: tiramisu/value.py:591 msgid "cmp is not permitted in python v3 or greater" msgstr "cmp n'est pas permis en python v3 ou supérieure" -#: tiramisu/value.py:583 +#: tiramisu/value.py:600 msgid "cannot reverse multi option {0} if master or slave" msgstr "ne peut inverser une option multi {0} pour une maître ou une esclave" -#: tiramisu/value.py:591 +#: tiramisu/value.py:608 msgid "cannot insert multi option {0} if master or slave" msgstr "ne peut insérer une option multi {0} pour une maître ou une esclave" -#: tiramisu/value.py:599 +#: tiramisu/value.py:616 msgid "cannot extend multi option {0} if master or slave" msgstr "ne peut étendre une option multi {0} pour une maître ou une esclave" -#: tiramisu/value.py:610 +#: tiramisu/value.py:627 msgid "invalid value {0} for option {1}: {2}" msgstr "valeur invalide {0} pour l'option {1} : {2}" -#: tiramisu/value.py:628 +#: tiramisu/value.py:645 msgid "cannot pop a value on a multi option {0} which is a slave" msgstr "ne peut supprimer une valeur dans l'option multi {0} qui est esclave" diff --git a/translations/tiramisu.pot b/translations/tiramisu.pot index 1bf9361..35ecafe 100644 --- a/translations/tiramisu.pot +++ b/translations/tiramisu.pot @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2014-03-26 20:46+CET\n" +"POT-Creation-Date: 2014-03-29 19:01+CET\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -28,7 +28,7 @@ msgid "unknown group_type: {0}" msgstr "" #: tiramisu/config.py:163 tiramisu/setting.py:334 tiramisu/value.py:55 -#: tiramisu/value.py:483 +#: tiramisu/value.py:500 msgid "the context does not exist anymore" msgstr "" @@ -60,27 +60,27 @@ msgstr "" msgid "opt in getowner must be an option not {0}" msgstr "" -#: tiramisu/config.py:534 +#: tiramisu/config.py:535 msgid "cannot serialize Config with MetaConfig" msgstr "" -#: tiramisu/config.py:548 +#: tiramisu/config.py:549 msgid "this storage is not serialisable, could be a none persistent storage" msgstr "" -#: tiramisu/config.py:611 +#: tiramisu/config.py:612 msgid "metaconfig's children must be a list" msgstr "" -#: tiramisu/config.py:705 +#: tiramisu/config.py:706 msgid "metaconfig's children should be config, not {0}" msgstr "" -#: tiramisu/config.py:709 +#: tiramisu/config.py:710 msgid "child has already a metaconfig's" msgstr "" -#: tiramisu/config.py:713 +#: tiramisu/config.py:714 msgid "all config in metaconfig must have the same optiondescription" msgstr "" @@ -96,7 +96,7 @@ msgstr "" msgid "'{0}' ({1}) object attribute '{2}' is read-only" msgstr "" -#: tiramisu/option.py:140 tiramisu/value.py:393 +#: tiramisu/option.py:140 tiramisu/value.py:410 msgid "information's item not found: {0}" msgstr "" @@ -396,67 +396,71 @@ msgstr "" msgid "malformed requirements for option: {0} require must have option, expected and action keys" msgstr "" -#: tiramisu/option.py:1466 -msgid "malformed requirements for option: {0} inverse must be boolean" +#: tiramisu/option.py:1465 +msgid "malformed requirements for option: {0} action cannot be force_store_value" msgstr "" #: tiramisu/option.py:1470 -msgid "malformed requirements for option: {0} transitive must be boolean" +msgid "malformed requirements for option: {0} inverse must be boolean" msgstr "" #: tiramisu/option.py:1474 -msgid "malformed requirements for option: {0} same_action must be boolean" +msgid "malformed requirements for option: {0} transitive must be boolean" msgstr "" #: tiramisu/option.py:1478 +msgid "malformed requirements for option: {0} same_action must be boolean" +msgstr "" + +#: tiramisu/option.py:1482 msgid "malformed requirements must be an option in option {0}" msgstr "" -#: tiramisu/option.py:1481 +#: tiramisu/option.py:1485 msgid "malformed requirements option {0} must not be a multi" msgstr "" -#: tiramisu/option.py:1487 +#: tiramisu/option.py:1491 msgid "malformed requirements second argument must be valid for option {0}: {1}" msgstr "" -#: tiramisu/option.py:1492 +#: tiramisu/option.py:1496 msgid "inconsistency in action types for option: {0} action: {1}" msgstr "" -#: tiramisu/option.py:1517 +#: tiramisu/option.py:1521 msgid "{0} must be a function" msgstr "" -#: tiramisu/option.py:1520 +#: tiramisu/option.py:1524 msgid "{0}_params must be a dict" msgstr "" -#: tiramisu/option.py:1523 +#: tiramisu/option.py:1527 msgid "{0}_params with key {1} mustn't have length different to 1" msgstr "" -#: tiramisu/option.py:1527 +#: tiramisu/option.py:1531 msgid "{0}_params must be tuple for key \"{1}\"" msgstr "" -#: tiramisu/option.py:1533 +#: tiramisu/option.py:1537 msgid "{0}_params with length of tuple as 1 must only have None as first value" msgstr "" -#: tiramisu/option.py:1537 +#: tiramisu/option.py:1541 msgid "{0}_params must only have 1 or 2 as length" msgstr "" -#: tiramisu/option.py:1542 +#: tiramisu/option.py:1546 msgid "validator not support tuple" msgstr "" -#: tiramisu/option.py:1545 +#: tiramisu/option.py:1549 msgid "{0}_params must have an option not a {0} for first argument" msgstr "" -#: tiramisu/option.py:1549 +#: tiramisu/option.py:1553 msgid "{0}_params must have a boolean not a {0} for second argument" msgstr "" @@ -476,31 +480,31 @@ msgstr "" msgid "opt and all_properties must not be set together in reset" msgstr "" -#: tiramisu/setting.py:373 +#: tiramisu/setting.py:376 msgid "if opt is not None, path should not be None in _getproperties" msgstr "" -#: tiramisu/setting.py:482 +#: tiramisu/setting.py:486 msgid "cannot change the value for option {0} this option is frozen" msgstr "" -#: tiramisu/setting.py:488 +#: tiramisu/setting.py:492 msgid "trying to access to an option named: {0} with properties {1}" msgstr "" -#: tiramisu/setting.py:506 +#: tiramisu/setting.py:510 msgid "permissive must be a tuple" msgstr "" -#: tiramisu/setting.py:513 tiramisu/value.py:332 +#: tiramisu/setting.py:517 tiramisu/value.py:349 msgid "invalid generic owner {0}" msgstr "" -#: tiramisu/setting.py:601 +#: tiramisu/setting.py:605 msgid "malformed requirements imbrication detected for option: '{0}' with requirement on: '{1}'" msgstr "" -#: tiramisu/setting.py:612 +#: tiramisu/setting.py:616 msgid "option '{0}' has requirement's property error: {1} {2}" msgstr "" @@ -524,51 +528,51 @@ msgstr "" msgid "a dictionary cannot be persistent" msgstr "" -#: tiramisu/value.py:339 +#: tiramisu/value.py:356 msgid "no value for {0} cannot change owner to {1}" msgstr "" -#: tiramisu/value.py:421 +#: tiramisu/value.py:438 msgid "can force cache only if cache is actived in config" msgstr "" -#: tiramisu/value.py:460 +#: tiramisu/value.py:477 msgid "{0} is already a Multi " msgstr "" -#: tiramisu/value.py:496 tiramisu/value.py:560 +#: tiramisu/value.py:513 tiramisu/value.py:577 msgid "invalid len for the slave: {0} which has {1} as master" msgstr "" -#: tiramisu/value.py:532 +#: tiramisu/value.py:549 msgid "cannot append a value on a multi option {0} which is a slave" msgstr "" -#: tiramisu/value.py:570 +#: tiramisu/value.py:587 msgid "cannot sort multi option {0} if master or slave" msgstr "" -#: tiramisu/value.py:574 +#: tiramisu/value.py:591 msgid "cmp is not permitted in python v3 or greater" msgstr "" -#: tiramisu/value.py:583 +#: tiramisu/value.py:600 msgid "cannot reverse multi option {0} if master or slave" msgstr "" -#: tiramisu/value.py:591 +#: tiramisu/value.py:608 msgid "cannot insert multi option {0} if master or slave" msgstr "" -#: tiramisu/value.py:599 +#: tiramisu/value.py:616 msgid "cannot extend multi option {0} if master or slave" msgstr "" -#: tiramisu/value.py:610 +#: tiramisu/value.py:627 msgid "invalid value {0} for option {1}: {2}" msgstr "" -#: tiramisu/value.py:628 +#: tiramisu/value.py:645 msgid "cannot pop a value on a multi option {0} which is a slave" msgstr ""