projects
/
theonering
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0a89616
)
Broken but lots of progress in what needs to be done
author
Ed Page
<eopage@byu.net>
Fri, 5 Feb 2010 03:23:41 +0000
(21:23 -0600)
committer
Ed Page
<eopage@byu.net>
Fri, 5 Feb 2010 03:23:41 +0000
(21:23 -0600)
hand_tests/dbus_signals.py
patch
|
blob
|
history
diff --git
a/hand_tests/dbus_signals.py
b/hand_tests/dbus_signals.py
index
512d19b
..
f6e8be3
100755
(executable)
--- a/
hand_tests/dbus_signals.py
+++ b/
hand_tests/dbus_signals.py
@@
-10,9
+10,15
@@
DBUS_PROPERTIES = 'org.freedesktop.DBus.Properties'
class AutoAcceptAttempt(object):
class AutoAcceptAttempt(object):
+ # @todo Make this more composable by just checking for incoming call. Why
+ # incoming rather than just call? Because it has more demands on what
+ # properties to get which we can then get them in parallel. The callback
+ # would then chose to pickup based on the caller's number, wait to see if
+ # the call is ignored/rejected, etc
- def __init__(self, bus, chan):
+ def __init__(self, bus, conn, chan):
self._sessionBus = bus
self._sessionBus = bus
+ self._conn = conn
self._chan = chan
self._selfHandle = None
self._chan = chan
self._selfHandle = None
@@
-24,14
+30,14
@@
class AutoAcceptAttempt(object):
if False:
# @bug Unsure why this isn't working
if False:
# @bug Unsure why this isn't working
- self._chan[DBUS_PROPERTIES].Get(
+ self._conn[DBUS_PROPERTIES].Get(
telepathy.interfaces.CONNECTION_INTERFACE,
'SelfHandle',
reply_handler = self._on_got_self_handle,
error_handler = self._on_nothing,
)
else:
telepathy.interfaces.CONNECTION_INTERFACE,
'SelfHandle',
reply_handler = self._on_got_self_handle,
error_handler = self._on_nothing,
)
else:
- self._chan[telepathy.interfaces.CHANNEL_INTERFACE_GROUP].GetSelfHandle(
+ self._conn[telepathy.interfaces.CHANNEL_INTERFACE_GROUP].GetSelfHandle(
reply_handler = self._on_got_self_handle,
error_handler = self._on_nothing,
)
reply_handler = self._on_got_self_handle,
error_handler = self._on_nothing,
)
@@
-104,6
+110,9
@@
class AutoAcceptAttempt(object):
class AutoAcceptCall(object):
class AutoAcceptCall(object):
+ # @todo Make this more composable by switchig it to just handle monitoring
+ # for new channels. Other the callback on a new channel will filter for
+ # channel type.
def __init__(self):
self._sessionBus = dbus.SessionBus()
def __init__(self):
self._sessionBus = dbus.SessionBus()
@@
-122,11
+131,13
@@
class AutoAcceptCall(object):
if channelType != telepathy.interfaces.CHANNEL_TYPE_STREAMED_MEDIA:
return
if channelType != telepathy.interfaces.CHANNEL_TYPE_STREAMED_MEDIA:
return
- serviceName = channelObjectPath.rsplit("/", 1)[0][1:].replace("/", ".")
+ connObjectPath = channelObjectPath.rsplit("/", 1)[0][1:]
+ serviceName = connObjectPath.replace("/", ".")
+ conn = telepathy.client.Channel(serviceName, connObjectPath)
chan = telepathy.client.Channel(serviceName, channelObjectPath)
# @bug does not distinguish between preferred CMs
# @todo Need a way to be notified on error, ignored, or if picked up
chan = telepathy.client.Channel(serviceName, channelObjectPath)
# @bug does not distinguish between preferred CMs
# @todo Need a way to be notified on error, ignored, or if picked up
- attemptPickup = AutoAcceptAttempt(self._sessionBus, chan)
+ attemptPickup = AutoAcceptAttempt(self._sessionBus, conn, chan)
self._activeAttempts.append(attemptPickup)
def _on_nothing(*args):
self._activeAttempts.append(attemptPickup)
def _on_nothing(*args):