Project

General

Profile

Evolution #7343

Plantage si utilisation d'une variable experte dans une fonction alors qu'on est en mode normal

Added by Joël Cuissinat almost 9 years ago. Updated almost 9 years ago.

Status:
Fermé
Priority:
Normal
Assigned To:
Category:
-
Start date:
02/17/2014
Due date:
02/21/2014
% Done:

100%

Estimated time:
1.00 h
Spent time:
Distribution:
EOLE 2.4

Description

Avec les morceaux de dictionnaires suivant :

        <family name='famille basique'>
            <variable name='v1' description='v1' mandatory='True'/>
        </family>
        <family name='famille experte' mode='expert'>
            <variable name='v2' description='v2' mandatory='True'/>
        </family>

        <check name='valid_differ' target='v1'>
            <param type='eole'>v2</param>
        </check>

Cela donne :
from eolegenconfig import lib
lib.set_mode('pouet', 'basic')
a=lib.get_config('pouet')
>>> a.creole.famille_basique.v1=u'test'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/tiramisu/config.py", line 181, in __setattr__
    self._setattr(name, value)
  File "/usr/lib/python2.7/dist-packages/tiramisu/config.py", line 196, in _setattr
    force_permissive=force_permissive)
  File "/usr/lib/python2.7/dist-packages/tiramisu/value.py", line 255, in setitem
    'validator' in self.context().cfgimpl_get_settings())
  File "/usr/lib/python2.7/dist-packages/tiramisu/option.py", line 449, in impl_validate
    do_validation(value, force_index)
  File "/usr/lib/python2.7/dist-packages/tiramisu/option.py", line 432, in do_validation
    descr._valid_consistency(self, _value, context, _index)
  File "/usr/lib/python2.7/dist-packages/tiramisu/option.py", line 1310, in _valid_consistency
    all_cons_opts)
  File "/usr/lib/python2.7/dist-packages/tiramisu/option.py", line 370, in _launch_consistency
    descr.impl_get_path_by_opt(opt), validate=False)
  File "/usr/lib/python2.7/dist-packages/tiramisu/config.py", line 223, in _getattr
    force_properties=force_properties)
  File "/usr/lib/python2.7/dist-packages/tiramisu/config.py", line 73, in cfgimpl_get_home_by_path
    force_properties=force_properties)
  File "/usr/lib/python2.7/dist-packages/tiramisu/config.py", line 244, in _getattr
    force_properties=force_properties)
  File "/usr/lib/python2.7/dist-packages/tiramisu/setting.py", line 481, in validate_properties
    str(props)), props)
tiramisu.error.PropertiesOptionError: trying to access to an option named: famille_experte with properties ['expert']

7343.patch View (597 Bytes) Joël Cuissinat, 02/06/2014 04:42 PM

History

#1 Updated by Joël Cuissinat almost 9 years ago

#2 Updated by Emmanuel GARETTE almost 9 years ago

Corrigé upstream (commit : 72f06bc).

#3 Updated by Daniel Dehennin almost 9 years ago

  • Due date set to 02/21/2014
  • Status changed from Accepté to Résolu
  • Start date set to 02/17/2014
  • % Done changed from 0 to 100

#4 Updated by Bruno Boiget almost 9 years ago

  • Status changed from Résolu to Fermé

testé sur scribe avec le dictionnaire donné en exemple

>>> from eolegenconfig import lib
>>> lib.set_mode('pouet', 'basic')
>>> a=lib.get_config('pouet')
>>> a.creole.famille_basique.v1=u'test'
>>> a.creole.famille_basique.v1
u'test'

Also available in: Atom PDF