home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.5)
-
- from common.statusmessage import StatusMessage
- from common import profile, pref
- import platform
- import wx
- from gui import skin
- from logging import getLogger
- log = getLogger('promote_status')
- PROMOTE_STATUS_PREF = 'plugins.promotestatus.initial_status'
- PROMOTE_STATUS_STRING = u'I use Digsby to manage IM + Email + Social Networks - http://im.digsby.com'
-
- class PromoteStatus(StatusMessage):
- __slots__ = StatusMessage.__slots__[:]
- __slots__.remove('message')
- edit_toggle = False
-
- def __init__(self, message = None, status = None, editable = None, **kws):
- None(StatusMessage.__init__, self = 'title', Promote Digsby! = 'status' if status is None else status, message = None, editable = False)
-
- message = property((lambda self: PROMOTE_STATUS_STRING), (lambda self, val: pass))
-
- def icon(self):
- return skin.get('statusicons.promote', None)
-
- icon = property(icon)
-
-
- def status_factory():
- start_status = pref(PROMOTE_STATUS_PREF, 'available')
- if start_status == 'idle':
- start_status = 'available'
-
- return PromoteStatus(status = start_status)
-
-
- def on_before_status_change(status):
- log.info('on_status_change')
- if isinstance(status, PromoteStatus):
- s = status.status
- if pref(PROMOTE_STATUS_PREF, type = str, default = 'available') != s:
- profile.prefs.__setitem__(PROMOTE_STATUS_PREF, s.lower())
-
-
- return status
-
-
- def initialize():
- Hook = Hook
- import peak.util.plugins
- Hook('digsby.im.statusmessages', 'promote').register(status_factory)
- Hook('digsby.im.statusmessages.set.pre', 'promote').register(on_before_status_change)
-
-