Commit Graph

258 Commits

Author SHA1 Message Date
Emmanuel Garette 89fd367b20 validator's function can have 1 arg, 2 args or 3 args 2017-01-12 21:58:53 +01:00
Emmanuel Garette df90e74819 mandatories masterslaves with consistency and default value is acceptable 2016-12-07 17:28:31 +01:00
Emmanuel Garette fb16dd2a79 slave's requires with multi is different than slave's requires with non multi option 2016-11-14 21:14:45 +01:00
Emmanuel Garette fce5a8735e better error message 2016-10-24 21:59:40 +02:00
Emmanuel Garette 44dfd21ff6 better error msg 2016-10-23 23:18:06 +02:00
Emmanuel Garette 9a912376b9 simplify apply_requires 2016-10-23 09:38:35 +02:00
Emmanuel Garette 2e4fdbca03 transitive in apply_requires should only by apply if properties are same has testing action 2016-10-12 22:17:04 +02:00
Emmanuel Garette 19b676967d better propertyerror message 2016-09-14 20:17:25 +02:00
Emmanuel Garette 44d585a5e2 better mandatory/empty support for mandatory_warnings 2016-06-29 21:42:54 +02:00
Emmanuel Garette 9adfffe339 set force_permissive to append 2016-03-17 23:16:21 +01:00
Emmanuel Garette da89c1aa58 force_store_value is now used directly when configuration is loaded 2016-03-07 16:13:41 +01:00
Emmanuel Garette f4307b9122 cannot append properties for option with forbidden_set_properties 2016-01-25 15:49:40 +01:00
Emmanuel Garette b521c459ee remove all try/except 2016-01-03 21:18:52 +01:00
Emmanuel Garette d0e2b5d8c4 remove some try/except 2015-12-30 22:32:07 +01:00
Emmanuel Garette 4d4d789c8a simplification 2015-12-17 22:41:57 +01:00
Emmanuel Garette 59f59b0b1b add some optimisation 2015-12-14 23:37:15 +01:00
Emmanuel Garette 98200ecae5 improvemnt information 2015-11-30 15:55:34 +01:00
Emmanuel Garette a521a6d322 requires could be apply to a slave and properties could be different 2015-11-29 23:03:08 +01:00
Emmanuel Garette 54ca54e505 separate value in slave 2015-11-19 22:25:00 +01:00
Emmanuel Garette a248508498 extend properties must save setting only if all properties are correct 2015-11-01 11:12:27 +01:00
Emmanuel Garette 8d33fd4500 setting must have public method to get getproperties with path 2015-11-01 10:57:36 +01:00
Emmanuel Garette a0de1109f7 optimise mandatory_warnings 2015-10-29 09:03:13 +01:00
Emmanuel Garette 9da7e89176 empty property only available for multi 2015-07-27 09:32:42 +02:00
Emmanuel Garette 8e7a32de08 add global 'empty' property, this property raise mandatory PropertiesOptionError if multi or master have empty value 2015-07-26 19:13:25 +02:00
Emmanuel Garette 6cc74506fb Some optimisations 2015-05-03 09:56:03 +02:00
Emmanuel Garette 487b99b32c for a multi mandatory, allow [] with allow_empty_list attribut 2015-04-20 14:49:43 +02:00
Emmanuel Garette 6fc921fc19 difference between option/optiondescription in PropertiesOptionError message 2015-04-19 09:25:49 +02:00
Emmanuel Garette d959020eed ability to disable warnings validation 2015-04-18 23:11:57 +02:00
Emmanuel Garette 2ccf92f879 improve GroupConfig/MetaConfig
add set_value in GroupConfig
2014-12-01 21:49:50 +01:00
Emmanuel Garette ed3373cff0 bad characters in DomainnameOption could be in warning level 2014-10-26 09:38:17 +01:00
Emmanuel Garette 9f3d676280 reduce memory usage 2014-10-25 22:11:31 +02:00
Emmanuel Garette 71f8926fca better support for sqlalchemy storage 2014-07-06 15:31:57 +02:00
Emmanuel Garette b64189f763 add DynOptionDescription 2014-06-19 23:22:39 +02:00
Emmanuel Garette 9112a8c5b0 add SubMulti 2014-04-26 22:37:01 +02:00
Emmanuel Garette 5d8b5719a0 Merge branch 'master' into orm
Conflicts:
	test/test_config_api.py
	tiramisu/autolib.py
	tiramisu/config.py
	tiramisu/option.py
	tiramisu/value.py
2014-04-13 10:30:42 +02:00
Emmanuel Garette cd4d3527c7 split tiramisu/option.py and add MasterSlaves object 2014-04-12 17:55:13 +02:00
Emmanuel Garette d1e86f6d48 Merge branch 'log' 2014-04-03 22:16:08 +02:00
Emmanuel Garette da434a4273 add logger in validation 2014-04-03 22:15:41 +02:00
Emmanuel Garette a3c5e6034f Merge branch 'force_permissive'
Conflicts:
	test/test_freeze.py
2014-03-31 22:38:56 +02:00
Emmanuel Garette cd52729952 add force_permissive in config's method (iter_all, iter_group, find, find_first and make_dict)
rename _getattr to getattr
2014-03-31 22:34:57 +02:00
Emmanuel Garette ff5376a382 properties are check now in getowner
get_modified_values works good with force_store_value
2014-03-29 20:31:56 +01:00
Emmanuel Garette a04a61f1a4 Merge branch 'master' into lgpl 2014-03-15 10:11:17 +01:00
Emmanuel Garette d3f9d20ab5 add extend in config setting 2014-03-08 18:53:22 +01:00
Emmanuel Garette d5b83c123c tiramisu/setting.py : properties store in cache was a reference to a list modified in validation, should copy properties in cache 2014-02-20 16:55:35 +01:00
Daniel Dehennin f8ac263c86 Hotfix release 1.0~2.4.1
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iF4EABEKAAYFAlLyBpcACgkQWjgIUPVihwwhyQD/Ri/R6wO/zk49ILx5UzPdDDcU
 UCWxsKvbCIloO76BMcIA/0nx/6PUVc/v3iag5reNvtrXJQzdKlprmkjvBhLalVJS
 =w09x
 -----END PGP SIGNATURE-----

Merge tag 'release/1.0_2.4.1'

Hotfix release 1.0~2.4.1
2014-02-05 11:22:17 +01:00
Emmanuel Garette 6f5d471db1 if option with requires has a property, calculated properties are store in storage 2014-02-05 10:37:39 +01:00
Emmanuel Garette 98bd35ad36 Merge branch 'master' into orm
Conflicts:
	tiramisu/config.py
	tiramisu/option.py
2014-02-04 21:54:30 +01:00
Emmanuel Garette c52b2f84f4 if option with requires has a property, calculated properties are store in storage 2014-02-04 21:40:07 +01:00
Emmanuel Garette 313b03b246 cache in sql works 2014-02-01 16:26:23 +01:00
Emmanuel Garette 02a987b39d sqlalchemy 2014-01-30 22:55:15 +01:00
Emmanuel Garette a1dd2cfce7 require works well in sqlalchemy storage 2014-01-27 17:16:05 +01:00
Emmanuel Garette d3f42efe85 typo 2014-01-25 18:38:51 +01:00
Emmanuel Garette 880b6366eb Merge branch 'master' into orm
Conflicts:
	tiramisu/setting.py
2014-01-25 16:39:32 +01:00
Emmanuel Garette 138018dfe9 if we delete all reference to a Config and we have reference to old SubConfig, Values, Multi or Settings, make a ConfigError instead of AttributError on NoneType object 2014-01-25 11:20:11 +01:00
Emmanuel Garette cbfb5a45b0 Merge branch 'master' into orm 2014-01-25 10:22:17 +01:00
gwen 21a67971c5 typo propertive -> property 2014-01-24 09:17:46 +01:00
Emmanuel Garette 661f844ce6 sqlalchemy has a storage 2014-01-20 14:53:14 +01:00
Emmanuel Garette 068f68460d Merge branch 'master' into orm 2014-01-18 10:25:09 +01:00
Emmanuel Garette 9d92ab84d7 regression: permissive for option is apply every time, not only when global permissive is set 2014-01-16 09:49:37 +01:00
Emmanuel Garette cde04d654a Merge branch 'master' into orm
Conflicts:
	tiramisu/setting.py
2014-01-09 20:32:17 +01:00
gwen 40ecddf242 docstring 2014-01-06 15:32:28 +01:00
gwen 3c36e05d82 adds test for an API 2014-01-06 14:40:29 +01:00
gwen f0ecbf4914 adds an extend API for the settings 2014-01-06 14:32:56 +01:00
Emmanuel Garette 64ca069a0b Merge branch 'master' into orm
Conflicts:
	test/test_config.py
	tiramisu/autolib.py
	tiramisu/option.py
	tiramisu/value.py
2013-12-12 17:50:42 +01:00
Emmanuel Garette 73745be440 Important behavior change : to add default_multi value, now use Multi.append(), not Multi.append(None) 2013-12-09 17:59:39 +01:00
Emmanuel Garette 0f966f6d26 check if permissive is in global properties before allow permissive for an option 2013-12-09 15:29:37 +01:00
Emmanuel Garette 374c56a9c8 first version with sqlalchemy option's storage 2013-11-23 23:34:17 +01:00
Emmanuel Garette 8a7078d3b0 gpl to lgpl 2013-09-22 22:33:09 +02:00
Emmanuel Garette c84d13a1c6 we can serialize Config now 2013-09-22 20:57:52 +02:00
Emmanuel Garette 57f4dd8d3f allow mandatory value (see 9ddf100118 for more details) 2013-09-16 20:51:13 +02:00
Emmanuel Garette 632de1cffb comment tiramisu/setting.py 2013-09-07 22:16:50 +02:00
Emmanuel Garette 371f094dcb comment tiramisu/setting.py 2013-09-07 21:47:17 +02:00
Emmanuel Garette 77c1ccf40b add 'cache' property 2013-09-07 17:25:22 +02:00
Emmanuel Garette 22bfbb9fa4 storage no more in setting.py, code is now in storage/__init__.py 2013-09-06 23:15:36 +02:00
gwen 18fc5db4ac lists in sets 2013-09-06 09:05:19 +02:00
Emmanuel Garette dc688ad644 ro/rw_append/remove are now 'set' type 2013-09-04 09:09:45 +02:00
Emmanuel Garette 4636a977cc requirements: calculate all requirements for an option 2013-09-02 17:13:43 +02:00
gwen 5efc62af09 docstring setpermissive 2013-08-29 09:32:32 +02:00
Emmanuel Garette 7f755e0ef8 setpermissive should have opt has option 2013-08-28 22:05:44 +02:00
gwen fbf05ba5e4 python 3 compatibility
remove __eq__ and __ne__ in Option
2013-08-28 21:13:42 +02:00
Emmanuel Garette 3be005e82e add test test/test_dereference.py + memoryleaks in optiondescription's cache 2013-08-27 21:36:52 +02:00
Emmanuel Garette d75cef9c0f pep8 2013-08-27 17:13:20 +02:00
gwen a894a5e27b rename API add_owner -> addowner 2013-08-27 16:12:53 +02:00
Emmanuel Garette acd27fb56c huge use of weakrefs to remove memoryleaks due to circular references 2013-08-27 11:39:32 +02:00
Emmanuel Garette 36def6533f store session in dictionary storage 2013-08-27 09:46:52 +02:00
Emmanuel Garette fb1eba39ea save storage with get_storage
list_sessions and delete_session is now in setting directly
2013-08-26 21:54:41 +02:00
Emmanuel Garette 0bc47b1cf9 ConstError in tiramisu/error.py
storage_type is now unique
rename _const => _NameSpace
can change storage's options in set_storage

storage :
add Setting object in storage
rename enumerate to list_sessions
rename delete to delete_session
auto-create owner when load sqlite3 storage and in getowner
2013-08-26 21:48:42 +02:00
Emmanuel Garette 6b9d5aed59 add enumerate and delete method for manage storage 2013-08-25 21:57:11 +02:00
Emmanuel Garette dcb12dac02 can change storage with set_storage, storage's name is store in storage object and storage is create with get_storage 2013-08-25 20:49:24 +02:00
Emmanuel Garette 36ed6f874f add some tests for values
cannot use __setitem__ to set value for an option
in append, len should not greater than master option
2013-08-25 18:06:07 +02:00
Emmanuel Garette c2b16d2605 add _path in reset for performance + more tests 2013-08-24 16:30:46 +02:00
Emmanuel Garette f8422c03e8 reqpath is get from option, so reqpath ever exists, cannot raise AttributeError 2013-08-22 22:52:29 +02:00
Emmanuel Garette 04aa4e6bf1 never same calculated properties has properties (only in cache) 2013-08-22 22:48:09 +02:00
gwen 747d994762 documentation on the requirements and docstring updates 2013-08-22 11:08:26 +02:00
Emmanuel Garette 1ddd88fc99 some corrections in sqlite3 storage 2013-08-21 23:21:28 +02:00
Emmanuel Garette b6bb685ca5 key is now always path and change opt by path dictionary storage 2013-08-21 22:21:50 +02:00
Emmanuel Garette 707a215a2c pep8 2013-08-21 18:34:32 +02:00
gwen acca6d5a27 documentation update and docstrings 2013-08-21 17:21:09 +02:00
Emmanuel Garette 0d5a447eb3 add persistent option for db 2013-08-20 22:45:11 +02:00
Emmanuel Garette d971448d02 pep8 2013-08-20 16:48:19 +02:00
Emmanuel Garette 2e8c75a602 merge from val_prop_plugin branch 2013-08-20 16:45:54 +02:00
Emmanuel Garette 82b0e26568 merge from val_prop_plugin branch 2013-08-20 16:44:52 +02:00
gwen 5c8bb1f8f9 documentation update 2013-08-20 16:38:06 +02:00
Emmanuel Garette ace7f6f828 merge from master 2013-08-20 16:33:32 +02:00
gwen 564fecc261 pep 8 lines too long 2013-08-20 12:08:02 +02:00
Emmanuel Garette e826f3d1c6 we can personalise storage easily 2013-08-20 09:47:12 +02:00
Emmanuel Garette df7d6759cd add sqlite plugin 2013-08-19 11:01:21 +02:00
Emmanuel Garette f6f709f83d split cache/value/setting in plugin 2013-08-14 23:06:31 +02:00
Emmanuel Garette 513722ed57 corrections in tiramisu's setting 2013-07-23 14:24:42 +02:00
Emmanuel Garette e9ffd96a28 update translation 2013-07-18 21:25:07 +02:00
Emmanuel Garette 15ac8c2872 update french translation 2013-07-17 22:30:35 +02:00
Emmanuel Garette de44daafeb - can reset directly custom settings for an option: setting[option].reset()
- option properties are now tuple in internal, and change it to set when needed (that coping data)
2013-07-13 10:42:10 +02:00
gwen a95f19d5f4 default settings 2013-07-12 16:20:34 +02:00
Emmanuel Garette 0afb521766 support multi requirement with inverse for same option 2013-07-03 15:04:15 +02:00
Emmanuel Garette 4b5d9b4229 __str__ method could return unicode object, force to decode in str 2013-07-01 16:49:10 +02:00
Emmanuel Garette b8bfa02e02 Remove 'build_actions' in 'apply_requires', now 'validate_requires_arg' build requires with tuple of tuple
New _requires format:
- requirement (like old format)
- tuple of requirements, each items are a tuple of requirement with same action
2013-07-01 11:55:32 +02:00
Emmanuel Garette 9b134c3aa7 requirement are now a dictionary (not anymore a tuple) 2013-06-29 18:41:14 +02:00
Emmanuel Garette e501c6d12d support multi requires with inverse set to True 2013-06-28 11:59:51 +02:00
Emmanuel Garette c2471320c3 apply_requires: add property if any property raise PropertyError if same_action is False 2013-06-13 14:43:51 +02:00
gwen 1c70a07d7e transitivity in the requirements 2013-06-10 15:19:00 +02:00
Emmanuel Garette 2751a2694a RequirementRecursiveError => RequirementError
Properties in "apply_requires" are now transitive (but only if tested property is in properties list)
New requirement option (a boolean), don't touch properties if PropertyError in "apply_requires"
2013-05-31 23:30:00 +02:00
gwen 879a415e75 add docstrings 2013-05-23 14:55:52 +02:00
gwen 0e6032dd88 new api documentation 2013-05-21 18:42:56 +02:00
Emmanuel Garette 536eb27904 multi, None and validation 2013-05-10 22:34:07 +02:00
Emmanuel Garette 6de65859b4 * config herite from BaseInformation class
* _cfgimpl_ => _impl_
* optimpl_ => impl_
* properties/permissives are now set/frozenset
* validation raise ValueError if not valid, didn't return anything otherwise
* consistencies are now validate in setting and when deleting value
* ip/network with netmask consistency now works
* DomainnameOption now works
* if no validation, don't set cache for value
* symlinkoption: remove path (not used)
2013-05-08 18:14:42 +02:00
Emmanuel Garette bcfc0cd41b tiramisu/setting.py: _get_properties and validate_properties are now more easier to read and has best performance 2013-05-02 11:23:04 +02:00
Emmanuel Garette 2c5bbb7bc0 Requires need option, not path
Valid requires
2013-04-26 14:40:44 +02:00
Emmanuel Garette 509f41e14c missing properties in PropertiesOptionError 2013-04-24 17:40:16 +02:00
Emmanuel Garette e883e5b89e remove _setoption in SymLinkOption
objimpl_ => optimpl_
ConflictConfigError => ConflictError
add read_write/read_only/getowner in Config
2013-04-22 09:19:05 +02:00
Emmanuel Garette 682d9fe207 add option name's validation and rename Option method with objimpl_ 2013-04-20 21:58:52 +02:00
Emmanuel Garette d4ef47759e Manipulate properties is now more convenient:
c.cfgimpl_get_settings().has_property('hidden') => 'hidden' in c.cfgimpl_get_settings()
c.cfgimpl_get_settings().has_property('hidden', option1) => 'frozen' in c.cfgimpl_get_settings()[opt]

c.cfgimpl_get_settings().get_properties(option1) => c.cfgimpl_get_settings()[option1]
c.cfgimpl_get_settings().get_properties(option1) => c.cfgimpl_get_settings()[option1]

c.cfgimpl_get_settings().add_property('hidden', option1) => c.cfgimpl_get_settings()[optiont1].append('hidden')
c.cfgimpl_get_settings().del_property('hidden', option1) => c.cfgimpl_get_settings()[optiont1].remove('hidden')

c.cfgimpl_get_settings().enable_property('hidden') => c.cfgimpl_get_settings().append('hidden')
c.cfgimpl_get_settings().disable_property('hidden') => c.cfgimpl_get_settings().remove('hidden')
2013-04-20 17:30:05 +02:00
Emmanuel Garette 54fe8d0f4b cache for properties is now in get_properties and not for validate_properties 2013-04-20 11:25:14 +02:00
Emmanuel Garette a11768ef43 remove expired cache with config.cfgimpl_reset_cache(True) 2013-04-19 22:42:33 +02:00
Emmanuel Garette d7b5d9dc16 add SlaveError for slave's length 2013-04-19 20:23:34 +02:00
Emmanuel Garette e08bd93cd8 all multi gestion is now in Multi 2013-04-18 23:06:14 +02:00
Emmanuel Garette 324c3d2cf6 * to "reset" a value, now you just have to delete it
config.unwrap_from_path("string").reset(config) => del(config.string)
* add cache for value/setting to 5 secds
to "reset" cache just do: config.cfgimpl_clean_cache()
* can desactivate cache by removing "expire" property
2013-04-18 20:26:40 +02:00
Emmanuel Garette 3170237c8e properties validation not in setting and now launch when modify multi 2013-04-17 21:33:34 +02:00
Emmanuel Garette 9357b342c1 review exception 2013-04-14 12:01:32 +02:00
Emmanuel Garette 67e67a5020 NoValueReturn is not needed now + apply_requires is now in settings 2013-04-08 16:05:56 +02:00
Emmanuel Garette c918191d21 permissives are for a specified option not config 2013-04-04 15:14:16 +02:00
Emmanuel Garette 6105191d9c tiramisu/value.py : self.opt => opt + disable permissive in read_write mode 2013-04-03 17:05:41 +02:00
Emmanuel Garette e6f00948f3 optimisations and all is properties 2013-04-03 12:20:26 +02:00
Emmanuel Garette 899f864f8d works on performante 2013-03-26 10:29:49 +01:00
Emmanuel Garette 15beeda0f0 add permissive in config 2013-03-14 11:31:44 +01:00
gwen e360a07a21 BaseType refactoring 2013-03-01 13:10:52 +01:00
gwen e6d5d349c8 refactoring values 2013-02-21 17:07:00 +01:00
gwen a8e6bac87f refactoring, the values are in an OptionValues object 2013-02-08 11:50:22 +01:00
gwen 9259a6e3f7 values are in value objects now 2013-02-07 16:20:21 +01:00
gwen a404c4c992 masters shall have the same names as groups 2013-02-06 16:21:30 +01:00
gwen 6a3b7102b5 adds a freeze_everything possibility 2013-02-06 14:59:24 +01:00