diff --git a/tests/test_option_owner.py b/tests/test_option_owner.py index 8075aff..e33a034 100644 --- a/tests/test_option_owner.py +++ b/tests/test_option_owner.py @@ -72,9 +72,8 @@ def test_hidden_owner(): cfg.forcepermissive.option('dummy').value.get() cfg.forcepermissive.option('dummy').owner.isdefault() option = cfg.option("dummy") - option.forcepermissive() - option.value.get() - option.owner.isdefault() + option.forcepermissive.value.get() + option.forcepermissive.owner.isdefault() # assert not list_sessions() diff --git a/tiramisu/__init__.py b/tiramisu/__init__.py index b640279..8d15d1e 100644 --- a/tiramisu/__init__.py +++ b/tiramisu/__init__.py @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2012-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/api.py b/tiramisu/api.py index 6fef95d..ee8fcc3 100644 --- a/tiramisu/api.py +++ b/tiramisu/api.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2017-2025 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2017-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the @@ -1244,8 +1244,8 @@ class TiramisuOption( index: Optional[int] = None, config_bag: Optional[ConfigBag] = None, *, - subconfig: Optional[SubConfig] = None, allow_dynoption: bool = False, + subconfig: Optional[SubConfig] = None, ) -> None: self._path = path self._index = index @@ -1269,6 +1269,24 @@ class TiramisuOption( self._config_bag, self._subconfig, ) + if subfunc in ["forcepermissive", "unrestraint", "nowarnings"]: + if subfunc == "unrestraint" and self._config_bag.is_unrestraint: + return self + #if self._orig_config_bags: + # msg = _( + # "do not use unrestraint, nowarnings or forcepermissive together" + # ) + # raise ConfigError(msg) + config_bag = self._config_bag.copy() + if subfunc == "unrestraint": + config_bag.unrestraint() + elif subfunc == "nowarnings": + config_bag.nowarnings() + else: + config_bag.set_permissive() + if self._subconfig is not None: + self._subconfig.config_bag = config_bag + return self.__class__(self._path, self._index, config_bag, subconfig=self._subconfig) raise ConfigError( _("please specify a valid sub function ({0}.{1}) for {2}").format( self.__class__.__name__, subfunc, self._path @@ -1346,10 +1364,10 @@ class TiramisuOption( if self._tiramisu_dict is None: # pragma: no cover self._load_dict() return self._tiramisu_dict.set_updates(body) - - def forcepermissive(self): - self._set_subconfig() - self._subconfig.config_bag.set_permissive() +# +# def forcepermissive(self): +# self._set_subconfig() +# self._subconfig.config_bag.set_permissive() class TiramisuContextInformation(TiramisuConfig): diff --git a/tiramisu/autolib.py b/tiramisu/autolib.py index 81c5762..359ebfd 100644 --- a/tiramisu/autolib.py +++ b/tiramisu/autolib.py @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2012-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/cacheobj.py b/tiramisu/cacheobj.py index 508fb2f..844acb6 100644 --- a/tiramisu/cacheobj.py +++ b/tiramisu/cacheobj.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- "cache used by storage" -# Copyright (C) 2013-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2013-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/config.py b/tiramisu/config.py index 7cea7ea..f9612d6 100644 --- a/tiramisu/config.py +++ b/tiramisu/config.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2012-2025 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2012-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/error.py b/tiramisu/error.py index 08f24fd..dead711 100644 --- a/tiramisu/error.py +++ b/tiramisu/error.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2012-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2012-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/function.py b/tiramisu/function.py index b31013e..ddcec38 100644 --- a/tiramisu/function.py +++ b/tiramisu/function.py @@ -1,4 +1,4 @@ -# Copyright (C) 2018-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2018-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/i18n.py b/tiramisu/i18n.py index 901835c..c71cb2c 100644 --- a/tiramisu/i18n.py +++ b/tiramisu/i18n.py @@ -1,5 +1,5 @@ # -*- coding: UTF-8 -*- -# Copyright (C) 2012-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2012-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/log.py b/tiramisu/log.py index 504da72..905b98a 100644 --- a/tiramisu/log.py +++ b/tiramisu/log.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- "logger for tiramisu" -# Copyright (C) 2019-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2019-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/__init__.py b/tiramisu/option/__init__.py index 355cf54..570d7dd 100644 --- a/tiramisu/option/__init__.py +++ b/tiramisu/option/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2014-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2014-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/baseoption.py b/tiramisu/option/baseoption.py index 19ab5ef..c3e7bd4 100644 --- a/tiramisu/option/baseoption.py +++ b/tiramisu/option/baseoption.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2014-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2014-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/booloption.py b/tiramisu/option/booloption.py index 3ffaee7..5428d84 100644 --- a/tiramisu/option/booloption.py +++ b/tiramisu/option/booloption.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2017-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2017-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/broadcastoption.py b/tiramisu/option/broadcastoption.py index 22c2746..8f8b8c0 100644 --- a/tiramisu/option/broadcastoption.py +++ b/tiramisu/option/broadcastoption.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2017-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2017-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/choiceoption.py b/tiramisu/option/choiceoption.py index b04d647..041e5de 100644 --- a/tiramisu/option/choiceoption.py +++ b/tiramisu/option/choiceoption.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2017-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2017-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/dateoption.py b/tiramisu/option/dateoption.py index 4c12535..a80b897 100644 --- a/tiramisu/option/dateoption.py +++ b/tiramisu/option/dateoption.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2017-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2017-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/domainnameoption.py b/tiramisu/option/domainnameoption.py index 5d0e120..d20de7e 100644 --- a/tiramisu/option/domainnameoption.py +++ b/tiramisu/option/domainnameoption.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2017-2025 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2017-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/dynoptiondescription.py b/tiramisu/option/dynoptiondescription.py index afaf7f6..387a20f 100644 --- a/tiramisu/option/dynoptiondescription.py +++ b/tiramisu/option/dynoptiondescription.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2017-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2017-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/emailoption.py b/tiramisu/option/emailoption.py index adc1416..9dc475a 100644 --- a/tiramisu/option/emailoption.py +++ b/tiramisu/option/emailoption.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2017-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2017-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/filenameoption.py b/tiramisu/option/filenameoption.py index a65ef8e..536c652 100644 --- a/tiramisu/option/filenameoption.py +++ b/tiramisu/option/filenameoption.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2017-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2017-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/floatoption.py b/tiramisu/option/floatoption.py index 9e4d7a7..eace175 100644 --- a/tiramisu/option/floatoption.py +++ b/tiramisu/option/floatoption.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2017-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2017-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/intoption.py b/tiramisu/option/intoption.py index 3701a9b..98e90c6 100644 --- a/tiramisu/option/intoption.py +++ b/tiramisu/option/intoption.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2017-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2017-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/ipoption.py b/tiramisu/option/ipoption.py index 2426796..62705df 100644 --- a/tiramisu/option/ipoption.py +++ b/tiramisu/option/ipoption.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2017-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2017-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/leadership.py b/tiramisu/option/leadership.py index 7ab228e..c93f7f3 100644 --- a/tiramisu/option/leadership.py +++ b/tiramisu/option/leadership.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- "Leadership support" -# Copyright (C) 2014-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2014-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/macoption.py b/tiramisu/option/macoption.py index 93f6d5a..af3f47d 100644 --- a/tiramisu/option/macoption.py +++ b/tiramisu/option/macoption.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2020-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2020-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/netmaskoption.py b/tiramisu/option/netmaskoption.py index 4d1157f..3e6bed7 100644 --- a/tiramisu/option/netmaskoption.py +++ b/tiramisu/option/netmaskoption.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2017-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2017-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/networkoption.py b/tiramisu/option/networkoption.py index d5f7c18..e5f6f9f 100644 --- a/tiramisu/option/networkoption.py +++ b/tiramisu/option/networkoption.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2017-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2017-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/option.py b/tiramisu/option/option.py index 6988857..36e5947 100644 --- a/tiramisu/option/option.py +++ b/tiramisu/option/option.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- "option types and option description" -# Copyright (C) 2012-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2012-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/optiondescription.py b/tiramisu/option/optiondescription.py index 6da0267..09dacc3 100644 --- a/tiramisu/option/optiondescription.py +++ b/tiramisu/option/optiondescription.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2014-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2014-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/passwordoption.py b/tiramisu/option/passwordoption.py index 349b9cf..2ae5804 100644 --- a/tiramisu/option/passwordoption.py +++ b/tiramisu/option/passwordoption.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2017-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2017-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/permissionsoption.py b/tiramisu/option/permissionsoption.py index 497eaaa..4d95356 100644 --- a/tiramisu/option/permissionsoption.py +++ b/tiramisu/option/permissionsoption.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2023-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2023-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/portoption.py b/tiramisu/option/portoption.py index e930863..80ba461 100644 --- a/tiramisu/option/portoption.py +++ b/tiramisu/option/portoption.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2017-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2017-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/stroption.py b/tiramisu/option/stroption.py index f47825e..3e08658 100644 --- a/tiramisu/option/stroption.py +++ b/tiramisu/option/stroption.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2017-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2017-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/symlinkoption.py b/tiramisu/option/symlinkoption.py index 9b54f12..3233db5 100644 --- a/tiramisu/option/symlinkoption.py +++ b/tiramisu/option/symlinkoption.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2017-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2017-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/urloption.py b/tiramisu/option/urloption.py index 20f3481..d54509a 100644 --- a/tiramisu/option/urloption.py +++ b/tiramisu/option/urloption.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2017-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2017-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/option/usernameoption.py b/tiramisu/option/usernameoption.py index a5200d0..79c1586 100644 --- a/tiramisu/option/usernameoption.py +++ b/tiramisu/option/usernameoption.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2017-2024 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2017-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/setting.py b/tiramisu/setting.py index 23df689..82d3ce9 100644 --- a/tiramisu/setting.py +++ b/tiramisu/setting.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- "sets the options of the configuration objects Config object itself" -# Copyright (C) 2012-2025 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2012-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the diff --git a/tiramisu/value.py b/tiramisu/value.py index a37a48c..c26e678 100644 --- a/tiramisu/value.py +++ b/tiramisu/value.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- "takes care of the option's values and multi values" -# Copyright (C) 2013-2025 Team tiramisu (see AUTHORS for all contributors) +# Copyright (C) 2013-2026 Team tiramisu (see AUTHORS for all contributors) # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the