diff options
author | Olivier Tilloy <olivier.tilloy@canonical.com> | 2012-10-30 12:59:37 +0100 |
---|---|---|
committer | Olivier Tilloy <olivier.tilloy@canonical.com> | 2012-10-30 12:59:37 +0100 |
commit | 209c95ea443041146229336379e66e659d72edae (patch) | |
tree | d0cd5dcb9e526090434917266000aad5122b80f3 | |
parent | 4d47b26a31dc1c337b47ded055e5f6613972fc97 (diff) | |
download | qmenumodel-209c95ea443041146229336379e66e659d72edae.tar.gz qmenumodel-209c95ea443041146229336379e66e659d72edae.tar.bz2 qmenumodel-209c95ea443041146229336379e66e659d72edae.zip |
Migrate all scripts to python3.
-rw-r--r-- | .bzrignore | 1 | ||||
-rwxr-xr-x | examples/exportactiongroup.py | 8 | ||||
-rwxr-xr-x | examples/exportmenu.py | 2 | ||||
-rwxr-xr-x | tests/client/script_actiongrouptest.py | 2 | ||||
-rwxr-xr-x | tests/client/script_menuchangestest.py | 2 | ||||
-rwxr-xr-x | tests/client/script_modeltest.py | 6 | ||||
-rwxr-xr-x | tests/client/script_qmltest.py | 2 | ||||
-rwxr-xr-x | tests/client/script_servicetest.py | 2 | ||||
-rw-r--r-- | tests/script/menuscript.py | 2 |
9 files changed, 14 insertions, 13 deletions
@@ -22,6 +22,7 @@ tests/client/modeltest tests/client/qmlfiles.h tests/client/qmltest tests/client/servicetest +tests/script/__pycache__/ doc/html/ doc/qmenumodel.qdocconf diff --git a/examples/exportactiongroup.py b/examples/exportactiongroup.py index f69416e..0f2d675 100755 --- a/examples/exportactiongroup.py +++ b/examples/exportactiongroup.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- encoding: utf-8 -*- """ @@ -20,10 +20,10 @@ BUS_OBJECT_PATH = '/com/canonical/testactiongroup' def action_activated(action, data): name = action.get_name() if action.get_state_type() is None: - print 'stateless action activated: %s' % name + print('stateless action activated: %s' % name) else: - print 'stateful action activated: %s (current state: %s)' % - (name, action.get_state()) + print('stateful action activated: %s (current state: %s)' % + (name, action.get_state())) if __name__ == '__main__': diff --git a/examples/exportmenu.py b/examples/exportmenu.py index 831f995..70cc6f3 100755 --- a/examples/exportmenu.py +++ b/examples/exportmenu.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- encoding: utf-8 -*- """ diff --git a/tests/client/script_actiongrouptest.py b/tests/client/script_actiongrouptest.py index 43409da..2af4841 100755 --- a/tests/client/script_actiongrouptest.py +++ b/tests/client/script_actiongrouptest.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2.7 +#!/usr/bin/env python3 import time from gi.repository import GLib diff --git a/tests/client/script_menuchangestest.py b/tests/client/script_menuchangestest.py index 67f2ee0..47e37bb 100755 --- a/tests/client/script_menuchangestest.py +++ b/tests/client/script_menuchangestest.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2.7 +#!/usr/bin/env python3 import time from menuscript import Script, ActionList, MENU_OBJECT_PATH diff --git a/tests/client/script_modeltest.py b/tests/client/script_modeltest.py index 95df442..84a0d9c 100755 --- a/tests/client/script_modeltest.py +++ b/tests/client/script_modeltest.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2.7 +#!/usr/bin/env python3 import time from gi.repository import GLib @@ -8,7 +8,7 @@ al = ActionList(MENU_OBJECT_PATH) # create map pmap = {'int64' : GLib.Variant('x', -42), - 'string': GLib.Variant('s', u'42'), + 'string': GLib.Variant('s', '42'), 'double': GLib.Variant('d', 42.42)} al.appendItem("Menu0", "Menu0Act", None, None, {'x-boolean' : GLib.Variant('b', True), @@ -20,7 +20,7 @@ al.appendItem("Menu0", "Menu0Act", None, None, {'x-boolean' : GLib.Variant('b', 'x-int64' : GLib.Variant('x', -42), 'x-uint64' : GLib.Variant('t', 42), 'x-double' : GLib.Variant('d', 42.42), - 'x-string' : GLib.Variant('s', u'42'), + 'x-string' : GLib.Variant('s', '42'), 'x-map' : GLib.Variant('a{sv}', pmap), }) al.appendItem("Menu1", "Menu1Act") diff --git a/tests/client/script_qmltest.py b/tests/client/script_qmltest.py index 385256c..c93e221 100755 --- a/tests/client/script_qmltest.py +++ b/tests/client/script_qmltest.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2.7 +#!/usr/bin/env python3 import time from menuscript import Script, ActionList, MENU_OBJECT_PATH diff --git a/tests/client/script_servicetest.py b/tests/client/script_servicetest.py index 385256c..c93e221 100755 --- a/tests/client/script_servicetest.py +++ b/tests/client/script_servicetest.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2.7 +#!/usr/bin/env python3 import time from menuscript import Script, ActionList, MENU_OBJECT_PATH diff --git a/tests/script/menuscript.py b/tests/script/menuscript.py index ba67560..60cb33b 100644 --- a/tests/script/menuscript.py +++ b/tests/script/menuscript.py @@ -114,7 +114,7 @@ class Action(object): # Remove action self._list._rootAction.remove(self._kargs['actionName']) else: - print "Remove menu item" + print("Remove menu item") def run(self): if self._action == 'append': |