summaryrefslogtreecommitdiff
path: root/test/twisted/mctest.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/twisted/mctest.py')
-rw-r--r--test/twisted/mctest.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/twisted/mctest.py b/test/twisted/mctest.py
index b5bc48a1..4cf45956 100644
--- a/test/twisted/mctest.py
+++ b/test/twisted/mctest.py
@@ -971,3 +971,26 @@ def connect_to_mc(q, bus, mc):
assert cs.AM_IFACE_NOKIA_QUERY in interfaces, interfaces
return account_manager, properties, interfaces
+
+def keyfile_read(fname):
+ groups = { None: {} }
+ group = None
+ for line in open(fname):
+ line = line[:-1].decode('utf-8').strip()
+ if not line or line.startswith('#'):
+ continue
+
+ if line.startswith('[') and line.endswith(']'):
+ group = line[1:-1]
+ groups[group] = {}
+ continue
+
+ if '=' in line:
+ k, v = line.split('=', 1)
+ else:
+ k = line
+ v = None
+
+ groups[group][k] = v
+ return groups
+