~jconti/gm-notify/messaging-menu

« back to all changes in this revision

Viewing changes to gm_notify_keyring.py

  • Committer: Jason Conti
  • Date: 2012-10-26 18:50:05 UTC
  • Revision ID: jason.conti@gmail.com-20121026185005-w7ymy40er9yue0ue
Fix indentation in gm_notify_keyring.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
from gi.repository import GnomeKeyring, Gtk
6
6
 
7
7
def attributes(d):
8
 
  '''Converts a dictionary to a GnomeKeyring.Attribute array'''
9
 
  attrs = GnomeKeyring.Attribute.list_new()
10
 
  for key in d:
11
 
    GnomeKeyring.Attribute.list_append_string(attrs, key, str(d[key]))
12
 
  return attrs
 
8
    '''Converts a dictionary to a GnomeKeyring.Attribute array'''
 
9
    attrs = GnomeKeyring.Attribute.list_new()
 
10
    for key in d:
 
11
        GnomeKeyring.Attribute.list_append_string(attrs, key, str(d[key]))
 
12
    return attrs
13
13
 
14
14
def dict_from_attributes(attrs):
15
 
  '''Converts item results back into a dictionary'''
16
 
  result = {}
17
 
  for attr in GnomeKeyring.Attribute.list_to_glist(attrs):
18
 
    result[attr.name] = attr.get_string()
19
 
  return result
 
15
    '''Converts item results back into a dictionary'''
 
16
    result = {}
 
17
    for attr in GnomeKeyring.Attribute.list_to_glist(attrs):
 
18
        result[attr.name] = attr.get_string()
 
19
    return result
20
20
 
21
21
class KeyringException(Exception):
22
22
  pass