Commit graph

255 commits

Author SHA1 Message Date
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
Garette Emmanuel
899f864f8d works on performante 2013-03-26 10:29:49 +01:00
Garette Emmanuel
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
gwen
d00a623fc1 validator set to false for read_write in setting 2013-02-06 14:34:12 +01:00
gwen
cda5d8c0bd generic owners shall live in settings 2012-12-11 11:18:53 +01:00
gwen
ca2f4487dd add owner 2012-12-10 14:38:25 +01:00
gwen
cd50cf7551 owners are *real* objects now 2012-12-10 14:10:05 +01:00
gwen
07d3cb1037 constants heritage 2012-12-10 09:53:13 +01:00
gwen
e118f07539 groupe_types are real types now 2012-12-06 18:14:57 +01:00
gwen
4393da13ab validation of the len of the multi in a group 2012-12-04 12:06:26 +01:00
gwen
86f9096937 settings are in a separate object 2012-11-19 10:45:03 +01:00