home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2012 January / maximum-cd-2012-01.iso / DiscContents / digsby_setup.exe / lib / msn / conversationmanager.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2011-10-05  |  2.4 KB  |  69 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.6)
  3.  
  4. import util.primitives.funcs as funcs
  5. from logging import getLogger
  6. log = getLogger('msn.conversationmanager')
  7.  
  8. class ConversationManager(object):
  9.     
  10.     def __init__(self, msn):
  11.         self.msn = msn
  12.         self._convs = { }
  13.  
  14.     
  15.     def find_convo(self, name = (), count = (), type = (), f = None):
  16.         result = []
  17.         if f is None:
  18.             
  19.             f = lambda x: True
  20.         
  21.         if not funcs.isiterable(name):
  22.             name = (name,)
  23.         
  24.         if not funcs.isiterable(type):
  25.             type = (type,)
  26.         
  27.         if not funcs.isiterable(count):
  28.             count = (count,)
  29.         
  30.         functions = [
  31.             f]
  32.         
  33.         def namechecker(c):
  34.             mynames = set(name)
  35.             cnames = set(c.buddies)
  36.             mynames.discard(self.self_buddy.name)
  37.             cnames.discard(self.self_buddy.name)
  38.             return mynames == cnames
  39.  
  40.         if name:
  41.             functions.append(namechecker)
  42.         
  43.         
  44.         def typechecker(c):
  45.             return c.type in type
  46.  
  47.         if type:
  48.             functions.append(typechecker)
  49.         
  50.         
  51.         def countchecker(c):
  52.             return len(c.room_list) in count
  53.  
  54.         if count:
  55.             functions.append(countchecker)
  56.         
  57.         import inspect
  58.         log.debug('find_convo: name=%s,count=%s,type=%s,f=%s', name, count, type, inspect.getsource(f).strip())
  59.         for None in self._convs.values():
  60.             conv = None
  61.             if (all,)((lambda .0: for _f in .0:
  62. _f(conv))(functions)):
  63.                 result.append(conv)
  64.                 continue
  65.         
  66.         return result
  67.  
  68.  
  69.