home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.6)
-
- import util.net as util
- from util.primitives.structures import oset
- from util.primitives.mapping import odict
- import branding
- UrlQuery = util.net.UrlQuery
- __all__ = []
-
- def BASE():
- return UrlQuery('http://www.digsby.com/')
-
-
- def NEWSFEED_CAMPAIGN():
- campaign = branding.get('digsby.facebook.newsfeed.campaign', 'digsby_facebook', 'fbnewsfeed')
- return UrlQuery(BASE(), utm_medium = 'fb', utm_campaign = campaign)
-
-
- def MERGED_URL():
- return UrlQuery(NEWSFEED_CAMPAIGN(), utm_source = 'merged')
-
-
- def ACCT_BASE(protocol):
- return UrlQuery(NEWSFEED_CAMPAIGN(), utm_source = str(protocol))
-
-
- def COUNT_BASE(type_):
- return UrlQuery(NEWSFEED_CAMPAIGN(), utm_source = type_)
-
-
- def clicksrc(base, source):
- return UrlQuery(base, utm_term = source)
-
- protocol_ordering = oset([
- 'fbchat',
- 'facebook'])
-
- def get_acct_name(protocol):
- protocolmeta = protocolmeta
- import common
- return protocolmeta.nice_name_for_proto(protocol)
-
-
- def get_accts_text(type_ = ''):
- profile = profile
- protocolmeta = protocolmeta
- import common
- protos = oset((lambda .0: for a in .0:
- a.protocol)(getattr(profile.account_manager, type_ + 'accounts')))
- protos = protocol_ordering & protos | protos
- return (', '.join,)((lambda .0: for name in .0:
- protocolmeta.nice_name_for_proto(name))(protos))
-
-
- def get_acct_properties(href):
- s_text = get_accts_text('social')
- im_text = get_accts_text('')
- e_text = get_accts_text('email')
- props = odict()
- if s_text:
- props['Social Networks'] = {
- 'text': s_text,
- 'href': clicksrc(href, 'SOCIAL') }
-
- if im_text:
- props['IM Accounts'] = {
- 'text': im_text,
- 'href': clicksrc(href, 'IM') }
-
- if e_text:
- props['Email Accounts'] = {
- 'text': e_text,
- 'href': clicksrc(href, 'EMAIL') }
-
- return props
-
-
- def his_her_their(s):
- if s == 'female':
- return 'her'
- if s == 'male':
- return 'his'
- return 'their'
-
-