home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 October / maximum-cd-2011-10.iso / DiscContents / digsby_setup.exe / lib / plugins / facebook / action_links.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2011-06-22  |  3.3 KB  |  86 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.6)
  3.  
  4. import util.net as util
  5. from util.primitives.structures import oset
  6. from util.primitives.mapping import odict
  7. import branding
  8. UrlQuery = util.net.UrlQuery
  9. __all__ = []
  10.  
  11. def BASE():
  12.     return UrlQuery('http://www.digsby.com/')
  13.  
  14.  
  15. def NEWSFEED_CAMPAIGN():
  16.     campaign = branding.get('digsby.facebook.newsfeed.campaign', 'digsby_facebook', 'fbnewsfeed')
  17.     return UrlQuery(BASE(), utm_medium = 'fb', utm_campaign = campaign)
  18.  
  19.  
  20. def MERGED_URL():
  21.     return UrlQuery(NEWSFEED_CAMPAIGN(), utm_source = 'merged')
  22.  
  23.  
  24. def ACCT_BASE(protocol):
  25.     return UrlQuery(NEWSFEED_CAMPAIGN(), utm_source = str(protocol))
  26.  
  27.  
  28. def COUNT_BASE(type_):
  29.     return UrlQuery(NEWSFEED_CAMPAIGN(), utm_source = type_)
  30.  
  31.  
  32. def clicksrc(base, source):
  33.     return UrlQuery(base, utm_term = source)
  34.  
  35. protocol_ordering = oset([
  36.     'fbchat',
  37.     'facebook'])
  38.  
  39. def get_acct_name(protocol):
  40.     protocolmeta = protocolmeta
  41.     import common
  42.     return protocolmeta.nice_name_for_proto(protocol)
  43.  
  44.  
  45. def get_accts_text(type_ = ''):
  46.     profile = profile
  47.     protocolmeta = protocolmeta
  48.     import common
  49.     protos = oset((lambda .0: for a in .0:
  50. a.protocol)(getattr(profile.account_manager, type_ + 'accounts')))
  51.     protos = protocol_ordering & protos | protos
  52.     return (', '.join,)((lambda .0: for name in .0:
  53. protocolmeta.nice_name_for_proto(name))(protos))
  54.  
  55.  
  56. def get_acct_properties(href):
  57.     s_text = get_accts_text('social')
  58.     im_text = get_accts_text('')
  59.     e_text = get_accts_text('email')
  60.     props = odict()
  61.     if s_text:
  62.         props['Social Networks'] = {
  63.             'text': s_text,
  64.             'href': clicksrc(href, 'SOCIAL') }
  65.     
  66.     if im_text:
  67.         props['IM Accounts'] = {
  68.             'text': im_text,
  69.             'href': clicksrc(href, 'IM') }
  70.     
  71.     if e_text:
  72.         props['Email Accounts'] = {
  73.             'text': e_text,
  74.             'href': clicksrc(href, 'EMAIL') }
  75.     
  76.     return props
  77.  
  78.  
  79. def his_her_their(s):
  80.     if s == 'female':
  81.         return 'her'
  82.     if s == 'male':
  83.         return 'his'
  84.     return 'their'
  85.  
  86.