pop in master resize slave values
This commit is contained in:
@ -651,6 +651,9 @@ class MasterSlaves(OptionDescription):
|
||||
|
||||
def pop(self, opt, values, index):
|
||||
for slave in self.getslaves(opt):
|
||||
slave_path = slave.impl_getpath(values._getcontext())
|
||||
slavelen = values._p_.get_max_length(slave_path, None)
|
||||
# just for raise if needed
|
||||
if not values.is_default_owner(slave, validate_properties=False,
|
||||
validate_meta=False, index=index):
|
||||
multi = values._get_cached_value(slave, validate=False,
|
||||
@ -658,7 +661,12 @@ class MasterSlaves(OptionDescription):
|
||||
)
|
||||
if isinstance(multi, Exception):
|
||||
raise multi
|
||||
multi.pop(index, force=True)
|
||||
if slavelen > index:
|
||||
values._p_.resetvalue_index(slave_path, index)
|
||||
if slavelen > index + 1:
|
||||
for idx in xrange(index + 1, slavelen):
|
||||
values._p_.reduce_index(slave_path, idx)
|
||||
|
||||
|
||||
def getitem(self, values, opt, path, validate, force_permissive,
|
||||
trusted_cached_properties, validate_properties,
|
||||
|
Reference in New Issue
Block a user