long live python decorators
This commit is contained in:
parent
7709c4406a
commit
724bcc827d
|
@ -390,7 +390,7 @@ class ServicesCache:
|
||||||
if self._cbs.has_key(cbkey):
|
if self._cbs.has_key(cbkey):
|
||||||
del self._cbs[cbkey]
|
del self._cbs[cbkey]
|
||||||
|
|
||||||
# object is needed so that property() works
|
# object is needed so that @property works
|
||||||
class ServiceDiscoveryWindow(object):
|
class ServiceDiscoveryWindow(object):
|
||||||
'''Class that represents the Services Discovery window.'''
|
'''Class that represents the Services Discovery window.'''
|
||||||
def __init__(self, account, jid = '', node = '',
|
def __init__(self, account, jid = '', node = '',
|
||||||
|
@ -473,15 +473,16 @@ _('Without a connection, you can not browse available services'))
|
||||||
self.travel(jid, node)
|
self.travel(jid, node)
|
||||||
self.window.show_all()
|
self.window.show_all()
|
||||||
|
|
||||||
|
@property
|
||||||
def _get_account(self):
|
def _get_account(self):
|
||||||
return self._account
|
return self._account
|
||||||
|
|
||||||
|
@property
|
||||||
def _set_account(self, value):
|
def _set_account(self, value):
|
||||||
self._account = value
|
self._account = value
|
||||||
self.cache.account = value
|
self.cache.account = value
|
||||||
if self.browser:
|
if self.browser:
|
||||||
self.browser.account = value
|
self.browser.account = value
|
||||||
account = property(_get_account, _set_account)
|
|
||||||
|
|
||||||
def _initial_state(self):
|
def _initial_state(self):
|
||||||
'''Set some initial state on the window. Separated in a method because
|
'''Set some initial state on the window. Separated in a method because
|
||||||
|
|
Loading…
Reference in New Issue