~robru/gwibber/twitter-from-me-fix

« back to all changes in this revision

Viewing changes to gwibber/gwibber/service/dispatcher.py

  • Committer: Barry Warsaw
  • Date: 2012-09-21 18:46:21 UTC
  • mfrom: (1437.1.2 robru)
  • Revision ID: barry@python.org-20120921184621-o6xncvo0mvrt9nxj
Merge, with minor changes, lp:~robru/gwibber/accounts-fixup, which principly
cleans up the interface with libaccounts, and changes blanket attribute access
via dictionary lookup to specific direct. attribute accesses.

Also:
  * Make Account.enabled a property.
  * Add more explanation about why the gi.repository.Account API sucks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
142
142
        if not self.online:
143
143
            return
144
144
        for account in self.account_manager.get_all():
145
 
            if account['send_enabled']:
 
145
            if account.send_enabled:
146
146
                account.protocol('send', message)
147
147
 
148
148
    @dbus.service.method('com.Gwibber.Service', out_signature='s')
156
156
            service = dbus.Interface(obj, 'com.Gwibber.Service')
157
157
            features = json.loads(service.GetFeatures('facebook'))
158
158
        """
159
 
        # Note: in the case of .get returning None,
160
 
        # features is set to a harmless empty list.
 
159
        # Note: in the case of .get() returning None, features is set to a
 
160
        # harmless empty list.
161
161
        protocol = protocol_manager.protocols.get(protocol_name)
162
162
        features = [operation for operation in dir(protocol)
163
 
                    if operation != 'info' and not operation.startswith('_')
164
 
                    ]
 
163
                    if not operation.startswith('_')]
165
164
        return json.dumps(features)
166
165
 
167
166
    @dbus.service.method('com.Gwibber.Service',