Files
openide/python/testData/refactoring/extractmethod/WrongSelectionIfPart.before.py
2012-05-22 22:23:35 +04:00

14 lines
648 B
Python

class Settings(patterns.Observer, UnicodeAwareConfigParser):
def __init__(self):
pass
def set(self, section, option, value, new=False):
<selection>if new:
currentValue = 'a new option, so use something as current value'\
' that is unlikely to be equal to the new value'</selection>
else:
currentValue = self.get(section, option)
if value != currentValue:
patterns.Event('before.%s.%s'%(section, option), self, value).send()
super(Settings, self).set(section, option, value)
patterns.Event('%s.%s'%(section, option), self, value).send()