- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathparser.py
More file actions
Latest commit
22 lines (18 loc) · 804 Bytes
/
Copy pathparser.py
File metadata and controls
22 lines (18 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
importmain
fromakadimportttypes
classParser:
def__init__(self, main_instance):
self.main_instance=main_instance
defparse_add_friend(self, string: str, operation: ttypes.Operation):
if"%1"instring:
contact=self.main_instance.cl.getContact(operation.param1)
string=string.replace("%1", contact.displayName)
returnstring
defparse_join_group(self, string: str, operation: ttypes.Operation):
if"%1"instring:
group=self.main_instance.cl.getGroup(operation.param1)
string=string.replace("%1", group.name)
if"%2"instring:
contact=self.main_instance.cl.getContact(operation.param2)
string=string.replace("%2", contact.displayName)
returnstring