home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.5)
-
- __metaclass__ = type
- from util.observe import Observable
- from util import Storage
- S = Storage
- from path import path
- import random
- from gui import skin
- from tests.mock.mockprofiles import MockProfiles
- protos = [
- 'yahoo',
- 'aim',
- 'msn',
- 'jabber']
- status_messages = '\nworking on Digsby\nout for lunch\nhomework\n'.strip().split('\n')
- from common import caps
- statuses = 'away available idle'.split()
-
- class MockBuddy(Observable):
- _renderer = 'Contact'
- icon_path = path('file:///C:/windows/Blue Lace 16.bmp')
-
- def __init__(self, name, status = None, protocol = 'aim', capxx0rs = None):
- Observable.__init__(self)
- self.remote_alias = self.name = name
- self.mockprofile = getattr(MockProfiles, name, '')
- self.buddy = Storage()
- self.buddy.nice_name = name
- self.buddy.profile = self.mockprofile
- self.icon = skin.get('BuddiesPanel.BuddyIcons.NoIcon')
- self.icon_path = self.icon.path
- self.icon = self.icon.PIL
- self.id = 5
- self.status_message = random.choice(status_messages)
- self.sightly_status = self.status_orb = self.status = None if status else random.choice(statuses)
- self.buddy.away = self.status == 'away'
- if not S(name = protocol, get_buddy = (lambda name: MockBuddy(name)), self_buddy = S(name = 'digsby01'), group_for = (lambda s: 'group')):
- pass
- self.protocol = S(name = random.choice(protos))
- self.protocol.icq = random.choice([
- True,
- False])
- self.protocol.username = self.protocol.name
- self.mockcaps = None if capxx0rs else [
- caps.BLOCKABLE,
- caps.EMAIL,
- caps.FILES,
- caps.IM,
- caps.PICTURES,
- caps.SMS]
- self.online_time = None
- self.buddy.protocol = self.protocol
- self.caps = self.mockcaps
-
-
- def service(self):
- return self.protocol.name
-
- service = property(service)
-
- def serviceicon(self):
- skin = skin
- import gui
- return skin.get('serviceicons.%s' % self.service)
-
- serviceicon = property(serviceicon)
-
- def alias(self):
- return self.name
-
- alias = property(alias)
-
- def idle(self):
- return self.status == 'idle'
-
- idle = property(idle)
-
- def info_key(self):
- return self.service + '_' + self.name
-
- info_key = property(info_key)
-
- def stripped_msg(self):
- strip_html2 = strip_html2
- import util
- return strip_html2(self.status_message)
-
- stripped_msg = property(stripped_msg)
-
- def GetMockProfile(self):
- return self.htmlprofile
-
-
- def idstr(self):
- return u'/'.join([
- self.protocol.name,
- self.protocol.username,
- self.name])
-
-
- def online(self):
- return True
-
- online = property(online)
-
- def num_online(self):
- return int(self.online)
-
- num_online = property(num_online)
-
- def chat(self):
- print 'wut?'
-
-
- from contacts.Contact import Contact
- MockBuddy.__bases__ += (Contact,)
-