test: Make sure test-stk-menu works with python3
This commit is contained in:
		@@ -50,10 +50,11 @@ class StkAgent(dbus.service.Object):
 | 
			
		||||
				in_signature="sya(sy)n", out_signature="y")
 | 
			
		||||
	def RequestSelection(self, title, icon, items, default):
 | 
			
		||||
		print("Title: (%s)" % (title))
 | 
			
		||||
		print("Icon: (%d)" % (icon))
 | 
			
		||||
		print("Icon: (%d)" % (int(icon)))
 | 
			
		||||
		index = 0
 | 
			
		||||
		for item in items:
 | 
			
		||||
			print("%d. %s (icon: %d)" % (index, item[0], item[1]))
 | 
			
		||||
			print("%d. %s (icon: %d)" %
 | 
			
		||||
				(index, item[0], int(item[1])))
 | 
			
		||||
			index += 1
 | 
			
		||||
 | 
			
		||||
		print("\nDefault: %d" % (default))
 | 
			
		||||
@@ -72,7 +73,7 @@ class StkAgent(dbus.service.Object):
 | 
			
		||||
								"error_func"))
 | 
			
		||||
	def DisplayText(self, title, icon, urgent, reply_func, error_func):
 | 
			
		||||
		print("DisplayText (%s)" % (title))
 | 
			
		||||
		print("Icon: (%d)" % (icon))
 | 
			
		||||
		print("Icon: (%d)" % (int(icon)))
 | 
			
		||||
		print("Urgent: (%d)" % (urgent))
 | 
			
		||||
		key = input("Press return to clear ('t' terminates, "
 | 
			
		||||
						"'b' goes back, 'n' busy, "
 | 
			
		||||
@@ -102,7 +103,7 @@ class StkAgent(dbus.service.Object):
 | 
			
		||||
	def RequestInput(self, title, icon, default, min_chars, max_chars,
 | 
			
		||||
				hide_typing):
 | 
			
		||||
		print("Title: (%s)" % (title))
 | 
			
		||||
		print("Icon: (%d)" % (icon))
 | 
			
		||||
		print("Icon: (%d)" % (int(icon)))
 | 
			
		||||
		print("Default: (%s)" % (default))
 | 
			
		||||
		print("Hide typing: (%s)" % (hide_typing))
 | 
			
		||||
		print("Enter characters, min: %d, max: %d:" % (min_chars,
 | 
			
		||||
@@ -116,7 +117,7 @@ class StkAgent(dbus.service.Object):
 | 
			
		||||
	def RequestDigits(self, title, icon, default, min_chars, max_chars,
 | 
			
		||||
				hide_typing):
 | 
			
		||||
		print("Title: (%s)" % (title))
 | 
			
		||||
		print("Icon: (%d)" % (icon))
 | 
			
		||||
		print("Icon: (%d)" % (int(icon)))
 | 
			
		||||
		print("Default: (%s)" % (default))
 | 
			
		||||
		print("Hide typing: (%s)" % (hide_typing))
 | 
			
		||||
		print("Enter digits, min: %d, max: %d:" % (min_chars,
 | 
			
		||||
@@ -134,7 +135,7 @@ class StkAgent(dbus.service.Object):
 | 
			
		||||
				in_signature="sy", out_signature="s")
 | 
			
		||||
	def RequestKey(self, title, icon):
 | 
			
		||||
		print("Title: (%s)" % (title))
 | 
			
		||||
		print("Icon: (%d)" % (icon))
 | 
			
		||||
		print("Icon: (%d)" % (int(icon)))
 | 
			
		||||
		key = input("Enter Key (t, b):")
 | 
			
		||||
 | 
			
		||||
		if key == 'b':
 | 
			
		||||
@@ -148,7 +149,7 @@ class StkAgent(dbus.service.Object):
 | 
			
		||||
				in_signature="sy", out_signature="s")
 | 
			
		||||
	def RequestDigit(self, title, icon):
 | 
			
		||||
		print("Title: (%s)" % (title))
 | 
			
		||||
		print("Icon: (%d)" % (icon))
 | 
			
		||||
		print("Icon: (%d)" % (int(icon)))
 | 
			
		||||
		key = input("Enter Digit (t, b):")
 | 
			
		||||
 | 
			
		||||
		if key == 'b':
 | 
			
		||||
@@ -162,7 +163,7 @@ class StkAgent(dbus.service.Object):
 | 
			
		||||
				in_signature="sy", out_signature="s")
 | 
			
		||||
	def RequestQuickDigit(self, title, icon):
 | 
			
		||||
		print("Title: (%s)" % (title))
 | 
			
		||||
		print("Icon: (%d)" % (icon))
 | 
			
		||||
		print("Icon: (%d)" % (int(icon)))
 | 
			
		||||
		key = input("Quick digit (0-9, *, #, t, b):")
 | 
			
		||||
 | 
			
		||||
		if key == 'b':
 | 
			
		||||
@@ -176,7 +177,7 @@ class StkAgent(dbus.service.Object):
 | 
			
		||||
				in_signature="sy", out_signature="b")
 | 
			
		||||
	def RequestConfirmation(self, title, icon):
 | 
			
		||||
		print("Title: (%s)" % (title))
 | 
			
		||||
		print("Icon: (%d)" % (icon))
 | 
			
		||||
		print("Icon: (%d)" % (int(icon)))
 | 
			
		||||
		key = input("Enter Confirmation (t, b, y, n):")
 | 
			
		||||
 | 
			
		||||
		if key == 'b':
 | 
			
		||||
@@ -192,7 +193,7 @@ class StkAgent(dbus.service.Object):
 | 
			
		||||
				in_signature="sy", out_signature="b")
 | 
			
		||||
	def ConfirmCallSetup(self, info, icon):
 | 
			
		||||
		print("Information: (%s)" % (info))
 | 
			
		||||
		print("Icon: (%d)" % (icon))
 | 
			
		||||
		print("Icon: (%d)" % (int(icon)))
 | 
			
		||||
		key = input("Enter Confirmation (t, y, n):")
 | 
			
		||||
 | 
			
		||||
		if key == 't':
 | 
			
		||||
@@ -206,7 +207,7 @@ class StkAgent(dbus.service.Object):
 | 
			
		||||
				in_signature="sys", out_signature="b")
 | 
			
		||||
	def ConfirmLaunchBrowser(self, info, icon, url):
 | 
			
		||||
		print("Information: (%s)" % (info))
 | 
			
		||||
		print("Icon: (%d)" % (icon))
 | 
			
		||||
		print("Icon: (%d)" % (int(icon)))
 | 
			
		||||
		print("URL (%s)" % (url))
 | 
			
		||||
		key = input("Enter Confirmation (y, n):")
 | 
			
		||||
 | 
			
		||||
@@ -225,7 +226,7 @@ class StkAgent(dbus.service.Object):
 | 
			
		||||
	def PlayTone(self, tone, text, icon):
 | 
			
		||||
		print("PlayTone: %s" % (tone))
 | 
			
		||||
		print("Text: %s" % (text))
 | 
			
		||||
		print("Icon: %d" % (icon))
 | 
			
		||||
		print("Icon: %d" % (int(icon)))
 | 
			
		||||
 | 
			
		||||
		signal.signal(signal.SIGALRM, handler)
 | 
			
		||||
		signal.alarm(5)
 | 
			
		||||
@@ -248,7 +249,7 @@ class StkAgent(dbus.service.Object):
 | 
			
		||||
	def LoopTone(self, tone, text, icon, reply_func, error_func):
 | 
			
		||||
		print("LoopTone: %s" % (tone))
 | 
			
		||||
		print("Text: %s" % (text))
 | 
			
		||||
		print("Icon: %d" % (icon))
 | 
			
		||||
		print("Icon: %d" % (int(icon)))
 | 
			
		||||
		key = input("Press return to end before timeout "
 | 
			
		||||
				"('t' terminates, 'w' return and wait):")
 | 
			
		||||
 | 
			
		||||
@@ -271,13 +272,13 @@ class StkAgent(dbus.service.Object):
 | 
			
		||||
					in_signature="sy", out_signature="")
 | 
			
		||||
	def DisplayActionInformation(self, text, icon):
 | 
			
		||||
		print("Text: %s" % (text))
 | 
			
		||||
		print("Icon: %d" % (icon))
 | 
			
		||||
		print("Icon: %d" % (int(icon)))
 | 
			
		||||
 | 
			
		||||
	@dbus.service.method("org.ofono.SimToolkitAgent",
 | 
			
		||||
					in_signature="sy", out_signature="")
 | 
			
		||||
	def DisplayAction(self, text, icon):
 | 
			
		||||
		print("Text: (%s)" % (text))
 | 
			
		||||
		print("Icon: (%d)" % (icon))
 | 
			
		||||
		print("Icon: (%d)" % (int(icon)))
 | 
			
		||||
		key = input("Press 't' to terminate the session ")
 | 
			
		||||
 | 
			
		||||
		if key == 't':
 | 
			
		||||
@@ -287,7 +288,7 @@ class StkAgent(dbus.service.Object):
 | 
			
		||||
					in_signature="sy", out_signature="b")
 | 
			
		||||
	def ConfirmOpenChannel(self, info, icon):
 | 
			
		||||
		print("Open channel confirmation: (%s)" % (info))
 | 
			
		||||
		print("Icon: (%d)" % (icon))
 | 
			
		||||
		print("Icon: (%d)" % (int(icon)))
 | 
			
		||||
		key = input("Enter Confirmation (t, y, n):")
 | 
			
		||||
 | 
			
		||||
		if key == 't':
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user