File tree 1 file changed +20
-13
lines changed
1 file changed +20
-13
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,24 @@ def all():
28
28
"""
29
29
return _clist (getAddressBook ().people ())
30
30
31
+ def groups ():
32
+ """
33
+ Return groups
34
+ """
35
+ return _clist (getAddressBook ().groups ())
36
+
37
+ def me ():
38
+ """
39
+ Returns the current logged in user.
40
+ """
41
+ return _clist ([getAddressBook ().me ()])[0 ]
42
+
43
+ def getByUID (uid ):
44
+ """
45
+ Returns a person or group by uid.
46
+ """
47
+ return _clist ([getAddressBook ().recordForUniqueId_ (uid )])[0 ]
48
+
31
49
def _clist (slist ):
32
50
"""
33
51
Method to convert NSArray to python list
@@ -48,18 +66,6 @@ def _clist(slist):
48
66
retList .append (aobj )
49
67
return retList
50
68
51
- def groups ():
52
- """
53
- Return groups
54
- """
55
- return _clist (getAddressBook ().groups ())
56
-
57
- def me ():
58
- """
59
- Returns the current logged in user.
60
- """
61
- return _clist ([getAddressBook ().me ()])[0 ]
62
-
63
69
def _getVal (tmpval ):
64
70
"""
65
71
Extract value from unicode or Date object.
@@ -76,7 +82,8 @@ def _getVal(tmpval):
76
82
def main ():
77
83
#print all()
78
84
#print groups()
79
- print me ()
85
+ #print me()
86
+ #print getByUID('B50984C8-FEAC-4D6A-8B77-E271DB729A8E:ABPerson')
80
87
81
88
if __name__ == '__main__' :
82
89
main ()
You can’t perform that action at this time.
0 commit comments