Switching over to coroutine trampolines
[theonering] / src / location.py
1 import logging
2
3 import telepathy
4
5 import util.misc as misc_utils
6
7
8 _moduleLogger = logging.getLogger(__name__)
9
10
11 #class LocationMixin(tp.ConnectionInterfaceLocation):
12 class LocationMixin(object):
13
14         def __init__(self):
15                 #tp.ConnectionInterfaceLocation.__init__(self)
16                 pass
17
18         @property
19         def session(self):
20                 """
21                 @abstract
22                 """
23                 raise NotImplementedError("Abstract property called")
24
25         @misc_utils.log_exception(_moduleLogger)
26         def GetLocations(self, contacts):
27                 """
28                 @returns {Contact: {Location Type: Location}}
29                 """
30                 raise telepathy.errors.NotImplemented("Yet")
31
32         @misc_utils.log_exception(_moduleLogger)
33         def RequestLocation(self, contact):
34                 """
35                 @returns {Location Type: Location}
36                 """
37                 raise telepathy.errors.NotImplemented("Yet")
38
39         @misc_utils.log_exception(_moduleLogger)
40         def SetLocation(self, location):
41                 """
42                 Since presence is based off of phone numbers, not allowing the client to change it
43                 """
44                 raise telepathy.errors.PermissionDenied()