i did not test this code below as-is, but it looks to me like you need to add the prefix from earlier to each key of the hash so that manage_changeProperties will work correctly.
for x in pnums:
if x+1 in hash.keys():
hash[x]=hash[x+1]
else: #we've gotten to the last element and we can remove it
hash[x]='' #not needed
#we change the newly allocated properties
self.manage_changeProperties(hash)
i rewrote it and added these lines:
for x in pnums:
if x + 1 in hash.keys():
hash[x] = hash[x + 1]
else:
hash[x] = ''
hashish = {}
for key in hash.keys():
hashish[prefix + str(key)] = hash[key]
self.manage_changeProperties(hashish)
probably there is a better way, but..... :)
|