home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.5)
-
- import cPickle
- import logging
- log = logging.getLogger('social.network')
- from util import try_this
- from common import AccountBase, profile, UpdateMixin, FromNetMixin, pref
-
- class SocialNetwork(UpdateMixin, AccountBase, FromNetMixin):
- filters = { }
- header_funcs = []
- timer = Null
-
- def __init__(self, enabled = True, **options):
- AccountBase.__init__(self, **options)
- UpdateMixin.__init__(self, **options)
- FromNetMixin.__init__(self, **options)
- self.enabled = enabled
- self._dirty_error = True
-
-
- def dirty(self):
- return self._dirty
-
- dirty = property(dirty)
-
- def display_name(self):
- return (try_this,)((lambda : getattr(self, pref('social.display_attr'))), self.username)
-
- display_name = property(display_name)
-
- def _decryptedpw(self):
- return profile.plain_pw(self.password)
-
-
- def update_info(self, **info):
- self._dirty_error = True
- for k, v in info.iteritems():
- setattr(self, k, v)
-
- self.notify()
- profile.update_account(self)
-
-
- def get_options(self):
- opts = UpdateMixin.get_options(self)
- opts.pop('updatefreq', None)
- return opts
-
-
- def icon(self):
- skin = skin
- import gui
- try_this = try_this
- import util
- return (None, try_this)((lambda : skin.get('serviceicons.%s' % self.protocol)), None)
-
- icon = property(icon)
-
- def error_link(self):
- reason = self.Reasons
- linkref = {
- reason.BAD_PASSWORD: (('Edit Account',), (lambda : profile.account_manager.edit(self))),
- reason.CONN_FAIL: (('Retry',), (lambda : self.Connect())),
- reason.OTHER_USER: (('Reconnect',), (lambda : self.update_now())),
- reason.CONN_LOST: (('Retry',), (lambda : self.update_now())),
- reason.WILL_RECONNECT: (('Retry',), (lambda : self.update_now())),
- reason.NONE: None }
- if self.offline_reason in linkref:
- return linkref[self.offline_reason]
- else:
- log.debug("Couldn't find offline reason %r in linkref dictionary. Returning None for error_link", self.offline_reason)
- return None
-
-
- def service(self):
- raise NotImplementedError
-
- service = property(service)
-
- def protocol(self):
- raise NotImplementedError
-
- protocol = property(protocol)
-
- def Connect(self, *a, **k):
- raise NotImplementedError
-
-
- def Disconnect(self, *a, **k):
- raise NotImplementedError
-
-
- def disconnect(self, *a, **k):
- raise NotImplementedError
-
-
- def observe_count(self, callback):
- return NotImplemented
-
-
- def observe_state(self, callback):
- return NotImplemented
-
-
- def unobserve_count(self, callback):
- return NotImplemented
-
-
- def unobserve_state(self, callback):
- return NotImplemented
-
-
-