Merge ~muktupavels/unity:master into unity:master

Proposed by Alberts Muktupāvels
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: 9e9ae41e576915b185a9bcdf65327f8eee60f70e
Merged at revision: c6d44edb7479b146b7428a526127ed45fdf2b3a0
Proposed branch: ~muktupavels/unity:master
Merge into: unity:master
Diff against target: 891 lines (+59/-104)
47 files modified
debian/control (+10/-11)
debian/rules (+2/-2)
tests/autopilot/unity/emulators/X11.py (+1/-2)
tests/autopilot/unity/emulators/compiz.py (+0/-2)
tests/autopilot/unity/emulators/dash.py (+0/-1)
tests/autopilot/unity/emulators/hud.py (+2/-3)
tests/autopilot/unity/emulators/ibus.py (+1/-2)
tests/autopilot/unity/emulators/icons.py (+0/-1)
tests/autopilot/unity/emulators/launcher.py (+2/-3)
tests/autopilot/unity/emulators/panel.py (+2/-3)
tests/autopilot/unity/emulators/quicklist.py (+0/-1)
tests/autopilot/unity/emulators/screen.py (+0/-1)
tests/autopilot/unity/emulators/shortcut_hint.py (+0/-1)
tests/autopilot/unity/emulators/switcher.py (+1/-2)
tests/autopilot/unity/emulators/tooltip.py (+0/-1)
tests/autopilot/unity/emulators/unity.py (+0/-1)
tests/autopilot/unity/emulators/window_manager.py (+0/-1)
tests/autopilot/unity/emulators/workspace.py (+0/-1)
tests/autopilot/unity/tests/__init__.py (+0/-1)
tests/autopilot/unity/tests/launcher/test_capture.py (+0/-1)
tests/autopilot/unity/tests/launcher/test_icon_behavior.py (+0/-1)
tests/autopilot/unity/tests/launcher/test_keynav.py (+0/-1)
tests/autopilot/unity/tests/launcher/test_reveal.py (+0/-1)
tests/autopilot/unity/tests/launcher/test_scroll.py (+0/-1)
tests/autopilot/unity/tests/launcher/test_shortcut.py (+0/-1)
tests/autopilot/unity/tests/launcher/test_switcher.py (+0/-1)
tests/autopilot/unity/tests/launcher/test_visual.py (+0/-1)
tests/autopilot/unity/tests/test_command_lens.py (+0/-1)
tests/autopilot/unity/tests/test_dash.py (+4/-5)
tests/autopilot/unity/tests/test_gnome_key_grabber.py (+1/-1)
tests/autopilot/unity/tests/test_gobject_introspection.py (+0/-1)
tests/autopilot/unity/tests/test_home_lens.py (+0/-1)
tests/autopilot/unity/tests/test_hud.py (+2/-3)
tests/autopilot/unity/tests/test_ibus.py (+12/-13)
tests/autopilot/unity/tests/test_panel.py (+0/-1)
tests/autopilot/unity/tests/test_quicklist.py (+0/-1)
tests/autopilot/unity/tests/test_search.py (+0/-1)
tests/autopilot/unity/tests/test_shopping_lens.py (+3/-4)
tests/autopilot/unity/tests/test_shortcut_hint.py (+0/-1)
tests/autopilot/unity/tests/test_showdesktop.py (+0/-1)
tests/autopilot/unity/tests/test_spread.py (+0/-1)
tests/autopilot/unity/tests/test_switcher.py (+0/-1)
tests/autopilot/unity/tests/test_unity_logging.py (+0/-2)
tests/autopilot/unity/tests/test_wm_keybindings.py (+0/-1)
tests/autopilot/unity/tests/xim/test_gcin.py (+3/-4)
tools/makebootchart.py (+5/-5)
tools/unity-introspection-visualiser.py (+8/-8)
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Dmitry Shachnev Pending
Review via email: mp+359969@code.launchpad.net

Commit message

Port to Python 3.

Description of the change

Port to Python 3.

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/control b/debian/control
index c3dc0cf..a5d3041 100644
--- a/debian/control
+++ b/debian/control
@@ -50,9 +50,8 @@ Build-Depends: cmake,
50 libxtst-dev,50 libxtst-dev,
51 libzeitgeist-2.0-dev,51 libzeitgeist-2.0-dev,
52 pkg-config,52 pkg-config,
53 python (>= 2.7),53 python3-all (>= 3.4),
54 python3 (>= 3.4),54 python3-setuptools,
55 python-setuptools,
56 quilt,55 quilt,
57 systemd,56 systemd,
58 xserver-xorg-video-dummy,57 xserver-xorg-video-dummy,
@@ -194,19 +193,19 @@ Package: unity-autopilot
194Section: python193Section: python
195Architecture: all194Architecture: all
196Depends: ${misc:Depends},195Depends: ${misc:Depends},
197 ${python:Depends},196 ${python3:Depends},
198 autopilot-desktop-legacy,197 autopilot-desktop,
199 python-windowmocker,198 python3-windowmocker,
200 gir1.2-appindicator3-0.1,199 gir1.2-appindicator3-0.1,
201 gir1.2-dee-1.0,200 gir1.2-dee-1.0,
202 gir1.2-glib-2.0,201 gir1.2-glib-2.0,
203 gir1.2-ibus-1.0,202 gir1.2-ibus-1.0,
204 gir1.2-unity-5.0,203 gir1.2-unity-5.0,
205 python-compizconfig,204 python3-compizconfig,
206 python-dbus,205 python3-dbus,
207 python-testtools,206 python3-testtools,
208 python-xdg,207 python3-xdg,
209 python-xlib,208 python3-xlib,
210 libxpathselect1.4v5 (>= 1.4),209 libxpathselect1.4v5 (>= 1.4),
211 mesa-utils,210 mesa-utils,
212Description: Autopiloted tests for Unity211Description: Autopiloted tests for Unity
diff --git a/debian/rules b/debian/rules
index fea379d..4b29c43 100755
--- a/debian/rules
+++ b/debian/rules
@@ -36,7 +36,7 @@ override_dh_auto_configure:
36override_dh_install:36override_dh_install:
37 # install autopilot tests37 # install autopilot tests
38 cd tests/autopilot; \38 cd tests/autopilot; \
39 set -ex; for python in $(shell pyversions -r); do \39 set -ex; for python in $(shell py3versions -r); do \
40 $$python setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb; \40 $$python setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb; \
41 done; \41 done; \
42 cd $(CURDIR)42 cd $(CURDIR)
@@ -59,4 +59,4 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
59endif59endif
6060
61%:61%:
62 dh $@ --with translations,quilt,python2,python3,migrations --parallel62 dh $@ --with translations,quilt,python3,migrations --parallel
diff --git a/tests/autopilot/unity/emulators/X11.py b/tests/autopilot/unity/emulators/X11.py
index 3bbf89d..a49efa7 100644
--- a/tests/autopilot/unity/emulators/X11.py
+++ b/tests/autopilot/unity/emulators/X11.py
@@ -1,4 +1,3 @@
1from __future__ import absolute_import
21
3from autopilot.utilities import Silence2from autopilot.utilities import Silence
4from autopilot.display import Display3from autopilot.display import Display
@@ -90,7 +89,7 @@ def set_primary_monitor(monitor):
90 """89 """
91 try:90 try:
92 glxinfo_out = subprocess.check_output("glxinfo")91 glxinfo_out = subprocess.check_output("glxinfo")
93 except OSError, e:92 except OSError as e:
94 raise OSError("Failed to run glxinfo: %s. (do you have mesa-utils installed?)" % e)93 raise OSError("Failed to run glxinfo: %s. (do you have mesa-utils installed?)" % e)
9594
96 for dri in _blacklisted_drivers:95 for dri in _blacklisted_drivers:
diff --git a/tests/autopilot/unity/emulators/compiz.py b/tests/autopilot/unity/emulators/compiz.py
index abdc98f..4b7c375 100644
--- a/tests/autopilot/unity/emulators/compiz.py
+++ b/tests/autopilot/unity/emulators/compiz.py
@@ -1,8 +1,6 @@
1from __future__ import absolute_import
21
3"""Functions that wrap compizconfig to avoid some unpleasantness in that module."""2"""Functions that wrap compizconfig to avoid some unpleasantness in that module."""
43
5from __future__ import absolute_import
64
7from autopilot.utilities import Silence5from autopilot.utilities import Silence
86
diff --git a/tests/autopilot/unity/emulators/dash.py b/tests/autopilot/unity/emulators/dash.py
index 8511d64..e4fcfe3 100644
--- a/tests/autopilot/unity/emulators/dash.py
+++ b/tests/autopilot/unity/emulators/dash.py
@@ -7,7 +7,6 @@
7# by the Free Software Foundation.7# by the Free Software Foundation.
8#8#
99
10from __future__ import absolute_import
1110
12from autopilot.input import Keyboard, Mouse11from autopilot.input import Keyboard, Mouse
1312
diff --git a/tests/autopilot/unity/emulators/hud.py b/tests/autopilot/unity/emulators/hud.py
index 81e184c..fc24a05 100644
--- a/tests/autopilot/unity/emulators/hud.py
+++ b/tests/autopilot/unity/emulators/hud.py
@@ -7,14 +7,13 @@
7# by the Free Software Foundation.7# by the Free Software Foundation.
8#8#
99
10from __future__ import absolute_import
1110
12from logging import getLogger11from logging import getLogger
1312
14from autopilot.input import Keyboard13from autopilot.input import Keyboard
15from autopilot.introspection.dbus import StateNotFoundError14from autopilot.introspection.dbus import StateNotFoundError
16from autopilot.keybindings import KeybindingsHelper15from autopilot.keybindings import KeybindingsHelper
17from HTMLParser import HTMLParser16from html.parser import HTMLParser
18import re17import re
1918
20from unity.emulators import UnityIntrospectionObject19from unity.emulators import UnityIntrospectionObject
@@ -125,7 +124,7 @@ class HudController(UnityIntrospectionObject, KeybindingsHelper):
125 try:124 try:
126 if len(self.hud_buttons) is 0:125 if len(self.hud_buttons) is 0:
127 return 0126 return 0
128 [button] = filter(lambda x: x.focused, self.hud_buttons)127 [button] = [x for x in self.hud_buttons if x.focused]
129 return button128 return button
130 except IndexError:129 except IndexError:
131 raise RuntimeError("No HUD buttons found, is hud active?")130 raise RuntimeError("No HUD buttons found, is hud active?")
diff --git a/tests/autopilot/unity/emulators/ibus.py b/tests/autopilot/unity/emulators/ibus.py
index b21d99c..9ae4fbe 100644
--- a/tests/autopilot/unity/emulators/ibus.py
+++ b/tests/autopilot/unity/emulators/ibus.py
@@ -20,7 +20,6 @@
2020
21"""Functions to deal with ibus service."""21"""Functions to deal with ibus service."""
2222
23from __future__ import absolute_import
2423
25from gi.repository import IBus, GLib24from gi.repository import IBus, GLib
26import os25import os
@@ -93,7 +92,7 @@ def set_active_engines(engine_list):
93 raise TypeError("engine_list must be a list of valid engine names.")92 raise TypeError("engine_list must be a list of valid engine names.")
94 available_engines = get_available_input_engines()93 available_engines = get_available_input_engines()
95 for engine in engine_list:94 for engine in engine_list:
96 if not isinstance(engine, basestring):95 if not isinstance(engine, str):
97 raise TypeError("Engines in engine_list must all be strings.")96 raise TypeError("Engines in engine_list must all be strings.")
98 if engine not in available_engines:97 if engine not in available_engines:
99 raise ValueError(98 raise ValueError(
diff --git a/tests/autopilot/unity/emulators/icons.py b/tests/autopilot/unity/emulators/icons.py
index 8230194..15ac171 100644
--- a/tests/autopilot/unity/emulators/icons.py
+++ b/tests/autopilot/unity/emulators/icons.py
@@ -7,7 +7,6 @@
7# by the Free Software Foundation.7# by the Free Software Foundation.
8#8#
99
10from __future__ import absolute_import
1110
12from unity.emulators import UnityIntrospectionObject11from unity.emulators import UnityIntrospectionObject
13from unity.emulators.quicklist import Quicklist12from unity.emulators.quicklist import Quicklist
diff --git a/tests/autopilot/unity/emulators/launcher.py b/tests/autopilot/unity/emulators/launcher.py
index f846f3c..b95ec59 100644
--- a/tests/autopilot/unity/emulators/launcher.py
+++ b/tests/autopilot/unity/emulators/launcher.py
@@ -7,7 +7,6 @@
7# by the Free Software Foundation.7# by the Free Software Foundation.
8#8#
99
10from __future__ import absolute_import
1110
12from autopilot.input import Mouse11from autopilot.input import Mouse
13from autopilot.display import Display, move_mouse_to_screen12from autopilot.display import Display, move_mouse_to_screen
@@ -136,7 +135,7 @@ class Launcher(UnityIntrospectionObject, KeybindingsHelper):
136 found = False135 found = False
137136
138 # Only try 10 times (5 secs.) before giving up.137 # Only try 10 times (5 secs.) before giving up.
139 for i in xrange(0, 10):138 for i in range(0, 10):
140 mouse_x = target_x = icon.center.x139 mouse_x = target_x = icon.center.x
141 mouse_y = target_y = icon.center.y140 mouse_y = target_y = icon.center.y
142 if target_y > h + y:141 if target_y > h + y:
@@ -225,7 +224,7 @@ class Launcher(UnityIntrospectionObject, KeybindingsHelper):
225 continue224 continue
226 logger.debug("Selected icon = %s", icon.tooltip_text)225 logger.debug("Selected icon = %s", icon.tooltip_text)
227 matches = True226 matches = True
228 for arg,val in kwargs.iteritems():227 for arg,val in kwargs.items():
229 if not hasattr(icon, arg) or getattr(icon, arg, None) != val:228 if not hasattr(icon, arg) or getattr(icon, arg, None) != val:
230 matches = False229 matches = False
231 break230 break
diff --git a/tests/autopilot/unity/emulators/panel.py b/tests/autopilot/unity/emulators/panel.py
index 78b1085..71502f1 100644
--- a/tests/autopilot/unity/emulators/panel.py
+++ b/tests/autopilot/unity/emulators/panel.py
@@ -7,7 +7,6 @@
7# by the Free Software Foundation.7# by the Free Software Foundation.
8#8#
99
10from __future__ import absolute_import
1110
12import logging11import logging
13from time import sleep12from time import sleep
@@ -132,14 +131,14 @@ class UnityPanel(UnityIntrospectionObject, KeybindingsHelper):
132 def get_active_indicator(self):131 def get_active_indicator(self):
133 """Returns the indicator entry that is currently active"""132 """Returns the indicator entry that is currently active"""
134 entries = self.get_indicator_entries(False, True)133 entries = self.get_indicator_entries(False, True)
135 entries = filter(lambda e: e.active == True, entries)134 entries = [e for e in entries if e.active == True]
136 assert(len(entries) <= 1)135 assert(len(entries) <= 1)
137 return entries[0] if entries else None136 return entries[0] if entries else None
138137
139 def get_indicator_entry(self, entry_id):138 def get_indicator_entry(self, entry_id):
140 """Returns the indicator entry for the given ID or None"""139 """Returns the indicator entry for the given ID or None"""
141 entries = self.get_indicator_entries(False, True)140 entries = self.get_indicator_entries(False, True)
142 entries = filter(lambda e: e.entry_id == entry_id, entries)141 entries = [e for e in entries if e.entry_id == entry_id]
143 assert(len(entries) <= 1)142 assert(len(entries) <= 1)
144 return entries[0] if entries else None143 return entries[0] if entries else None
145144
diff --git a/tests/autopilot/unity/emulators/quicklist.py b/tests/autopilot/unity/emulators/quicklist.py
index 42601bd..bfb7938 100644
--- a/tests/autopilot/unity/emulators/quicklist.py
+++ b/tests/autopilot/unity/emulators/quicklist.py
@@ -7,7 +7,6 @@
7# by the Free Software Foundation.7# by the Free Software Foundation.
8#8#
99
10from __future__ import absolute_import
1110
12import logging11import logging
1312
diff --git a/tests/autopilot/unity/emulators/screen.py b/tests/autopilot/unity/emulators/screen.py
index b9299a2..c570178 100644
--- a/tests/autopilot/unity/emulators/screen.py
+++ b/tests/autopilot/unity/emulators/screen.py
@@ -7,7 +7,6 @@
7# by the Free Software Foundation.7# by the Free Software Foundation.
8#8#
99
10from __future__ import absolute_import
1110
12import logging11import logging
13from unity.emulators import UnityIntrospectionObject12from unity.emulators import UnityIntrospectionObject
diff --git a/tests/autopilot/unity/emulators/shortcut_hint.py b/tests/autopilot/unity/emulators/shortcut_hint.py
index 279b4f1..8448308 100644
--- a/tests/autopilot/unity/emulators/shortcut_hint.py
+++ b/tests/autopilot/unity/emulators/shortcut_hint.py
@@ -7,7 +7,6 @@
7# by the Free Software Foundation.7# by the Free Software Foundation.
8#8#
99
10from __future__ import absolute_import
1110
12import logging11import logging
1312
diff --git a/tests/autopilot/unity/emulators/switcher.py b/tests/autopilot/unity/emulators/switcher.py
index 9bd9a25..4b5df9b 100644
--- a/tests/autopilot/unity/emulators/switcher.py
+++ b/tests/autopilot/unity/emulators/switcher.py
@@ -7,7 +7,6 @@
7# by the Free Software Foundation.7# by the Free Software Foundation.
8#8#
99
10from __future__ import absolute_import
1110
12import logging11import logging
1312
@@ -152,7 +151,7 @@ class SwitcherController(UnityIntrospectionObject, KeybindingsHelper):
152 for i in self.model.icons:151 for i in self.model.icons:
153 current_icon = self.current_icon152 current_icon = self.current_icon
154 passed=True153 passed=True
155 for key,val in kwargs.iteritems():154 for key,val in kwargs.items():
156 if not hasattr(current_icon, key) or getattr(current_icon, key) != val:155 if not hasattr(current_icon, key) or getattr(current_icon, key) != val:
157 passed=False156 passed=False
158 if passed:157 if passed:
diff --git a/tests/autopilot/unity/emulators/tooltip.py b/tests/autopilot/unity/emulators/tooltip.py
index 17c3740..6ab4f39 100644
--- a/tests/autopilot/unity/emulators/tooltip.py
+++ b/tests/autopilot/unity/emulators/tooltip.py
@@ -7,7 +7,6 @@
7# by the Free Software Foundation.7# by the Free Software Foundation.
8#8#
99
10from __future__ import absolute_import
1110
12from unity.emulators import UnityIntrospectionObject11from unity.emulators import UnityIntrospectionObject
1312
diff --git a/tests/autopilot/unity/emulators/unity.py b/tests/autopilot/unity/emulators/unity.py
index 22fdde1..418ffa1 100644
--- a/tests/autopilot/unity/emulators/unity.py
+++ b/tests/autopilot/unity/emulators/unity.py
@@ -7,7 +7,6 @@
7# by the Free Software Foundation.7# by the Free Software Foundation.
8#8#
99
10from __future__ import absolute_import
1110
12from dbus import Interface, SessionBus11from dbus import Interface, SessionBus
1312
diff --git a/tests/autopilot/unity/emulators/window_manager.py b/tests/autopilot/unity/emulators/window_manager.py
index d07fec8..527046b 100644
--- a/tests/autopilot/unity/emulators/window_manager.py
+++ b/tests/autopilot/unity/emulators/window_manager.py
@@ -7,7 +7,6 @@
7# by the Free Software Foundation.7# by the Free Software Foundation.
8#8#
99
10from __future__ import absolute_import
1110
12import logging11import logging
13from autopilot.introspection.types import Rectangle12from autopilot.introspection.types import Rectangle
diff --git a/tests/autopilot/unity/emulators/workspace.py b/tests/autopilot/unity/emulators/workspace.py
index a13972c..ce929cf 100644
--- a/tests/autopilot/unity/emulators/workspace.py
+++ b/tests/autopilot/unity/emulators/workspace.py
@@ -7,7 +7,6 @@
7# by the Free Software Foundation.7# by the Free Software Foundation.
8#8#
99
10from __future__ import absolute_import
1110
12from autopilot.keybindings import KeybindingsHelper11from autopilot.keybindings import KeybindingsHelper
13from autopilot.display import Display12from autopilot.display import Display
diff --git a/tests/autopilot/unity/tests/__init__.py b/tests/autopilot/unity/tests/__init__.py
index da114f9..4c62c09 100644
--- a/tests/autopilot/unity/tests/__init__.py
+++ b/tests/autopilot/unity/tests/__init__.py
@@ -8,7 +8,6 @@
88
9"""Autopilot test case class for Unity-specific tests."""9"""Autopilot test case class for Unity-specific tests."""
1010
11from __future__ import absolute_import
1211
1312
14from codecs import open13from codecs import open
diff --git a/tests/autopilot/unity/tests/launcher/test_capture.py b/tests/autopilot/unity/tests/launcher/test_capture.py
index 24da2a7..28d59c3 100644
--- a/tests/autopilot/unity/tests/launcher/test_capture.py
+++ b/tests/autopilot/unity/tests/launcher/test_capture.py
@@ -7,7 +7,6 @@
7# under the terms of the GNU General Public License version 3, as published7# under the terms of the GNU General Public License version 3, as published
8# by the Free Software Foundation.8# by the Free Software Foundation.
99
10from __future__ import absolute_import
1110
12from autopilot.matchers import Eventually11from autopilot.matchers import Eventually
13import logging12import logging
diff --git a/tests/autopilot/unity/tests/launcher/test_icon_behavior.py b/tests/autopilot/unity/tests/launcher/test_icon_behavior.py
index b51267d..f8876ba 100644
--- a/tests/autopilot/unity/tests/launcher/test_icon_behavior.py
+++ b/tests/autopilot/unity/tests/launcher/test_icon_behavior.py
@@ -7,7 +7,6 @@
7# under the terms of the GNU General Public License version 3, as published7# under the terms of the GNU General Public License version 3, as published
8# by the Free Software Foundation.8# by the Free Software Foundation.
99
10from __future__ import absolute_import
1110
12from autopilot.matchers import Eventually11from autopilot.matchers import Eventually
13from autopilot.testcase import multiply_scenarios12from autopilot.testcase import multiply_scenarios
diff --git a/tests/autopilot/unity/tests/launcher/test_keynav.py b/tests/autopilot/unity/tests/launcher/test_keynav.py
index 85b2bad..57a9ccc 100644
--- a/tests/autopilot/unity/tests/launcher/test_keynav.py
+++ b/tests/autopilot/unity/tests/launcher/test_keynav.py
@@ -7,7 +7,6 @@
7# under the terms of the GNU General Public License version 3, as published7# under the terms of the GNU General Public License version 3, as published
8# by the Free Software Foundation.8# by the Free Software Foundation.
99
10from __future__ import absolute_import
1110
12from autopilot.matchers import Eventually11from autopilot.matchers import Eventually
13import logging12import logging
diff --git a/tests/autopilot/unity/tests/launcher/test_reveal.py b/tests/autopilot/unity/tests/launcher/test_reveal.py
index 7d57f12..2bc6d22 100644
--- a/tests/autopilot/unity/tests/launcher/test_reveal.py
+++ b/tests/autopilot/unity/tests/launcher/test_reveal.py
@@ -7,7 +7,6 @@
7# under the terms of the GNU General Public License version 3, as published7# under the terms of the GNU General Public License version 3, as published
8# by the Free Software Foundation.8# by the Free Software Foundation.
99
10from __future__ import absolute_import
1110
12from autopilot.display import move_mouse_to_screen11from autopilot.display import move_mouse_to_screen
13from autopilot.matchers import Eventually12from autopilot.matchers import Eventually
diff --git a/tests/autopilot/unity/tests/launcher/test_scroll.py b/tests/autopilot/unity/tests/launcher/test_scroll.py
index 5e500c7..8dcac19 100644
--- a/tests/autopilot/unity/tests/launcher/test_scroll.py
+++ b/tests/autopilot/unity/tests/launcher/test_scroll.py
@@ -6,7 +6,6 @@
6# under the terms of the GNU General Public License version 3, as published6# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.7# by the Free Software Foundation.
88
9from __future__ import absolute_import
109
11from autopilot.matchers import Eventually10from autopilot.matchers import Eventually
12import logging11import logging
diff --git a/tests/autopilot/unity/tests/launcher/test_shortcut.py b/tests/autopilot/unity/tests/launcher/test_shortcut.py
index 28d6613..9aafc4f 100644
--- a/tests/autopilot/unity/tests/launcher/test_shortcut.py
+++ b/tests/autopilot/unity/tests/launcher/test_shortcut.py
@@ -7,7 +7,6 @@
7# under the terms of the GNU General Public License version 3, as published7# under the terms of the GNU General Public License version 3, as published
8# by the Free Software Foundation.8# by the Free Software Foundation.
99
10from __future__ import absolute_import
1110
12from autopilot.matchers import Eventually11from autopilot.matchers import Eventually
13import logging12import logging
diff --git a/tests/autopilot/unity/tests/launcher/test_switcher.py b/tests/autopilot/unity/tests/launcher/test_switcher.py
index 657cc23..833c03e 100644
--- a/tests/autopilot/unity/tests/launcher/test_switcher.py
+++ b/tests/autopilot/unity/tests/launcher/test_switcher.py
@@ -7,7 +7,6 @@
7# under the terms of the GNU General Public License version 3, as published7# under the terms of the GNU General Public License version 3, as published
8# by the Free Software Foundation.8# by the Free Software Foundation.
99
10from __future__ import absolute_import
1110
12from autopilot.matchers import Eventually11from autopilot.matchers import Eventually
1312
diff --git a/tests/autopilot/unity/tests/launcher/test_visual.py b/tests/autopilot/unity/tests/launcher/test_visual.py
index c44e923..262a2cb 100644
--- a/tests/autopilot/unity/tests/launcher/test_visual.py
+++ b/tests/autopilot/unity/tests/launcher/test_visual.py
@@ -7,7 +7,6 @@
7# under the terms of the GNU General Public License version 3, as published7# under the terms of the GNU General Public License version 3, as published
8# by the Free Software Foundation.8# by the Free Software Foundation.
99
10from __future__ import absolute_import
1110
12from autopilot.matchers import Eventually11from autopilot.matchers import Eventually
13import logging12import logging
diff --git a/tests/autopilot/unity/tests/test_command_lens.py b/tests/autopilot/unity/tests/test_command_lens.py
index acafc49..4076c01 100644
--- a/tests/autopilot/unity/tests/test_command_lens.py
+++ b/tests/autopilot/unity/tests/test_command_lens.py
@@ -6,7 +6,6 @@
6# under the terms of the GNU General Public License version 3, as published6# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.7# by the Free Software Foundation.
88
9from __future__ import absolute_import
109
11from autopilot.matchers import Eventually10from autopilot.matchers import Eventually
12from testtools.matchers import Equals, NotEquals, GreaterThan, MatchesPredicate11from testtools.matchers import Equals, NotEquals, GreaterThan, MatchesPredicate
diff --git a/tests/autopilot/unity/tests/test_dash.py b/tests/autopilot/unity/tests/test_dash.py
index 8f4943a..c7b2106 100644
--- a/tests/autopilot/unity/tests/test_dash.py
+++ b/tests/autopilot/unity/tests/test_dash.py
@@ -6,7 +6,6 @@
6# under the terms of the GNU General Public License version 3, as published6# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.7# by the Free Software Foundation.
88
9from __future__ import absolute_import
109
11from autopilot.clipboard import get_clipboard_contents10from autopilot.clipboard import get_clipboard_contents
12from autopilot.display import move_mouse_to_screen11from autopilot.display import move_mouse_to_screen
@@ -266,14 +265,14 @@ class DashMultiKeyTests(DashSearchInputTests):
266 self.unity.dash.reveal_application_scope()265 self.unity.dash.reveal_application_scope()
267 self.keyboard.press_and_release('Multi_key')266 self.keyboard.press_and_release('Multi_key')
268 self.keyboard.type("^o")267 self.keyboard.type("^o")
269 self.assertSearchText(u'\xf4')268 self.assertSearchText('\xf4')
270269
271 def test_multi_key_copyright(self):270 def test_multi_key_copyright(self):
272 """Pressing the sequences 'Multi_key' + 'c' + 'o' must produce '©'."""271 """Pressing the sequences 'Multi_key' + 'c' + 'o' must produce '©'."""
273 self.unity.dash.reveal_application_scope()272 self.unity.dash.reveal_application_scope()
274 self.keyboard.press_and_release('Multi_key')273 self.keyboard.press_and_release('Multi_key')
275 self.keyboard.type("oc")274 self.keyboard.type("oc")
276 self.assertSearchText(u'\xa9')275 self.assertSearchText('\xa9')
277276
278 def test_multi_key_delete(self):277 def test_multi_key_delete(self):
279 """Pressing 'Multi_key' must not get stuck looking for a sequence."""278 """Pressing 'Multi_key' must not get stuck looking for a sequence."""
@@ -382,7 +381,7 @@ class DashKeyNavTests(DashTestCase):
382 self.keyboard.release('Control')381 self.keyboard.release('Control')
383382
384 scopebar = self.unity.dash.view.get_scopebar()383 scopebar = self.unity.dash.view.get_scopebar()
385 self.assertEqual(scopebar.active_scope, u'applications.scope')384 self.assertEqual(scopebar.active_scope, 'applications.scope')
386385
387 self.keyboard.press('Control')386 self.keyboard.press('Control')
388 self.keyboard.press('Shift')387 self.keyboard.press('Shift')
@@ -722,7 +721,7 @@ class DashScopeBarTests(DashTestCase):
722 """Scope selection should work when clicking in721 """Scope selection should work when clicking in
723 the rectangle outside of the icon.722 the rectangle outside of the icon.
724 """723 """
725 app_icon = self.scopebar.get_icon_by_name(u'applications.scope')724 app_icon = self.scopebar.get_icon_by_name('applications.scope')
726 self.mouse.click_object(app_icon)725 self.mouse.click_object(app_icon)
727726
728 self.assertThat(self.scopebar.active_scope, Eventually(Equals('applications.scope')))727 self.assertThat(self.scopebar.active_scope, Eventually(Equals('applications.scope')))
diff --git a/tests/autopilot/unity/tests/test_gnome_key_grabber.py b/tests/autopilot/unity/tests/test_gnome_key_grabber.py
index d7c49f6..e0767b1 100644
--- a/tests/autopilot/unity/tests/test_gnome_key_grabber.py
+++ b/tests/autopilot/unity/tests/test_gnome_key_grabber.py
@@ -135,7 +135,7 @@ class GnomeKeyGrabberTests(unity.tests.UnityTestCase):
135 self.check_accelerator(accelerator)135 self.check_accelerator(accelerator)
136136
137 def test_grab_same_accelerator(self):137 def test_grab_same_accelerator(self):
138 accelerators = [Accelerator('<Shift><Control><Alt>b', 'Shift+Control+Alt+b') for i in xrange(3)]138 accelerators = [Accelerator('<Shift><Control><Alt>b', 'Shift+Control+Alt+b') for i in range(3)]
139 actions = self.interface.GrabAccelerators([(accelerator.accelerator, 0) for accelerator in accelerators])139 actions = self.interface.GrabAccelerators([(accelerator.accelerator, 0) for accelerator in accelerators])
140140
141 self.activatable.clear()141 self.activatable.clear()
diff --git a/tests/autopilot/unity/tests/test_gobject_introspection.py b/tests/autopilot/unity/tests/test_gobject_introspection.py
index 58a0c38..d1a7573 100755
--- a/tests/autopilot/unity/tests/test_gobject_introspection.py
+++ b/tests/autopilot/unity/tests/test_gobject_introspection.py
@@ -6,7 +6,6 @@
6# under the terms of the GNU General Public License version 3, as published6# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.7# by the Free Software Foundation.
88
9from __future__ import absolute_import
109
11from testtools import TestCase10from testtools import TestCase
1211
diff --git a/tests/autopilot/unity/tests/test_home_lens.py b/tests/autopilot/unity/tests/test_home_lens.py
index 4094d84..f880666 100644
--- a/tests/autopilot/unity/tests/test_home_lens.py
+++ b/tests/autopilot/unity/tests/test_home_lens.py
@@ -6,7 +6,6 @@
6# under the terms of the GNU General Public License version 3, as published6# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.7# by the Free Software Foundation.
88
9from __future__ import absolute_import
109
11from autopilot.matchers import Eventually10from autopilot.matchers import Eventually
12from testtools.matchers import Equals11from testtools.matchers import Equals
diff --git a/tests/autopilot/unity/tests/test_hud.py b/tests/autopilot/unity/tests/test_hud.py
index 310ceb1..719c7fd 100644
--- a/tests/autopilot/unity/tests/test_hud.py
+++ b/tests/autopilot/unity/tests/test_hud.py
@@ -7,7 +7,6 @@
7# under the terms of the GNU General Public License version 3, as published7# under the terms of the GNU General Public License version 3, as published
8# by the Free Software Foundation.8# by the Free Software Foundation.
99
10from __future__ import absolute_import
1110
12from autopilot.matchers import Eventually11from autopilot.matchers import Eventually
13from autopilot.display import Display, move_mouse_to_screen, is_rect_on_screen12from autopilot.display import Display, move_mouse_to_screen, is_rect_on_screen
@@ -230,7 +229,7 @@ class HudBehaviorTests(HudTestsBase):
230229
231 self.keyboard.type("save")230 self.keyboard.type("save")
232231
233 self.hud_query_check(u'Save\u2002(File)')232 self.hud_query_check('Save\u2002(File)')
234233
235 self.keyboard.press_and_release('Return')234 self.keyboard.press_and_release('Return')
236 self.addCleanup(self.keyboard.press_and_release, "Ctrl+s")235 self.addCleanup(self.keyboard.press_and_release, "Ctrl+s")
@@ -338,7 +337,7 @@ class HudBehaviorTests(HudTestsBase):
338 self.keyboard.type("Quit")337 self.keyboard.type("Quit")
339 self.assertThat(self.unity.hud.search_string, Eventually(Equals("Quit")))338 self.assertThat(self.unity.hud.search_string, Eventually(Equals("Quit")))
340339
341 self.hud_query_check(u'Quit\u2002(File)')340 self.hud_query_check('Quit\u2002(File)')
342341
343 self.keyboard.press_and_release("Enter")342 self.keyboard.press_and_release("Enter")
344343
diff --git a/tests/autopilot/unity/tests/test_ibus.py b/tests/autopilot/unity/tests/test_ibus.py
index 580e5b8..5173dd7 100644
--- a/tests/autopilot/unity/tests/test_ibus.py
+++ b/tests/autopilot/unity/tests/test_ibus.py
@@ -8,7 +8,6 @@
88
9"""Tests to ensure unity is compatible with ibus input method."""9"""Tests to ensure unity is compatible with ibus input method."""
1010
11from __future__ import absolute_import
1211
13from unity.emulators.ibus import (12from unity.emulators.ibus import (
14 get_active_input_engines,13 get_active_input_engines,
@@ -85,7 +84,7 @@ class IBusQuery:
85 timeout.start()84 timeout.start()
86 while self._context.get_engine() is None:85 while self._context.get_engine() is None:
87 if self._abort is True:86 if self._abort is True:
88 print "Error! Could not set the engine correctly."87 print ("Error! Could not set the engine correctly.")
89 return None88 return None
90 continue89 continue
91 timeout.cancel()90 timeout.cancel()
@@ -99,7 +98,7 @@ class IBusQuery:
99 GLib.timeout_add_seconds(5, lambda *args: self._glibloop.quit())98 GLib.timeout_add_seconds(5, lambda *args: self._glibloop.quit())
100 self._glibloop.run()99 self._glibloop.run()
101100
102 return unicode(self.result, "UTF-8")101 return str(self.result, "UTF-8")
103102
104103
105104
@@ -240,10 +239,10 @@ class IBusTestsPinyin(IBusWidgetScenariodTests):
240 scenarios = multiply_scenarios(239 scenarios = multiply_scenarios(
241 IBusWidgetScenariodTests.scenarios,240 IBusWidgetScenariodTests.scenarios,
242 [241 [
243 ('photo', {'input': 'zhaopian ', 'result' : u'\u7167\u7247' }),242 ('photo', {'input': 'zhaopian ', 'result' : '\u7167\u7247' }),
244 ('internet', {'input': 'hulianwang ', 'result' : u'\u4e92\u8054\u7f51'}),243 ('internet', {'input': 'hulianwang ', 'result' : '\u4e92\u8054\u7f51'}),
245 ('hello', {'input': 'ninhao ', 'result' : u'\u60a8\u597d' }),244 ('hello', {'input': 'ninhao ', 'result' : '\u60a8\u597d' }),
246 ('management', {'input': 'guanli ', 'result' : u'\u7ba1\u7406' }),245 ('management', {'input': 'guanli ', 'result' : '\u7ba1\u7406' }),
247 ]246 ]
248 )247 )
249248
@@ -263,9 +262,9 @@ class IBusTestsHangul(IBusWidgetScenariodTests):
263 scenarios = multiply_scenarios(262 scenarios = multiply_scenarios(
264 IBusWidgetScenariodTests.scenarios,263 IBusWidgetScenariodTests.scenarios,
265 [264 [
266 ('transmission', {'input': 'xmfostmaltus ', 'result': u'\ud2b8\ub79c\uc2a4\ubbf8\uc158 '}),265 ('transmission', {'input': 'xmfostmaltus ', 'result': '\ud2b8\ub79c\uc2a4\ubbf8\uc158 '}),
267 ('social', {'input': 'httuf ', 'result': u'\uc18c\uc15c '}),266 ('social', {'input': 'httuf ', 'result': '\uc18c\uc15c '}),
268 ('document', {'input': 'anstj ', 'result': u'\ubb38\uc11c '}),267 ('document', {'input': 'anstj ', 'result': '\ubb38\uc11c '}),
269 ]268 ]
270 )269 )
271270
@@ -285,9 +284,9 @@ class IBusTestsAnthy(IBusWidgetScenariodTests):
285 scenarios = multiply_scenarios(284 scenarios = multiply_scenarios(
286 IBusWidgetScenariodTests.scenarios,285 IBusWidgetScenariodTests.scenarios,
287 [286 [
288 ('system', {'input': 'shisutemu ', 'result' : u'\u30b7\u30b9\u30c6\u30e0' }),287 ('system', {'input': 'shisutemu ', 'result' : '\u30b7\u30b9\u30c6\u30e0' }),
289 ('game', {'input': 'ge-mu ', 'result' : u'\u30b2\u30fc\u30e0' }),288 ('game', {'input': 'ge-mu ', 'result' : '\u30b2\u30fc\u30e0' }),
290 ('user', {'input': 'yu-za- ', 'result' : u'\u30e6\u30fc\u30b6\u30fc' }),289 ('user', {'input': 'yu-za- ', 'result' : '\u30e6\u30fc\u30b6\u30fc' }),
291 ],290 ],
292 [291 [
293 ('commit_enter', {'commit_key': 'Enter'}),292 ('commit_enter', {'commit_key': 'Enter'}),
diff --git a/tests/autopilot/unity/tests/test_panel.py b/tests/autopilot/unity/tests/test_panel.py
index 634fd93..d2119ab 100644
--- a/tests/autopilot/unity/tests/test_panel.py
+++ b/tests/autopilot/unity/tests/test_panel.py
@@ -6,7 +6,6 @@
6# under the terms of the GNU General Public License version 3, as published6# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.7# by the Free Software Foundation.
88
9from __future__ import absolute_import
109
11from autopilot.display import Display10from autopilot.display import Display
12#from autopilot.emulators.bamf import BamfWindow11#from autopilot.emulators.bamf import BamfWindow
diff --git a/tests/autopilot/unity/tests/test_quicklist.py b/tests/autopilot/unity/tests/test_quicklist.py
index a6a1971..32c3566 100644
--- a/tests/autopilot/unity/tests/test_quicklist.py
+++ b/tests/autopilot/unity/tests/test_quicklist.py
@@ -7,7 +7,6 @@
7# under the terms of the GNU General Public License version 3, as published7# under the terms of the GNU General Public License version 3, as published
8# by the Free Software Foundation.8# by the Free Software Foundation.
99
10from __future__ import absolute_import
1110
12from autopilot.display import move_mouse_to_screen11from autopilot.display import move_mouse_to_screen
13from autopilot.matchers import Eventually12from autopilot.matchers import Eventually
diff --git a/tests/autopilot/unity/tests/test_search.py b/tests/autopilot/unity/tests/test_search.py
index 87d038b..d7297b1 100644
--- a/tests/autopilot/unity/tests/test_search.py
+++ b/tests/autopilot/unity/tests/test_search.py
@@ -6,7 +6,6 @@
6# under the terms of the GNU General Public License version 3, as published6# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.7# by the Free Software Foundation.
88
9from __future__ import absolute_import
109
11from autopilot.matchers import Eventually10from autopilot.matchers import Eventually
12from testtools.matchers import (11from testtools.matchers import (
diff --git a/tests/autopilot/unity/tests/test_shopping_lens.py b/tests/autopilot/unity/tests/test_shopping_lens.py
index 94a435d..8f7bcb1 100644
--- a/tests/autopilot/unity/tests/test_shopping_lens.py
+++ b/tests/autopilot/unity/tests/test_shopping_lens.py
@@ -6,12 +6,11 @@
6# under the terms of the GNU General Public License version 3, as published6# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.7# by the Free Software Foundation.
88
9from __future__ import absolute_import
109
11from autopilot.matchers import Eventually10from autopilot.matchers import Eventually
12from testtools.matchers import Equals, GreaterThan11from testtools.matchers import Equals, GreaterThan
13from time import sleep12from time import sleep
14import urllib213import urllib.request, urllib.error, urllib.parse
15import gettext14import gettext
1615
17from unity.tests import UnityTestCase16from unity.tests import UnityTestCase
@@ -23,8 +22,8 @@ class ShoppingScopeTests(UnityTestCase):
23 def setUp(self):22 def setUp(self):
24 super(ShoppingScopeTests, self).setUp()23 super(ShoppingScopeTests, self).setUp()
25 try:24 try:
26 urllib2.urlopen("http://www.google.com", timeout=2)25 urllib.request.urlopen("http://www.google.com", timeout=2)
27 except urllib2.URLError, e:26 except urllib.error.URLError as e:
28 self.skip("Skipping test, no internet connection")27 self.skip("Skipping test, no internet connection")
29 gettext.install("unity-scope-shopping")28 gettext.install("unity-scope-shopping")
3029
diff --git a/tests/autopilot/unity/tests/test_shortcut_hint.py b/tests/autopilot/unity/tests/test_shortcut_hint.py
index 0320516..899c77a 100644
--- a/tests/autopilot/unity/tests/test_shortcut_hint.py
+++ b/tests/autopilot/unity/tests/test_shortcut_hint.py
@@ -6,7 +6,6 @@
6# under the terms of the GNU General Public License version 3, as published6# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.7# by the Free Software Foundation.
88
9from __future__ import absolute_import
109
11from autopilot.matchers import Eventually10from autopilot.matchers import Eventually
12from testtools.matchers import Equals11from testtools.matchers import Equals
diff --git a/tests/autopilot/unity/tests/test_showdesktop.py b/tests/autopilot/unity/tests/test_showdesktop.py
index 546b716..ce00894 100644
--- a/tests/autopilot/unity/tests/test_showdesktop.py
+++ b/tests/autopilot/unity/tests/test_showdesktop.py
@@ -6,7 +6,6 @@
6# under the terms of the GNU General Public License version 3, as published6# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.7# by the Free Software Foundation.
88
9from __future__ import absolute_import
109
11from autopilot.matchers import Eventually10from autopilot.matchers import Eventually
12from testtools.matchers import Equals11from testtools.matchers import Equals
diff --git a/tests/autopilot/unity/tests/test_spread.py b/tests/autopilot/unity/tests/test_spread.py
index 0cc91a1..961ac1e 100644
--- a/tests/autopilot/unity/tests/test_spread.py
+++ b/tests/autopilot/unity/tests/test_spread.py
@@ -6,7 +6,6 @@
6# under the terms of the GNU General Public License version 3, as published6# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.7# by the Free Software Foundation.
88
9from __future__ import absolute_import
109
11from autopilot.display import Display10from autopilot.display import Display
12from autopilot.matchers import Eventually11from autopilot.matchers import Eventually
diff --git a/tests/autopilot/unity/tests/test_switcher.py b/tests/autopilot/unity/tests/test_switcher.py
index d302db1..38d7985 100644
--- a/tests/autopilot/unity/tests/test_switcher.py
+++ b/tests/autopilot/unity/tests/test_switcher.py
@@ -6,7 +6,6 @@
6# under the terms of the GNU General Public License version 3, as published6# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.7# by the Free Software Foundation.
88
9from __future__ import absolute_import
109
11from autopilot.display import move_mouse_to_screen10from autopilot.display import move_mouse_to_screen
12from autopilot.matchers import Eventually11from autopilot.matchers import Eventually
diff --git a/tests/autopilot/unity/tests/test_unity_logging.py b/tests/autopilot/unity/tests/test_unity_logging.py
index 0aa8844..4b106b7 100644
--- a/tests/autopilot/unity/tests/test_unity_logging.py
+++ b/tests/autopilot/unity/tests/test_unity_logging.py
@@ -6,8 +6,6 @@
6# under the terms of the GNU General Public License version 3, as published6# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.7# by the Free Software Foundation.
88
9from __future__ import absolute_import
10
11from os import remove9from os import remove
12from os.path import exists10from os.path import exists
13from tempfile import mktemp11from tempfile import mktemp
diff --git a/tests/autopilot/unity/tests/test_wm_keybindings.py b/tests/autopilot/unity/tests/test_wm_keybindings.py
index fe5418d..89390bb 100644
--- a/tests/autopilot/unity/tests/test_wm_keybindings.py
+++ b/tests/autopilot/unity/tests/test_wm_keybindings.py
@@ -6,7 +6,6 @@
6# under the terms of the GNU General Public License version 3, as published6# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.7# by the Free Software Foundation.
88
9from __future__ import absolute_import
109
11from autopilot.matchers import Eventually10from autopilot.matchers import Eventually
12from testtools.matchers import Equals, NotEquals, GreaterThan11from testtools.matchers import Equals, NotEquals, GreaterThan
diff --git a/tests/autopilot/unity/tests/xim/test_gcin.py b/tests/autopilot/unity/tests/xim/test_gcin.py
index 81420cd..7f0cda1 100644
--- a/tests/autopilot/unity/tests/xim/test_gcin.py
+++ b/tests/autopilot/unity/tests/xim/test_gcin.py
@@ -6,7 +6,6 @@
6# under the terms of the GNU General Public License version 3, as published6# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.7# by the Free Software Foundation.
88
9from __future__ import absolute_import
109
11from autopilot.matchers import Eventually10from autopilot.matchers import Eventually
12from os import environ11from os import environ
@@ -34,9 +33,9 @@ class GcinTestHangul(GcinTestCase):
34 """Tests the Dash and Hud with gcin in hangul mode."""33 """Tests the Dash and Hud with gcin in hangul mode."""
3534
36 scenarios = [35 scenarios = [
37 ('hangul', {'input': 'han geul ', 'result': u'\ud55c\uae00'}),36 ('hangul', {'input': 'han geul ', 'result': '\ud55c\uae00'}),
38 ('morning letters', {'input': 'a chimgeul ', 'result': u'\uc544\uce68\uae00'}),37 ('morning letters', {'input': 'a chimgeul ', 'result': '\uc544\uce68\uae00'}),
39 ('national script', {'input': 'gug mun ', 'result': u'\uad6d\ubb38'}),38 ('national script', {'input': 'gug mun ', 'result': '\uad6d\ubb38'}),
40 ]39 ]
4140
42 def setUp(self):41 def setUp(self):
diff --git a/tools/makebootchart.py b/tools/makebootchart.py
index 8915494..15e941a 100755
--- a/tools/makebootchart.py
+++ b/tools/makebootchart.py
@@ -76,7 +76,7 @@ def draw_bg_graph (ctx, seconds, height):
76 ctx.stroke ()76 ctx.stroke ()
7777
78 per_ten = 078 per_ten = 0
79 for pos in xrange (0, int(total_width), int (0.01 * width_multiplier)):79 for pos in range (0, int(total_width), int (0.01 * width_multiplier)):
80 ctx.set_line_width (1)80 ctx.set_line_width (1)
81 ctx.set_source_rgba (0.0, 0.0, 0.0, 0.10)81 ctx.set_source_rgba (0.0, 0.0, 0.0, 0.10)
8282
@@ -156,7 +156,7 @@ def build_graph (data, filename, info):
156def build_data_structure (input):156def build_data_structure (input):
157 reader = csv.reader(open(input))157 reader = csv.reader(open(input))
158 structure = []158 structure = []
159 print "reading", input159 print("reading", input)
160 for row in reader:160 for row in reader:
161 name = row[0]161 name = row[0]
162 start = float(row[1])162 start = float(row[1])
@@ -168,15 +168,15 @@ def build_data_structure (input):
168168
169169
170def usage():170def usage():
171 print "use --input=filename.log and --output=filename.svg :)"171 print("use --input=filename.log and --output=filename.svg :)")
172172
173def main():173def main():
174174
175 try:175 try:
176 opts, args = getopt.getopt(sys.argv[1:], "h", ["help", "output=", "input="])176 opts, args = getopt.getopt(sys.argv[1:], "h", ["help", "output=", "input="])
177 except getopt.GetoptError, err:177 except getopt.GetoptError as err:
178 # print help information and exit:178 # print help information and exit:
179 print str(err) # will print something like "option -a not recognized"179 print(str(err)) # will print something like "option -a not recognized"
180 usage()180 usage()
181 sys.exit(2)181 sys.exit(2)
182182
diff --git a/tools/unity-introspection-visualiser.py b/tools/unity-introspection-visualiser.py
index c56b241..a30c67e 100755
--- a/tools/unity-introspection-visualiser.py
+++ b/tools/unity-introspection-visualiser.py
@@ -9,16 +9,16 @@ import dbus
99
10try:10try:
11 from autopilot.emulators.unity import get_state_by_path11 from autopilot.emulators.unity import get_state_by_path
12except ImportError, e:12except ImportError as e:
13 print "Error: could not import the autopilot python module."13 print("Error: could not import the autopilot python module.")
14 print "Make sure the autopilot module is in your $PYTHONPATH."14 print("Make sure the autopilot module is in your $PYTHONPATH.")
15 exit(1)15 exit(1)
1616
17try:17try:
18 import pydot18 import pydot
19except ImportError:19except ImportError:
20 print "Error: the 'pydot' module is required to run this script."20 print("Error: the 'pydot' module is required to run this script.")
21 print "Try installing the 'python-pydot' package."21 print("Try installing the 'python3-pydot' package.")
22 exit(1)22 exit(1)
2323
24NEXT_NODE_ID=124NEXT_NODE_ID=1
@@ -53,7 +53,7 @@ def traverse_tree(state, parent, graph):
53 bits = ["%s=%s" % (k, string_rep(state[k])) for k in sorted(state.keys()) if k != 'Children']53 bits = ["%s=%s" % (k, string_rep(state[k])) for k in sorted(state.keys()) if k != 'Children']
54 lbl += "\l".join(bits)54 lbl += "\l".join(bits)
55 parent.set_label(escape('"{' + lbl + '}"'))55 parent.set_label(escape('"{' + lbl + '}"'))
56 if state.has_key('Children'):56 if 'Children' in state:
57 # Add all array nodes as children of this node.57 # Add all array nodes as children of this node.
58 for child_name, child_state in state['Children']:58 for child_name, child_state in state['Children']:
59 if child_name in NODE_BLACKLIST:59 if child_name in NODE_BLACKLIST:
@@ -94,7 +94,7 @@ if __name__ == '__main__':
94 if hasattr(graph, write_method_name):94 if hasattr(graph, write_method_name):
95 getattr(graph, write_method_name)(args.output[0])95 getattr(graph, write_method_name)(args.output[0])
96 else:96 else:
97 print "Error: unsupported format: '%s'" % (extension)97 print("Error: unsupported format: '%s'" % (extension))
98 elif args.display:98 elif args.display:
99 from tempfile import NamedTemporaryFile99 from tempfile import NamedTemporaryFile
100 from subprocess import call100 from subprocess import call
@@ -104,6 +104,6 @@ if __name__ == '__main__':
104 call(["eog", tf.name])104 call(["eog", tf.name])
105 remove(tf.name)105 remove(tf.name)
106 else:106 else:
107 print 'unknown output mode!'107 print('unknown output mode!')
108108
109109

Subscribers

People subscribed via source and target branches