remove pep8 validation errors
This commit is contained in:
@ -20,7 +20,6 @@
|
||||
# ____________________________________________________________
|
||||
"options handler global entry point"
|
||||
import weakref
|
||||
from copy import copy
|
||||
|
||||
|
||||
from tiramisu.error import PropertiesOptionError, ConfigError, ConflictError
|
||||
@ -603,9 +602,16 @@ class _CommonConfig(SubConfig):
|
||||
fake_config = Config(self._impl_descr, persistent=False,
|
||||
force_storages=get_storages_validation(),
|
||||
force_settings=self.cfgimpl_get_settings())
|
||||
fake_config.cfgimpl_get_values()._p_._values = copy(self.cfgimpl_get_values()._p_.get_modified_values())
|
||||
fake_config.cfgimpl_get_values()._p_._values = self.cfgimpl_get_values()._p_.get_modified_values()
|
||||
return fake_config
|
||||
|
||||
def duplicate(self):
|
||||
config = Config(self._impl_descr)
|
||||
config.cfgimpl_get_values()._p_._values = self.cfgimpl_get_values()._p_.get_modified_values()
|
||||
config.cfgimpl_get_settings()._p_._properties = self.cfgimpl_get_settings()._p_.get_modified_properties()
|
||||
config.cfgimpl_get_settings()._p_._permissives = self.cfgimpl_get_settings()._p_.get_modified_permissives()
|
||||
return config
|
||||
|
||||
|
||||
# ____________________________________________________________
|
||||
class Config(_CommonConfig):
|
||||
|
@ -302,6 +302,10 @@ class OptionDescription(BaseOption, StorageOptionDescription):
|
||||
def __getattr__(self, name, context=undefined):
|
||||
if name.startswith('_'): # or name.startswith('impl_'):
|
||||
return object.__getattribute__(self, name)
|
||||
if '.' in name:
|
||||
path = name.split('.')[0]
|
||||
subpath = '.'.join(name.split('.')[1:])
|
||||
return self.__getattr__(path, context=context).__getattr__(subpath, context=context)
|
||||
return self._getattr(name, context=context)
|
||||
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# ____________________________________________________________
|
||||
from copy import copy
|
||||
from ..util import Cache
|
||||
|
||||
|
||||
@ -58,10 +59,10 @@ class Settings(Cache):
|
||||
"""return all modified settings in a dictionary
|
||||
example: {'path1': set(['prop1', 'prop2'])}
|
||||
"""
|
||||
return self._properties
|
||||
return copy(self._properties)
|
||||
|
||||
def get_modified_permissives(self):
|
||||
"""return all modified permissives in a dictionary
|
||||
example: {'path1': set(['perm1', 'perm2'])}
|
||||
"""
|
||||
return self._permissives
|
||||
return copy(self._permissives)
|
||||
|
@ -15,7 +15,7 @@
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# ____________________________________________________________
|
||||
|
||||
from copy import copy
|
||||
from ..util import Cache
|
||||
|
||||
|
||||
@ -58,7 +58,7 @@ class Values(Cache):
|
||||
"""return all values in a dictionary
|
||||
example: {'path1': (owner, 'value1'), 'path2': (owner, 'value2')}
|
||||
"""
|
||||
return self._values
|
||||
return copy(self._values)
|
||||
|
||||
# owner
|
||||
def setowner(self, path, owner):
|
||||
|
Reference in New Issue
Block a user