mirror of git://git.sysmocom.de/ofono
test: Handle DisplayText with async_callbacks option
This commit is contained in:
parent
b728a02981
commit
e3cb6a5c68
|
@ -54,13 +54,21 @@ class StkAgent(dbus.service.Object):
|
||||||
return int(select);
|
return int(select);
|
||||||
|
|
||||||
@dbus.service.method("org.ofono.SimToolkitAgent",
|
@dbus.service.method("org.ofono.SimToolkitAgent",
|
||||||
in_signature="syb", out_signature="")
|
in_signature="syb", out_signature="",
|
||||||
def DisplayText(self, title, icon, urgent):
|
async_callbacks=("reply_func",
|
||||||
|
"error_func"))
|
||||||
|
def DisplayText(self, title, icon, urgent, reply_func, error_func):
|
||||||
print "DisplayText (%s)" % (title)
|
print "DisplayText (%s)" % (title)
|
||||||
print "Icon: (%d)" % (icon)
|
print "Icon: (%d)" % (icon)
|
||||||
print "Urgent: (%d)" % (urgent)
|
print "Urgent: (%d)" % (urgent)
|
||||||
key = raw_input("Press return to clear ('t' terminates, "
|
key = raw_input("Press return to clear ('t' terminates, "
|
||||||
"'b' goes back, 'n' busy):")
|
"'b' goes back, 'n' busy, "
|
||||||
|
"'w' return and wait):")
|
||||||
|
|
||||||
|
if key == 'w':
|
||||||
|
seconds = 60
|
||||||
|
else:
|
||||||
|
seconds = 0
|
||||||
|
|
||||||
if key == 'b':
|
if key == 'b':
|
||||||
raise GoBack("User wishes to go back")
|
raise GoBack("User wishes to go back")
|
||||||
|
@ -69,6 +77,11 @@ class StkAgent(dbus.service.Object):
|
||||||
elif key == 'n':
|
elif key == 'n':
|
||||||
raise Busy("User wishes to simulate busy screen")
|
raise Busy("User wishes to simulate busy screen")
|
||||||
|
|
||||||
|
if (seconds > 0):
|
||||||
|
print "Waiting for %d seconds" % (seconds)
|
||||||
|
|
||||||
|
gobject.timeout_add_seconds(seconds, lambda: reply_func())
|
||||||
|
|
||||||
@dbus.service.method("org.ofono.SimToolkitAgent",
|
@dbus.service.method("org.ofono.SimToolkitAgent",
|
||||||
in_signature="sysyyb", out_signature="s")
|
in_signature="sysyyb", out_signature="s")
|
||||||
def RequestInput(self, title, icon, default, min_chars, max_chars,
|
def RequestInput(self, title, icon, default, min_chars, max_chars,
|
||||||
|
|
Loading…
Reference in New Issue