some improvemnt
This commit is contained in:
parent
e73e6322ae
commit
1d677e47ef
|
@ -88,7 +88,7 @@ class TiramisuOptionOption:
|
||||||
'username': 'username',
|
'username': 'username',
|
||||||
'string': 'str',
|
'string': 'str',
|
||||||
'symlink': 'symlink'}
|
'symlink': 'symlink'}
|
||||||
if self.schema['type'] in types :
|
if self.schema['type'] in types:
|
||||||
return types[self.schema['type']]
|
return types[self.schema['type']]
|
||||||
raise Exception('unsupported type {}'.format(self.schema['type']))
|
raise Exception('unsupported type {}'.format(self.schema['type']))
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ class TiramisuOptionOption:
|
||||||
props = []
|
props = []
|
||||||
model = self.model.get(self._path, {})
|
model = self.model.get(self._path, {})
|
||||||
if model.get('required'):
|
if model.get('required'):
|
||||||
#FIXME 'empty', 'needs_len'
|
# FIXME 'empty', 'needs_len'
|
||||||
props.append('mandatory')
|
props.append('mandatory')
|
||||||
if model.get('readOnly'):
|
if model.get('readOnly'):
|
||||||
props.append('frozen')
|
props.append('frozen')
|
||||||
|
@ -151,9 +151,9 @@ class _Value:
|
||||||
withwarning: bool):
|
withwarning: bool):
|
||||||
for key, option in schema['properties'].items():
|
for key, option in schema['properties'].items():
|
||||||
hidden = self.temp.get(key, {}).get('hidden', None)
|
hidden = self.temp.get(key, {}).get('hidden', None)
|
||||||
model_hidden = not self.model.get(key, {}).get('hidden', False) and \
|
model_display = not self.model.get(key, {}).get('hidden', False) and \
|
||||||
self.model.get(key, {}).get('display', True)
|
self.model.get(key, {}).get('display', True)
|
||||||
if hidden is False or (hidden is None and model_hidden):
|
if hidden is False or (hidden is None and model_display is True):
|
||||||
if option['type'] == 'object':
|
if option['type'] == 'object':
|
||||||
self._dict_walk(ret,
|
self._dict_walk(ret,
|
||||||
option,
|
option,
|
||||||
|
@ -283,9 +283,9 @@ class _Option:
|
||||||
for path, schema in self.schema['properties'].items():
|
for path, schema in self.schema['properties'].items():
|
||||||
if type == 'all' or schema['type'] not in ['object', 'array']:
|
if type == 'all' or schema['type'] not in ['object', 'array']:
|
||||||
hidden = self.temp.get(path, {}).get('hidden', None)
|
hidden = self.temp.get(path, {}).get('hidden', None)
|
||||||
model_hidden = not self.model.get(path, {}).get('hidden', False) and \
|
model_display = not self.model.get(path, {}).get('hidden', False) and \
|
||||||
self.model.get(path, {}).get('display', True)
|
self.model.get(path, {}).get('display', True)
|
||||||
if hidden is False or (hidden is None and model_hidden is True):
|
if hidden is False or (hidden is None and model_display is True):
|
||||||
if schema['type'] in ['object', 'array']:
|
if schema['type'] in ['object', 'array']:
|
||||||
yield TiramisuOptionDescription(self.config,
|
yield TiramisuOptionDescription(self.config,
|
||||||
schema,
|
schema,
|
||||||
|
@ -344,9 +344,9 @@ class TiramisuOptionDescription(_Option):
|
||||||
|
|
||||||
def group_type(self):
|
def group_type(self):
|
||||||
hidden = self.temp.get(self.path, {}).get('hidden', None)
|
hidden = self.temp.get(self.path, {}).get('hidden', None)
|
||||||
model_hidden = not self.model.get(self.path, {}).get('hidden', False) and \
|
model_display = not self.model.get(self.path, {}).get('hidden', False) and \
|
||||||
self.model.get(self.path, {}).get('display', True)
|
self.model.get(self.path, {}).get('display', True)
|
||||||
if hidden is False or (hidden is None and model_hidden):
|
if hidden is False or (hidden is None and model_display):
|
||||||
# FIXME
|
# FIXME
|
||||||
return 'default'
|
return 'default'
|
||||||
raise PropertiesOptionError(None, None, None, opt_type='optiondescription')
|
raise PropertiesOptionError(None, None, None, opt_type='optiondescription')
|
||||||
|
@ -637,7 +637,7 @@ class Config:
|
||||||
update_last_action = True
|
update_last_action = True
|
||||||
elif index == None and action == 'delete':
|
elif index == None and action == 'delete':
|
||||||
for update in reversed(self.updates):
|
for update in reversed(self.updates):
|
||||||
if masterslaves == None and update['name'] == path or \
|
if masterslaves is None and update['name'] == path or \
|
||||||
masterslaves and path.startswith(masterslaves + '.'):
|
masterslaves and path.startswith(masterslaves + '.'):
|
||||||
del self.updates[-1]
|
del self.updates[-1]
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue