Merge ~muktupavels/unity:master into unity:master
- Git
- lp:~muktupavels/unity
- master
- Merge into 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) |
Related bugs: |
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.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/debian/control b/debian/control | |||
2 | index c3dc0cf..a5d3041 100644 | |||
3 | --- a/debian/control | |||
4 | +++ b/debian/control | |||
5 | @@ -50,9 +50,8 @@ Build-Depends: cmake, | |||
6 | 50 | libxtst-dev, | 50 | libxtst-dev, |
7 | 51 | libzeitgeist-2.0-dev, | 51 | libzeitgeist-2.0-dev, |
8 | 52 | pkg-config, | 52 | pkg-config, |
12 | 53 | python (>= 2.7), | 53 | python3-all (>= 3.4), |
13 | 54 | python3 (>= 3.4), | 54 | python3-setuptools, |
11 | 55 | python-setuptools, | ||
14 | 56 | quilt, | 55 | quilt, |
15 | 57 | systemd, | 56 | systemd, |
16 | 58 | xserver-xorg-video-dummy, | 57 | xserver-xorg-video-dummy, |
17 | @@ -194,19 +193,19 @@ Package: unity-autopilot | |||
18 | 194 | Section: python | 193 | Section: python |
19 | 195 | Architecture: all | 194 | Architecture: all |
20 | 196 | Depends: ${misc:Depends}, | 195 | Depends: ${misc:Depends}, |
24 | 197 | ${python:Depends}, | 196 | ${python3:Depends}, |
25 | 198 | autopilot-desktop-legacy, | 197 | autopilot-desktop, |
26 | 199 | python-windowmocker, | 198 | python3-windowmocker, |
27 | 200 | gir1.2-appindicator3-0.1, | 199 | gir1.2-appindicator3-0.1, |
28 | 201 | gir1.2-dee-1.0, | 200 | gir1.2-dee-1.0, |
29 | 202 | gir1.2-glib-2.0, | 201 | gir1.2-glib-2.0, |
30 | 203 | gir1.2-ibus-1.0, | 202 | gir1.2-ibus-1.0, |
31 | 204 | gir1.2-unity-5.0, | 203 | gir1.2-unity-5.0, |
37 | 205 | python-compizconfig, | 204 | python3-compizconfig, |
38 | 206 | python-dbus, | 205 | python3-dbus, |
39 | 207 | python-testtools, | 206 | python3-testtools, |
40 | 208 | python-xdg, | 207 | python3-xdg, |
41 | 209 | python-xlib, | 208 | python3-xlib, |
42 | 210 | libxpathselect1.4v5 (>= 1.4), | 209 | libxpathselect1.4v5 (>= 1.4), |
43 | 211 | mesa-utils, | 210 | mesa-utils, |
44 | 212 | Description: Autopiloted tests for Unity | 211 | Description: Autopiloted tests for Unity |
45 | diff --git a/debian/rules b/debian/rules | |||
46 | index fea379d..4b29c43 100755 | |||
47 | --- a/debian/rules | |||
48 | +++ b/debian/rules | |||
49 | @@ -36,7 +36,7 @@ override_dh_auto_configure: | |||
50 | 36 | override_dh_install: | 36 | override_dh_install: |
51 | 37 | # install autopilot tests | 37 | # install autopilot tests |
52 | 38 | cd tests/autopilot; \ | 38 | cd tests/autopilot; \ |
54 | 39 | set -ex; for python in $(shell pyversions -r); do \ | 39 | set -ex; for python in $(shell py3versions -r); do \ |
55 | 40 | $$python setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb; \ | 40 | $$python setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb; \ |
56 | 41 | done; \ | 41 | done; \ |
57 | 42 | cd $(CURDIR) | 42 | cd $(CURDIR) |
58 | @@ -59,4 +59,4 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) | |||
59 | 59 | endif | 59 | endif |
60 | 60 | 60 | ||
61 | 61 | %: | 61 | %: |
63 | 62 | dh $@ --with translations,quilt,python2,python3,migrations --parallel | 62 | dh $@ --with translations,quilt,python3,migrations --parallel |
64 | diff --git a/tests/autopilot/unity/emulators/X11.py b/tests/autopilot/unity/emulators/X11.py | |||
65 | index 3bbf89d..a49efa7 100644 | |||
66 | --- a/tests/autopilot/unity/emulators/X11.py | |||
67 | +++ b/tests/autopilot/unity/emulators/X11.py | |||
68 | @@ -1,4 +1,3 @@ | |||
69 | 1 | from __future__ import absolute_import | ||
70 | 2 | 1 | ||
71 | 3 | from autopilot.utilities import Silence | 2 | from autopilot.utilities import Silence |
72 | 4 | from autopilot.display import Display | 3 | from autopilot.display import Display |
73 | @@ -90,7 +89,7 @@ def set_primary_monitor(monitor): | |||
74 | 90 | """ | 89 | """ |
75 | 91 | try: | 90 | try: |
76 | 92 | glxinfo_out = subprocess.check_output("glxinfo") | 91 | glxinfo_out = subprocess.check_output("glxinfo") |
78 | 93 | except OSError, e: | 92 | except OSError as e: |
79 | 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) |
80 | 95 | 94 | ||
81 | 96 | for dri in _blacklisted_drivers: | 95 | for dri in _blacklisted_drivers: |
82 | diff --git a/tests/autopilot/unity/emulators/compiz.py b/tests/autopilot/unity/emulators/compiz.py | |||
83 | index abdc98f..4b7c375 100644 | |||
84 | --- a/tests/autopilot/unity/emulators/compiz.py | |||
85 | +++ b/tests/autopilot/unity/emulators/compiz.py | |||
86 | @@ -1,8 +1,6 @@ | |||
87 | 1 | from __future__ import absolute_import | ||
88 | 2 | 1 | ||
89 | 3 | """Functions that wrap compizconfig to avoid some unpleasantness in that module.""" | 2 | """Functions that wrap compizconfig to avoid some unpleasantness in that module.""" |
90 | 4 | 3 | ||
91 | 5 | from __future__ import absolute_import | ||
92 | 6 | 4 | ||
93 | 7 | from autopilot.utilities import Silence | 5 | from autopilot.utilities import Silence |
94 | 8 | 6 | ||
95 | diff --git a/tests/autopilot/unity/emulators/dash.py b/tests/autopilot/unity/emulators/dash.py | |||
96 | index 8511d64..e4fcfe3 100644 | |||
97 | --- a/tests/autopilot/unity/emulators/dash.py | |||
98 | +++ b/tests/autopilot/unity/emulators/dash.py | |||
99 | @@ -7,7 +7,6 @@ | |||
100 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
101 | 8 | # | 8 | # |
102 | 9 | 9 | ||
103 | 10 | from __future__ import absolute_import | ||
104 | 11 | 10 | ||
105 | 12 | from autopilot.input import Keyboard, Mouse | 11 | from autopilot.input import Keyboard, Mouse |
106 | 13 | 12 | ||
107 | diff --git a/tests/autopilot/unity/emulators/hud.py b/tests/autopilot/unity/emulators/hud.py | |||
108 | index 81e184c..fc24a05 100644 | |||
109 | --- a/tests/autopilot/unity/emulators/hud.py | |||
110 | +++ b/tests/autopilot/unity/emulators/hud.py | |||
111 | @@ -7,14 +7,13 @@ | |||
112 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
113 | 8 | # | 8 | # |
114 | 9 | 9 | ||
115 | 10 | from __future__ import absolute_import | ||
116 | 11 | 10 | ||
117 | 12 | from logging import getLogger | 11 | from logging import getLogger |
118 | 13 | 12 | ||
119 | 14 | from autopilot.input import Keyboard | 13 | from autopilot.input import Keyboard |
120 | 15 | from autopilot.introspection.dbus import StateNotFoundError | 14 | from autopilot.introspection.dbus import StateNotFoundError |
121 | 16 | from autopilot.keybindings import KeybindingsHelper | 15 | from autopilot.keybindings import KeybindingsHelper |
123 | 17 | from HTMLParser import HTMLParser | 16 | from html.parser import HTMLParser |
124 | 18 | import re | 17 | import re |
125 | 19 | 18 | ||
126 | 20 | from unity.emulators import UnityIntrospectionObject | 19 | from unity.emulators import UnityIntrospectionObject |
127 | @@ -125,7 +124,7 @@ class HudController(UnityIntrospectionObject, KeybindingsHelper): | |||
128 | 125 | try: | 124 | try: |
129 | 126 | if len(self.hud_buttons) is 0: | 125 | if len(self.hud_buttons) is 0: |
130 | 127 | return 0 | 126 | return 0 |
132 | 128 | [button] = filter(lambda x: x.focused, self.hud_buttons) | 127 | [button] = [x for x in self.hud_buttons if x.focused] |
133 | 129 | return button | 128 | return button |
134 | 130 | except IndexError: | 129 | except IndexError: |
135 | 131 | raise RuntimeError("No HUD buttons found, is hud active?") | 130 | raise RuntimeError("No HUD buttons found, is hud active?") |
136 | diff --git a/tests/autopilot/unity/emulators/ibus.py b/tests/autopilot/unity/emulators/ibus.py | |||
137 | index b21d99c..9ae4fbe 100644 | |||
138 | --- a/tests/autopilot/unity/emulators/ibus.py | |||
139 | +++ b/tests/autopilot/unity/emulators/ibus.py | |||
140 | @@ -20,7 +20,6 @@ | |||
141 | 20 | 20 | ||
142 | 21 | """Functions to deal with ibus service.""" | 21 | """Functions to deal with ibus service.""" |
143 | 22 | 22 | ||
144 | 23 | from __future__ import absolute_import | ||
145 | 24 | 23 | ||
146 | 25 | from gi.repository import IBus, GLib | 24 | from gi.repository import IBus, GLib |
147 | 26 | import os | 25 | import os |
148 | @@ -93,7 +92,7 @@ def set_active_engines(engine_list): | |||
149 | 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.") |
150 | 94 | available_engines = get_available_input_engines() | 93 | available_engines = get_available_input_engines() |
151 | 95 | for engine in engine_list: | 94 | for engine in engine_list: |
153 | 96 | if not isinstance(engine, basestring): | 95 | if not isinstance(engine, str): |
154 | 97 | raise TypeError("Engines in engine_list must all be strings.") | 96 | raise TypeError("Engines in engine_list must all be strings.") |
155 | 98 | if engine not in available_engines: | 97 | if engine not in available_engines: |
156 | 99 | raise ValueError( | 98 | raise ValueError( |
157 | diff --git a/tests/autopilot/unity/emulators/icons.py b/tests/autopilot/unity/emulators/icons.py | |||
158 | index 8230194..15ac171 100644 | |||
159 | --- a/tests/autopilot/unity/emulators/icons.py | |||
160 | +++ b/tests/autopilot/unity/emulators/icons.py | |||
161 | @@ -7,7 +7,6 @@ | |||
162 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
163 | 8 | # | 8 | # |
164 | 9 | 9 | ||
165 | 10 | from __future__ import absolute_import | ||
166 | 11 | 10 | ||
167 | 12 | from unity.emulators import UnityIntrospectionObject | 11 | from unity.emulators import UnityIntrospectionObject |
168 | 13 | from unity.emulators.quicklist import Quicklist | 12 | from unity.emulators.quicklist import Quicklist |
169 | diff --git a/tests/autopilot/unity/emulators/launcher.py b/tests/autopilot/unity/emulators/launcher.py | |||
170 | index f846f3c..b95ec59 100644 | |||
171 | --- a/tests/autopilot/unity/emulators/launcher.py | |||
172 | +++ b/tests/autopilot/unity/emulators/launcher.py | |||
173 | @@ -7,7 +7,6 @@ | |||
174 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
175 | 8 | # | 8 | # |
176 | 9 | 9 | ||
177 | 10 | from __future__ import absolute_import | ||
178 | 11 | 10 | ||
179 | 12 | from autopilot.input import Mouse | 11 | from autopilot.input import Mouse |
180 | 13 | from autopilot.display import Display, move_mouse_to_screen | 12 | from autopilot.display import Display, move_mouse_to_screen |
181 | @@ -136,7 +135,7 @@ class Launcher(UnityIntrospectionObject, KeybindingsHelper): | |||
182 | 136 | found = False | 135 | found = False |
183 | 137 | 136 | ||
184 | 138 | # Only try 10 times (5 secs.) before giving up. | 137 | # Only try 10 times (5 secs.) before giving up. |
186 | 139 | for i in xrange(0, 10): | 138 | for i in range(0, 10): |
187 | 140 | mouse_x = target_x = icon.center.x | 139 | mouse_x = target_x = icon.center.x |
188 | 141 | mouse_y = target_y = icon.center.y | 140 | mouse_y = target_y = icon.center.y |
189 | 142 | if target_y > h + y: | 141 | if target_y > h + y: |
190 | @@ -225,7 +224,7 @@ class Launcher(UnityIntrospectionObject, KeybindingsHelper): | |||
191 | 225 | continue | 224 | continue |
192 | 226 | logger.debug("Selected icon = %s", icon.tooltip_text) | 225 | logger.debug("Selected icon = %s", icon.tooltip_text) |
193 | 227 | matches = True | 226 | matches = True |
195 | 228 | for arg,val in kwargs.iteritems(): | 227 | for arg,val in kwargs.items(): |
196 | 229 | if not hasattr(icon, arg) or getattr(icon, arg, None) != val: | 228 | if not hasattr(icon, arg) or getattr(icon, arg, None) != val: |
197 | 230 | matches = False | 229 | matches = False |
198 | 231 | break | 230 | break |
199 | diff --git a/tests/autopilot/unity/emulators/panel.py b/tests/autopilot/unity/emulators/panel.py | |||
200 | index 78b1085..71502f1 100644 | |||
201 | --- a/tests/autopilot/unity/emulators/panel.py | |||
202 | +++ b/tests/autopilot/unity/emulators/panel.py | |||
203 | @@ -7,7 +7,6 @@ | |||
204 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
205 | 8 | # | 8 | # |
206 | 9 | 9 | ||
207 | 10 | from __future__ import absolute_import | ||
208 | 11 | 10 | ||
209 | 12 | import logging | 11 | import logging |
210 | 13 | from time import sleep | 12 | from time import sleep |
211 | @@ -132,14 +131,14 @@ class UnityPanel(UnityIntrospectionObject, KeybindingsHelper): | |||
212 | 132 | def get_active_indicator(self): | 131 | def get_active_indicator(self): |
213 | 133 | """Returns the indicator entry that is currently active""" | 132 | """Returns the indicator entry that is currently active""" |
214 | 134 | entries = self.get_indicator_entries(False, True) | 133 | entries = self.get_indicator_entries(False, True) |
216 | 135 | entries = filter(lambda e: e.active == True, entries) | 134 | entries = [e for e in entries if e.active == True] |
217 | 136 | assert(len(entries) <= 1) | 135 | assert(len(entries) <= 1) |
218 | 137 | return entries[0] if entries else None | 136 | return entries[0] if entries else None |
219 | 138 | 137 | ||
220 | 139 | def get_indicator_entry(self, entry_id): | 138 | def get_indicator_entry(self, entry_id): |
221 | 140 | """Returns the indicator entry for the given ID or None""" | 139 | """Returns the indicator entry for the given ID or None""" |
222 | 141 | entries = self.get_indicator_entries(False, True) | 140 | entries = self.get_indicator_entries(False, True) |
224 | 142 | entries = filter(lambda e: e.entry_id == entry_id, entries) | 141 | entries = [e for e in entries if e.entry_id == entry_id] |
225 | 143 | assert(len(entries) <= 1) | 142 | assert(len(entries) <= 1) |
226 | 144 | return entries[0] if entries else None | 143 | return entries[0] if entries else None |
227 | 145 | 144 | ||
228 | diff --git a/tests/autopilot/unity/emulators/quicklist.py b/tests/autopilot/unity/emulators/quicklist.py | |||
229 | index 42601bd..bfb7938 100644 | |||
230 | --- a/tests/autopilot/unity/emulators/quicklist.py | |||
231 | +++ b/tests/autopilot/unity/emulators/quicklist.py | |||
232 | @@ -7,7 +7,6 @@ | |||
233 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
234 | 8 | # | 8 | # |
235 | 9 | 9 | ||
236 | 10 | from __future__ import absolute_import | ||
237 | 11 | 10 | ||
238 | 12 | import logging | 11 | import logging |
239 | 13 | 12 | ||
240 | diff --git a/tests/autopilot/unity/emulators/screen.py b/tests/autopilot/unity/emulators/screen.py | |||
241 | index b9299a2..c570178 100644 | |||
242 | --- a/tests/autopilot/unity/emulators/screen.py | |||
243 | +++ b/tests/autopilot/unity/emulators/screen.py | |||
244 | @@ -7,7 +7,6 @@ | |||
245 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
246 | 8 | # | 8 | # |
247 | 9 | 9 | ||
248 | 10 | from __future__ import absolute_import | ||
249 | 11 | 10 | ||
250 | 12 | import logging | 11 | import logging |
251 | 13 | from unity.emulators import UnityIntrospectionObject | 12 | from unity.emulators import UnityIntrospectionObject |
252 | diff --git a/tests/autopilot/unity/emulators/shortcut_hint.py b/tests/autopilot/unity/emulators/shortcut_hint.py | |||
253 | index 279b4f1..8448308 100644 | |||
254 | --- a/tests/autopilot/unity/emulators/shortcut_hint.py | |||
255 | +++ b/tests/autopilot/unity/emulators/shortcut_hint.py | |||
256 | @@ -7,7 +7,6 @@ | |||
257 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
258 | 8 | # | 8 | # |
259 | 9 | 9 | ||
260 | 10 | from __future__ import absolute_import | ||
261 | 11 | 10 | ||
262 | 12 | import logging | 11 | import logging |
263 | 13 | 12 | ||
264 | diff --git a/tests/autopilot/unity/emulators/switcher.py b/tests/autopilot/unity/emulators/switcher.py | |||
265 | index 9bd9a25..4b5df9b 100644 | |||
266 | --- a/tests/autopilot/unity/emulators/switcher.py | |||
267 | +++ b/tests/autopilot/unity/emulators/switcher.py | |||
268 | @@ -7,7 +7,6 @@ | |||
269 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
270 | 8 | # | 8 | # |
271 | 9 | 9 | ||
272 | 10 | from __future__ import absolute_import | ||
273 | 11 | 10 | ||
274 | 12 | import logging | 11 | import logging |
275 | 13 | 12 | ||
276 | @@ -152,7 +151,7 @@ class SwitcherController(UnityIntrospectionObject, KeybindingsHelper): | |||
277 | 152 | for i in self.model.icons: | 151 | for i in self.model.icons: |
278 | 153 | current_icon = self.current_icon | 152 | current_icon = self.current_icon |
279 | 154 | passed=True | 153 | passed=True |
281 | 155 | for key,val in kwargs.iteritems(): | 154 | for key,val in kwargs.items(): |
282 | 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: |
283 | 157 | passed=False | 156 | passed=False |
284 | 158 | if passed: | 157 | if passed: |
285 | diff --git a/tests/autopilot/unity/emulators/tooltip.py b/tests/autopilot/unity/emulators/tooltip.py | |||
286 | index 17c3740..6ab4f39 100644 | |||
287 | --- a/tests/autopilot/unity/emulators/tooltip.py | |||
288 | +++ b/tests/autopilot/unity/emulators/tooltip.py | |||
289 | @@ -7,7 +7,6 @@ | |||
290 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
291 | 8 | # | 8 | # |
292 | 9 | 9 | ||
293 | 10 | from __future__ import absolute_import | ||
294 | 11 | 10 | ||
295 | 12 | from unity.emulators import UnityIntrospectionObject | 11 | from unity.emulators import UnityIntrospectionObject |
296 | 13 | 12 | ||
297 | diff --git a/tests/autopilot/unity/emulators/unity.py b/tests/autopilot/unity/emulators/unity.py | |||
298 | index 22fdde1..418ffa1 100644 | |||
299 | --- a/tests/autopilot/unity/emulators/unity.py | |||
300 | +++ b/tests/autopilot/unity/emulators/unity.py | |||
301 | @@ -7,7 +7,6 @@ | |||
302 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
303 | 8 | # | 8 | # |
304 | 9 | 9 | ||
305 | 10 | from __future__ import absolute_import | ||
306 | 11 | 10 | ||
307 | 12 | from dbus import Interface, SessionBus | 11 | from dbus import Interface, SessionBus |
308 | 13 | 12 | ||
309 | diff --git a/tests/autopilot/unity/emulators/window_manager.py b/tests/autopilot/unity/emulators/window_manager.py | |||
310 | index d07fec8..527046b 100644 | |||
311 | --- a/tests/autopilot/unity/emulators/window_manager.py | |||
312 | +++ b/tests/autopilot/unity/emulators/window_manager.py | |||
313 | @@ -7,7 +7,6 @@ | |||
314 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
315 | 8 | # | 8 | # |
316 | 9 | 9 | ||
317 | 10 | from __future__ import absolute_import | ||
318 | 11 | 10 | ||
319 | 12 | import logging | 11 | import logging |
320 | 13 | from autopilot.introspection.types import Rectangle | 12 | from autopilot.introspection.types import Rectangle |
321 | diff --git a/tests/autopilot/unity/emulators/workspace.py b/tests/autopilot/unity/emulators/workspace.py | |||
322 | index a13972c..ce929cf 100644 | |||
323 | --- a/tests/autopilot/unity/emulators/workspace.py | |||
324 | +++ b/tests/autopilot/unity/emulators/workspace.py | |||
325 | @@ -7,7 +7,6 @@ | |||
326 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
327 | 8 | # | 8 | # |
328 | 9 | 9 | ||
329 | 10 | from __future__ import absolute_import | ||
330 | 11 | 10 | ||
331 | 12 | from autopilot.keybindings import KeybindingsHelper | 11 | from autopilot.keybindings import KeybindingsHelper |
332 | 13 | from autopilot.display import Display | 12 | from autopilot.display import Display |
333 | diff --git a/tests/autopilot/unity/tests/__init__.py b/tests/autopilot/unity/tests/__init__.py | |||
334 | index da114f9..4c62c09 100644 | |||
335 | --- a/tests/autopilot/unity/tests/__init__.py | |||
336 | +++ b/tests/autopilot/unity/tests/__init__.py | |||
337 | @@ -8,7 +8,6 @@ | |||
338 | 8 | 8 | ||
339 | 9 | """Autopilot test case class for Unity-specific tests.""" | 9 | """Autopilot test case class for Unity-specific tests.""" |
340 | 10 | 10 | ||
341 | 11 | from __future__ import absolute_import | ||
342 | 12 | 11 | ||
343 | 13 | 12 | ||
344 | 14 | from codecs import open | 13 | from codecs import open |
345 | diff --git a/tests/autopilot/unity/tests/launcher/test_capture.py b/tests/autopilot/unity/tests/launcher/test_capture.py | |||
346 | index 24da2a7..28d59c3 100644 | |||
347 | --- a/tests/autopilot/unity/tests/launcher/test_capture.py | |||
348 | +++ b/tests/autopilot/unity/tests/launcher/test_capture.py | |||
349 | @@ -7,7 +7,6 @@ | |||
350 | 7 | # under the terms of the GNU General Public License version 3, as published | 7 | # under the terms of the GNU General Public License version 3, as published |
351 | 8 | # by the Free Software Foundation. | 8 | # by the Free Software Foundation. |
352 | 9 | 9 | ||
353 | 10 | from __future__ import absolute_import | ||
354 | 11 | 10 | ||
355 | 12 | from autopilot.matchers import Eventually | 11 | from autopilot.matchers import Eventually |
356 | 13 | import logging | 12 | import logging |
357 | diff --git a/tests/autopilot/unity/tests/launcher/test_icon_behavior.py b/tests/autopilot/unity/tests/launcher/test_icon_behavior.py | |||
358 | index b51267d..f8876ba 100644 | |||
359 | --- a/tests/autopilot/unity/tests/launcher/test_icon_behavior.py | |||
360 | +++ b/tests/autopilot/unity/tests/launcher/test_icon_behavior.py | |||
361 | @@ -7,7 +7,6 @@ | |||
362 | 7 | # under the terms of the GNU General Public License version 3, as published | 7 | # under the terms of the GNU General Public License version 3, as published |
363 | 8 | # by the Free Software Foundation. | 8 | # by the Free Software Foundation. |
364 | 9 | 9 | ||
365 | 10 | from __future__ import absolute_import | ||
366 | 11 | 10 | ||
367 | 12 | from autopilot.matchers import Eventually | 11 | from autopilot.matchers import Eventually |
368 | 13 | from autopilot.testcase import multiply_scenarios | 12 | from autopilot.testcase import multiply_scenarios |
369 | diff --git a/tests/autopilot/unity/tests/launcher/test_keynav.py b/tests/autopilot/unity/tests/launcher/test_keynav.py | |||
370 | index 85b2bad..57a9ccc 100644 | |||
371 | --- a/tests/autopilot/unity/tests/launcher/test_keynav.py | |||
372 | +++ b/tests/autopilot/unity/tests/launcher/test_keynav.py | |||
373 | @@ -7,7 +7,6 @@ | |||
374 | 7 | # under the terms of the GNU General Public License version 3, as published | 7 | # under the terms of the GNU General Public License version 3, as published |
375 | 8 | # by the Free Software Foundation. | 8 | # by the Free Software Foundation. |
376 | 9 | 9 | ||
377 | 10 | from __future__ import absolute_import | ||
378 | 11 | 10 | ||
379 | 12 | from autopilot.matchers import Eventually | 11 | from autopilot.matchers import Eventually |
380 | 13 | import logging | 12 | import logging |
381 | diff --git a/tests/autopilot/unity/tests/launcher/test_reveal.py b/tests/autopilot/unity/tests/launcher/test_reveal.py | |||
382 | index 7d57f12..2bc6d22 100644 | |||
383 | --- a/tests/autopilot/unity/tests/launcher/test_reveal.py | |||
384 | +++ b/tests/autopilot/unity/tests/launcher/test_reveal.py | |||
385 | @@ -7,7 +7,6 @@ | |||
386 | 7 | # under the terms of the GNU General Public License version 3, as published | 7 | # under the terms of the GNU General Public License version 3, as published |
387 | 8 | # by the Free Software Foundation. | 8 | # by the Free Software Foundation. |
388 | 9 | 9 | ||
389 | 10 | from __future__ import absolute_import | ||
390 | 11 | 10 | ||
391 | 12 | from autopilot.display import move_mouse_to_screen | 11 | from autopilot.display import move_mouse_to_screen |
392 | 13 | from autopilot.matchers import Eventually | 12 | from autopilot.matchers import Eventually |
393 | diff --git a/tests/autopilot/unity/tests/launcher/test_scroll.py b/tests/autopilot/unity/tests/launcher/test_scroll.py | |||
394 | index 5e500c7..8dcac19 100644 | |||
395 | --- a/tests/autopilot/unity/tests/launcher/test_scroll.py | |||
396 | +++ b/tests/autopilot/unity/tests/launcher/test_scroll.py | |||
397 | @@ -6,7 +6,6 @@ | |||
398 | 6 | # under the terms of the GNU General Public License version 3, as published | 6 | # under the terms of the GNU General Public License version 3, as published |
399 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
400 | 8 | 8 | ||
401 | 9 | from __future__ import absolute_import | ||
402 | 10 | 9 | ||
403 | 11 | from autopilot.matchers import Eventually | 10 | from autopilot.matchers import Eventually |
404 | 12 | import logging | 11 | import logging |
405 | diff --git a/tests/autopilot/unity/tests/launcher/test_shortcut.py b/tests/autopilot/unity/tests/launcher/test_shortcut.py | |||
406 | index 28d6613..9aafc4f 100644 | |||
407 | --- a/tests/autopilot/unity/tests/launcher/test_shortcut.py | |||
408 | +++ b/tests/autopilot/unity/tests/launcher/test_shortcut.py | |||
409 | @@ -7,7 +7,6 @@ | |||
410 | 7 | # under the terms of the GNU General Public License version 3, as published | 7 | # under the terms of the GNU General Public License version 3, as published |
411 | 8 | # by the Free Software Foundation. | 8 | # by the Free Software Foundation. |
412 | 9 | 9 | ||
413 | 10 | from __future__ import absolute_import | ||
414 | 11 | 10 | ||
415 | 12 | from autopilot.matchers import Eventually | 11 | from autopilot.matchers import Eventually |
416 | 13 | import logging | 12 | import logging |
417 | diff --git a/tests/autopilot/unity/tests/launcher/test_switcher.py b/tests/autopilot/unity/tests/launcher/test_switcher.py | |||
418 | index 657cc23..833c03e 100644 | |||
419 | --- a/tests/autopilot/unity/tests/launcher/test_switcher.py | |||
420 | +++ b/tests/autopilot/unity/tests/launcher/test_switcher.py | |||
421 | @@ -7,7 +7,6 @@ | |||
422 | 7 | # under the terms of the GNU General Public License version 3, as published | 7 | # under the terms of the GNU General Public License version 3, as published |
423 | 8 | # by the Free Software Foundation. | 8 | # by the Free Software Foundation. |
424 | 9 | 9 | ||
425 | 10 | from __future__ import absolute_import | ||
426 | 11 | 10 | ||
427 | 12 | from autopilot.matchers import Eventually | 11 | from autopilot.matchers import Eventually |
428 | 13 | 12 | ||
429 | diff --git a/tests/autopilot/unity/tests/launcher/test_visual.py b/tests/autopilot/unity/tests/launcher/test_visual.py | |||
430 | index c44e923..262a2cb 100644 | |||
431 | --- a/tests/autopilot/unity/tests/launcher/test_visual.py | |||
432 | +++ b/tests/autopilot/unity/tests/launcher/test_visual.py | |||
433 | @@ -7,7 +7,6 @@ | |||
434 | 7 | # under the terms of the GNU General Public License version 3, as published | 7 | # under the terms of the GNU General Public License version 3, as published |
435 | 8 | # by the Free Software Foundation. | 8 | # by the Free Software Foundation. |
436 | 9 | 9 | ||
437 | 10 | from __future__ import absolute_import | ||
438 | 11 | 10 | ||
439 | 12 | from autopilot.matchers import Eventually | 11 | from autopilot.matchers import Eventually |
440 | 13 | import logging | 12 | import logging |
441 | diff --git a/tests/autopilot/unity/tests/test_command_lens.py b/tests/autopilot/unity/tests/test_command_lens.py | |||
442 | index acafc49..4076c01 100644 | |||
443 | --- a/tests/autopilot/unity/tests/test_command_lens.py | |||
444 | +++ b/tests/autopilot/unity/tests/test_command_lens.py | |||
445 | @@ -6,7 +6,6 @@ | |||
446 | 6 | # under the terms of the GNU General Public License version 3, as published | 6 | # under the terms of the GNU General Public License version 3, as published |
447 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
448 | 8 | 8 | ||
449 | 9 | from __future__ import absolute_import | ||
450 | 10 | 9 | ||
451 | 11 | from autopilot.matchers import Eventually | 10 | from autopilot.matchers import Eventually |
452 | 12 | from testtools.matchers import Equals, NotEquals, GreaterThan, MatchesPredicate | 11 | from testtools.matchers import Equals, NotEquals, GreaterThan, MatchesPredicate |
453 | diff --git a/tests/autopilot/unity/tests/test_dash.py b/tests/autopilot/unity/tests/test_dash.py | |||
454 | index 8f4943a..c7b2106 100644 | |||
455 | --- a/tests/autopilot/unity/tests/test_dash.py | |||
456 | +++ b/tests/autopilot/unity/tests/test_dash.py | |||
457 | @@ -6,7 +6,6 @@ | |||
458 | 6 | # under the terms of the GNU General Public License version 3, as published | 6 | # under the terms of the GNU General Public License version 3, as published |
459 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
460 | 8 | 8 | ||
461 | 9 | from __future__ import absolute_import | ||
462 | 10 | 9 | ||
463 | 11 | from autopilot.clipboard import get_clipboard_contents | 10 | from autopilot.clipboard import get_clipboard_contents |
464 | 12 | from autopilot.display import move_mouse_to_screen | 11 | from autopilot.display import move_mouse_to_screen |
465 | @@ -266,14 +265,14 @@ class DashMultiKeyTests(DashSearchInputTests): | |||
466 | 266 | self.unity.dash.reveal_application_scope() | 265 | self.unity.dash.reveal_application_scope() |
467 | 267 | self.keyboard.press_and_release('Multi_key') | 266 | self.keyboard.press_and_release('Multi_key') |
468 | 268 | self.keyboard.type("^o") | 267 | self.keyboard.type("^o") |
470 | 269 | self.assertSearchText(u'\xf4') | 268 | self.assertSearchText('\xf4') |
471 | 270 | 269 | ||
472 | 271 | def test_multi_key_copyright(self): | 270 | def test_multi_key_copyright(self): |
473 | 272 | """Pressing the sequences 'Multi_key' + 'c' + 'o' must produce '©'.""" | 271 | """Pressing the sequences 'Multi_key' + 'c' + 'o' must produce '©'.""" |
474 | 273 | self.unity.dash.reveal_application_scope() | 272 | self.unity.dash.reveal_application_scope() |
475 | 274 | self.keyboard.press_and_release('Multi_key') | 273 | self.keyboard.press_and_release('Multi_key') |
476 | 275 | self.keyboard.type("oc") | 274 | self.keyboard.type("oc") |
478 | 276 | self.assertSearchText(u'\xa9') | 275 | self.assertSearchText('\xa9') |
479 | 277 | 276 | ||
480 | 278 | def test_multi_key_delete(self): | 277 | def test_multi_key_delete(self): |
481 | 279 | """Pressing 'Multi_key' must not get stuck looking for a sequence.""" | 278 | """Pressing 'Multi_key' must not get stuck looking for a sequence.""" |
482 | @@ -382,7 +381,7 @@ class DashKeyNavTests(DashTestCase): | |||
483 | 382 | self.keyboard.release('Control') | 381 | self.keyboard.release('Control') |
484 | 383 | 382 | ||
485 | 384 | scopebar = self.unity.dash.view.get_scopebar() | 383 | scopebar = self.unity.dash.view.get_scopebar() |
487 | 385 | self.assertEqual(scopebar.active_scope, u'applications.scope') | 384 | self.assertEqual(scopebar.active_scope, 'applications.scope') |
488 | 386 | 385 | ||
489 | 387 | self.keyboard.press('Control') | 386 | self.keyboard.press('Control') |
490 | 388 | self.keyboard.press('Shift') | 387 | self.keyboard.press('Shift') |
491 | @@ -722,7 +721,7 @@ class DashScopeBarTests(DashTestCase): | |||
492 | 722 | """Scope selection should work when clicking in | 721 | """Scope selection should work when clicking in |
493 | 723 | the rectangle outside of the icon. | 722 | the rectangle outside of the icon. |
494 | 724 | """ | 723 | """ |
496 | 725 | app_icon = self.scopebar.get_icon_by_name(u'applications.scope') | 724 | app_icon = self.scopebar.get_icon_by_name('applications.scope') |
497 | 726 | self.mouse.click_object(app_icon) | 725 | self.mouse.click_object(app_icon) |
498 | 727 | 726 | ||
499 | 728 | self.assertThat(self.scopebar.active_scope, Eventually(Equals('applications.scope'))) | 727 | self.assertThat(self.scopebar.active_scope, Eventually(Equals('applications.scope'))) |
500 | diff --git a/tests/autopilot/unity/tests/test_gnome_key_grabber.py b/tests/autopilot/unity/tests/test_gnome_key_grabber.py | |||
501 | index d7c49f6..e0767b1 100644 | |||
502 | --- a/tests/autopilot/unity/tests/test_gnome_key_grabber.py | |||
503 | +++ b/tests/autopilot/unity/tests/test_gnome_key_grabber.py | |||
504 | @@ -135,7 +135,7 @@ class GnomeKeyGrabberTests(unity.tests.UnityTestCase): | |||
505 | 135 | self.check_accelerator(accelerator) | 135 | self.check_accelerator(accelerator) |
506 | 136 | 136 | ||
507 | 137 | def test_grab_same_accelerator(self): | 137 | def test_grab_same_accelerator(self): |
509 | 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)] |
510 | 139 | actions = self.interface.GrabAccelerators([(accelerator.accelerator, 0) for accelerator in accelerators]) | 139 | actions = self.interface.GrabAccelerators([(accelerator.accelerator, 0) for accelerator in accelerators]) |
511 | 140 | 140 | ||
512 | 141 | self.activatable.clear() | 141 | self.activatable.clear() |
513 | diff --git a/tests/autopilot/unity/tests/test_gobject_introspection.py b/tests/autopilot/unity/tests/test_gobject_introspection.py | |||
514 | index 58a0c38..d1a7573 100755 | |||
515 | --- a/tests/autopilot/unity/tests/test_gobject_introspection.py | |||
516 | +++ b/tests/autopilot/unity/tests/test_gobject_introspection.py | |||
517 | @@ -6,7 +6,6 @@ | |||
518 | 6 | # under the terms of the GNU General Public License version 3, as published | 6 | # under the terms of the GNU General Public License version 3, as published |
519 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
520 | 8 | 8 | ||
521 | 9 | from __future__ import absolute_import | ||
522 | 10 | 9 | ||
523 | 11 | from testtools import TestCase | 10 | from testtools import TestCase |
524 | 12 | 11 | ||
525 | diff --git a/tests/autopilot/unity/tests/test_home_lens.py b/tests/autopilot/unity/tests/test_home_lens.py | |||
526 | index 4094d84..f880666 100644 | |||
527 | --- a/tests/autopilot/unity/tests/test_home_lens.py | |||
528 | +++ b/tests/autopilot/unity/tests/test_home_lens.py | |||
529 | @@ -6,7 +6,6 @@ | |||
530 | 6 | # under the terms of the GNU General Public License version 3, as published | 6 | # under the terms of the GNU General Public License version 3, as published |
531 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
532 | 8 | 8 | ||
533 | 9 | from __future__ import absolute_import | ||
534 | 10 | 9 | ||
535 | 11 | from autopilot.matchers import Eventually | 10 | from autopilot.matchers import Eventually |
536 | 12 | from testtools.matchers import Equals | 11 | from testtools.matchers import Equals |
537 | diff --git a/tests/autopilot/unity/tests/test_hud.py b/tests/autopilot/unity/tests/test_hud.py | |||
538 | index 310ceb1..719c7fd 100644 | |||
539 | --- a/tests/autopilot/unity/tests/test_hud.py | |||
540 | +++ b/tests/autopilot/unity/tests/test_hud.py | |||
541 | @@ -7,7 +7,6 @@ | |||
542 | 7 | # under the terms of the GNU General Public License version 3, as published | 7 | # under the terms of the GNU General Public License version 3, as published |
543 | 8 | # by the Free Software Foundation. | 8 | # by the Free Software Foundation. |
544 | 9 | 9 | ||
545 | 10 | from __future__ import absolute_import | ||
546 | 11 | 10 | ||
547 | 12 | from autopilot.matchers import Eventually | 11 | from autopilot.matchers import Eventually |
548 | 13 | from autopilot.display import Display, move_mouse_to_screen, is_rect_on_screen | 12 | from autopilot.display import Display, move_mouse_to_screen, is_rect_on_screen |
549 | @@ -230,7 +229,7 @@ class HudBehaviorTests(HudTestsBase): | |||
550 | 230 | 229 | ||
551 | 231 | self.keyboard.type("save") | 230 | self.keyboard.type("save") |
552 | 232 | 231 | ||
554 | 233 | self.hud_query_check(u'Save\u2002(File)') | 232 | self.hud_query_check('Save\u2002(File)') |
555 | 234 | 233 | ||
556 | 235 | self.keyboard.press_and_release('Return') | 234 | self.keyboard.press_and_release('Return') |
557 | 236 | self.addCleanup(self.keyboard.press_and_release, "Ctrl+s") | 235 | self.addCleanup(self.keyboard.press_and_release, "Ctrl+s") |
558 | @@ -338,7 +337,7 @@ class HudBehaviorTests(HudTestsBase): | |||
559 | 338 | self.keyboard.type("Quit") | 337 | self.keyboard.type("Quit") |
560 | 339 | self.assertThat(self.unity.hud.search_string, Eventually(Equals("Quit"))) | 338 | self.assertThat(self.unity.hud.search_string, Eventually(Equals("Quit"))) |
561 | 340 | 339 | ||
563 | 341 | self.hud_query_check(u'Quit\u2002(File)') | 340 | self.hud_query_check('Quit\u2002(File)') |
564 | 342 | 341 | ||
565 | 343 | self.keyboard.press_and_release("Enter") | 342 | self.keyboard.press_and_release("Enter") |
566 | 344 | 343 | ||
567 | diff --git a/tests/autopilot/unity/tests/test_ibus.py b/tests/autopilot/unity/tests/test_ibus.py | |||
568 | index 580e5b8..5173dd7 100644 | |||
569 | --- a/tests/autopilot/unity/tests/test_ibus.py | |||
570 | +++ b/tests/autopilot/unity/tests/test_ibus.py | |||
571 | @@ -8,7 +8,6 @@ | |||
572 | 8 | 8 | ||
573 | 9 | """Tests to ensure unity is compatible with ibus input method.""" | 9 | """Tests to ensure unity is compatible with ibus input method.""" |
574 | 10 | 10 | ||
575 | 11 | from __future__ import absolute_import | ||
576 | 12 | 11 | ||
577 | 13 | from unity.emulators.ibus import ( | 12 | from unity.emulators.ibus import ( |
578 | 14 | get_active_input_engines, | 13 | get_active_input_engines, |
579 | @@ -85,7 +84,7 @@ class IBusQuery: | |||
580 | 85 | timeout.start() | 84 | timeout.start() |
581 | 86 | while self._context.get_engine() is None: | 85 | while self._context.get_engine() is None: |
582 | 87 | if self._abort is True: | 86 | if self._abort is True: |
584 | 88 | print "Error! Could not set the engine correctly." | 87 | print ("Error! Could not set the engine correctly.") |
585 | 89 | return None | 88 | return None |
586 | 90 | continue | 89 | continue |
587 | 91 | timeout.cancel() | 90 | timeout.cancel() |
588 | @@ -99,7 +98,7 @@ class IBusQuery: | |||
589 | 99 | GLib.timeout_add_seconds(5, lambda *args: self._glibloop.quit()) | 98 | GLib.timeout_add_seconds(5, lambda *args: self._glibloop.quit()) |
590 | 100 | self._glibloop.run() | 99 | self._glibloop.run() |
591 | 101 | 100 | ||
593 | 102 | return unicode(self.result, "UTF-8") | 101 | return str(self.result, "UTF-8") |
594 | 103 | 102 | ||
595 | 104 | 103 | ||
596 | 105 | 104 | ||
597 | @@ -240,10 +239,10 @@ class IBusTestsPinyin(IBusWidgetScenariodTests): | |||
598 | 240 | scenarios = multiply_scenarios( | 239 | scenarios = multiply_scenarios( |
599 | 241 | IBusWidgetScenariodTests.scenarios, | 240 | IBusWidgetScenariodTests.scenarios, |
600 | 242 | [ | 241 | [ |
605 | 243 | ('photo', {'input': 'zhaopian ', 'result' : u'\u7167\u7247' }), | 242 | ('photo', {'input': 'zhaopian ', 'result' : '\u7167\u7247' }), |
606 | 244 | ('internet', {'input': 'hulianwang ', 'result' : u'\u4e92\u8054\u7f51'}), | 243 | ('internet', {'input': 'hulianwang ', 'result' : '\u4e92\u8054\u7f51'}), |
607 | 245 | ('hello', {'input': 'ninhao ', 'result' : u'\u60a8\u597d' }), | 244 | ('hello', {'input': 'ninhao ', 'result' : '\u60a8\u597d' }), |
608 | 246 | ('management', {'input': 'guanli ', 'result' : u'\u7ba1\u7406' }), | 245 | ('management', {'input': 'guanli ', 'result' : '\u7ba1\u7406' }), |
609 | 247 | ] | 246 | ] |
610 | 248 | ) | 247 | ) |
611 | 249 | 248 | ||
612 | @@ -263,9 +262,9 @@ class IBusTestsHangul(IBusWidgetScenariodTests): | |||
613 | 263 | scenarios = multiply_scenarios( | 262 | scenarios = multiply_scenarios( |
614 | 264 | IBusWidgetScenariodTests.scenarios, | 263 | IBusWidgetScenariodTests.scenarios, |
615 | 265 | [ | 264 | [ |
619 | 266 | ('transmission', {'input': 'xmfostmaltus ', 'result': u'\ud2b8\ub79c\uc2a4\ubbf8\uc158 '}), | 265 | ('transmission', {'input': 'xmfostmaltus ', 'result': '\ud2b8\ub79c\uc2a4\ubbf8\uc158 '}), |
620 | 267 | ('social', {'input': 'httuf ', 'result': u'\uc18c\uc15c '}), | 266 | ('social', {'input': 'httuf ', 'result': '\uc18c\uc15c '}), |
621 | 268 | ('document', {'input': 'anstj ', 'result': u'\ubb38\uc11c '}), | 267 | ('document', {'input': 'anstj ', 'result': '\ubb38\uc11c '}), |
622 | 269 | ] | 268 | ] |
623 | 270 | ) | 269 | ) |
624 | 271 | 270 | ||
625 | @@ -285,9 +284,9 @@ class IBusTestsAnthy(IBusWidgetScenariodTests): | |||
626 | 285 | scenarios = multiply_scenarios( | 284 | scenarios = multiply_scenarios( |
627 | 286 | IBusWidgetScenariodTests.scenarios, | 285 | IBusWidgetScenariodTests.scenarios, |
628 | 287 | [ | 286 | [ |
632 | 288 | ('system', {'input': 'shisutemu ', 'result' : u'\u30b7\u30b9\u30c6\u30e0' }), | 287 | ('system', {'input': 'shisutemu ', 'result' : '\u30b7\u30b9\u30c6\u30e0' }), |
633 | 289 | ('game', {'input': 'ge-mu ', 'result' : u'\u30b2\u30fc\u30e0' }), | 288 | ('game', {'input': 'ge-mu ', 'result' : '\u30b2\u30fc\u30e0' }), |
634 | 290 | ('user', {'input': 'yu-za- ', 'result' : u'\u30e6\u30fc\u30b6\u30fc' }), | 289 | ('user', {'input': 'yu-za- ', 'result' : '\u30e6\u30fc\u30b6\u30fc' }), |
635 | 291 | ], | 290 | ], |
636 | 292 | [ | 291 | [ |
637 | 293 | ('commit_enter', {'commit_key': 'Enter'}), | 292 | ('commit_enter', {'commit_key': 'Enter'}), |
638 | diff --git a/tests/autopilot/unity/tests/test_panel.py b/tests/autopilot/unity/tests/test_panel.py | |||
639 | index 634fd93..d2119ab 100644 | |||
640 | --- a/tests/autopilot/unity/tests/test_panel.py | |||
641 | +++ b/tests/autopilot/unity/tests/test_panel.py | |||
642 | @@ -6,7 +6,6 @@ | |||
643 | 6 | # under the terms of the GNU General Public License version 3, as published | 6 | # under the terms of the GNU General Public License version 3, as published |
644 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
645 | 8 | 8 | ||
646 | 9 | from __future__ import absolute_import | ||
647 | 10 | 9 | ||
648 | 11 | from autopilot.display import Display | 10 | from autopilot.display import Display |
649 | 12 | #from autopilot.emulators.bamf import BamfWindow | 11 | #from autopilot.emulators.bamf import BamfWindow |
650 | diff --git a/tests/autopilot/unity/tests/test_quicklist.py b/tests/autopilot/unity/tests/test_quicklist.py | |||
651 | index a6a1971..32c3566 100644 | |||
652 | --- a/tests/autopilot/unity/tests/test_quicklist.py | |||
653 | +++ b/tests/autopilot/unity/tests/test_quicklist.py | |||
654 | @@ -7,7 +7,6 @@ | |||
655 | 7 | # under the terms of the GNU General Public License version 3, as published | 7 | # under the terms of the GNU General Public License version 3, as published |
656 | 8 | # by the Free Software Foundation. | 8 | # by the Free Software Foundation. |
657 | 9 | 9 | ||
658 | 10 | from __future__ import absolute_import | ||
659 | 11 | 10 | ||
660 | 12 | from autopilot.display import move_mouse_to_screen | 11 | from autopilot.display import move_mouse_to_screen |
661 | 13 | from autopilot.matchers import Eventually | 12 | from autopilot.matchers import Eventually |
662 | diff --git a/tests/autopilot/unity/tests/test_search.py b/tests/autopilot/unity/tests/test_search.py | |||
663 | index 87d038b..d7297b1 100644 | |||
664 | --- a/tests/autopilot/unity/tests/test_search.py | |||
665 | +++ b/tests/autopilot/unity/tests/test_search.py | |||
666 | @@ -6,7 +6,6 @@ | |||
667 | 6 | # under the terms of the GNU General Public License version 3, as published | 6 | # under the terms of the GNU General Public License version 3, as published |
668 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
669 | 8 | 8 | ||
670 | 9 | from __future__ import absolute_import | ||
671 | 10 | 9 | ||
672 | 11 | from autopilot.matchers import Eventually | 10 | from autopilot.matchers import Eventually |
673 | 12 | from testtools.matchers import ( | 11 | from testtools.matchers import ( |
674 | diff --git a/tests/autopilot/unity/tests/test_shopping_lens.py b/tests/autopilot/unity/tests/test_shopping_lens.py | |||
675 | index 94a435d..8f7bcb1 100644 | |||
676 | --- a/tests/autopilot/unity/tests/test_shopping_lens.py | |||
677 | +++ b/tests/autopilot/unity/tests/test_shopping_lens.py | |||
678 | @@ -6,12 +6,11 @@ | |||
679 | 6 | # under the terms of the GNU General Public License version 3, as published | 6 | # under the terms of the GNU General Public License version 3, as published |
680 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
681 | 8 | 8 | ||
682 | 9 | from __future__ import absolute_import | ||
683 | 10 | 9 | ||
684 | 11 | from autopilot.matchers import Eventually | 10 | from autopilot.matchers import Eventually |
685 | 12 | from testtools.matchers import Equals, GreaterThan | 11 | from testtools.matchers import Equals, GreaterThan |
686 | 13 | from time import sleep | 12 | from time import sleep |
688 | 14 | import urllib2 | 13 | import urllib.request, urllib.error, urllib.parse |
689 | 15 | import gettext | 14 | import gettext |
690 | 16 | 15 | ||
691 | 17 | from unity.tests import UnityTestCase | 16 | from unity.tests import UnityTestCase |
692 | @@ -23,8 +22,8 @@ class ShoppingScopeTests(UnityTestCase): | |||
693 | 23 | def setUp(self): | 22 | def setUp(self): |
694 | 24 | super(ShoppingScopeTests, self).setUp() | 23 | super(ShoppingScopeTests, self).setUp() |
695 | 25 | try: | 24 | try: |
698 | 26 | urllib2.urlopen("http://www.google.com", timeout=2) | 25 | urllib.request.urlopen("http://www.google.com", timeout=2) |
699 | 27 | except urllib2.URLError, e: | 26 | except urllib.error.URLError as e: |
700 | 28 | self.skip("Skipping test, no internet connection") | 27 | self.skip("Skipping test, no internet connection") |
701 | 29 | gettext.install("unity-scope-shopping") | 28 | gettext.install("unity-scope-shopping") |
702 | 30 | 29 | ||
703 | diff --git a/tests/autopilot/unity/tests/test_shortcut_hint.py b/tests/autopilot/unity/tests/test_shortcut_hint.py | |||
704 | index 0320516..899c77a 100644 | |||
705 | --- a/tests/autopilot/unity/tests/test_shortcut_hint.py | |||
706 | +++ b/tests/autopilot/unity/tests/test_shortcut_hint.py | |||
707 | @@ -6,7 +6,6 @@ | |||
708 | 6 | # under the terms of the GNU General Public License version 3, as published | 6 | # under the terms of the GNU General Public License version 3, as published |
709 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
710 | 8 | 8 | ||
711 | 9 | from __future__ import absolute_import | ||
712 | 10 | 9 | ||
713 | 11 | from autopilot.matchers import Eventually | 10 | from autopilot.matchers import Eventually |
714 | 12 | from testtools.matchers import Equals | 11 | from testtools.matchers import Equals |
715 | diff --git a/tests/autopilot/unity/tests/test_showdesktop.py b/tests/autopilot/unity/tests/test_showdesktop.py | |||
716 | index 546b716..ce00894 100644 | |||
717 | --- a/tests/autopilot/unity/tests/test_showdesktop.py | |||
718 | +++ b/tests/autopilot/unity/tests/test_showdesktop.py | |||
719 | @@ -6,7 +6,6 @@ | |||
720 | 6 | # under the terms of the GNU General Public License version 3, as published | 6 | # under the terms of the GNU General Public License version 3, as published |
721 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
722 | 8 | 8 | ||
723 | 9 | from __future__ import absolute_import | ||
724 | 10 | 9 | ||
725 | 11 | from autopilot.matchers import Eventually | 10 | from autopilot.matchers import Eventually |
726 | 12 | from testtools.matchers import Equals | 11 | from testtools.matchers import Equals |
727 | diff --git a/tests/autopilot/unity/tests/test_spread.py b/tests/autopilot/unity/tests/test_spread.py | |||
728 | index 0cc91a1..961ac1e 100644 | |||
729 | --- a/tests/autopilot/unity/tests/test_spread.py | |||
730 | +++ b/tests/autopilot/unity/tests/test_spread.py | |||
731 | @@ -6,7 +6,6 @@ | |||
732 | 6 | # under the terms of the GNU General Public License version 3, as published | 6 | # under the terms of the GNU General Public License version 3, as published |
733 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
734 | 8 | 8 | ||
735 | 9 | from __future__ import absolute_import | ||
736 | 10 | 9 | ||
737 | 11 | from autopilot.display import Display | 10 | from autopilot.display import Display |
738 | 12 | from autopilot.matchers import Eventually | 11 | from autopilot.matchers import Eventually |
739 | diff --git a/tests/autopilot/unity/tests/test_switcher.py b/tests/autopilot/unity/tests/test_switcher.py | |||
740 | index d302db1..38d7985 100644 | |||
741 | --- a/tests/autopilot/unity/tests/test_switcher.py | |||
742 | +++ b/tests/autopilot/unity/tests/test_switcher.py | |||
743 | @@ -6,7 +6,6 @@ | |||
744 | 6 | # under the terms of the GNU General Public License version 3, as published | 6 | # under the terms of the GNU General Public License version 3, as published |
745 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
746 | 8 | 8 | ||
747 | 9 | from __future__ import absolute_import | ||
748 | 10 | 9 | ||
749 | 11 | from autopilot.display import move_mouse_to_screen | 10 | from autopilot.display import move_mouse_to_screen |
750 | 12 | from autopilot.matchers import Eventually | 11 | from autopilot.matchers import Eventually |
751 | diff --git a/tests/autopilot/unity/tests/test_unity_logging.py b/tests/autopilot/unity/tests/test_unity_logging.py | |||
752 | index 0aa8844..4b106b7 100644 | |||
753 | --- a/tests/autopilot/unity/tests/test_unity_logging.py | |||
754 | +++ b/tests/autopilot/unity/tests/test_unity_logging.py | |||
755 | @@ -6,8 +6,6 @@ | |||
756 | 6 | # under the terms of the GNU General Public License version 3, as published | 6 | # under the terms of the GNU General Public License version 3, as published |
757 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
758 | 8 | 8 | ||
759 | 9 | from __future__ import absolute_import | ||
760 | 10 | |||
761 | 11 | from os import remove | 9 | from os import remove |
762 | 12 | from os.path import exists | 10 | from os.path import exists |
763 | 13 | from tempfile import mktemp | 11 | from tempfile import mktemp |
764 | diff --git a/tests/autopilot/unity/tests/test_wm_keybindings.py b/tests/autopilot/unity/tests/test_wm_keybindings.py | |||
765 | index fe5418d..89390bb 100644 | |||
766 | --- a/tests/autopilot/unity/tests/test_wm_keybindings.py | |||
767 | +++ b/tests/autopilot/unity/tests/test_wm_keybindings.py | |||
768 | @@ -6,7 +6,6 @@ | |||
769 | 6 | # under the terms of the GNU General Public License version 3, as published | 6 | # under the terms of the GNU General Public License version 3, as published |
770 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
771 | 8 | 8 | ||
772 | 9 | from __future__ import absolute_import | ||
773 | 10 | 9 | ||
774 | 11 | from autopilot.matchers import Eventually | 10 | from autopilot.matchers import Eventually |
775 | 12 | from testtools.matchers import Equals, NotEquals, GreaterThan | 11 | from testtools.matchers import Equals, NotEquals, GreaterThan |
776 | diff --git a/tests/autopilot/unity/tests/xim/test_gcin.py b/tests/autopilot/unity/tests/xim/test_gcin.py | |||
777 | index 81420cd..7f0cda1 100644 | |||
778 | --- a/tests/autopilot/unity/tests/xim/test_gcin.py | |||
779 | +++ b/tests/autopilot/unity/tests/xim/test_gcin.py | |||
780 | @@ -6,7 +6,6 @@ | |||
781 | 6 | # under the terms of the GNU General Public License version 3, as published | 6 | # under the terms of the GNU General Public License version 3, as published |
782 | 7 | # by the Free Software Foundation. | 7 | # by the Free Software Foundation. |
783 | 8 | 8 | ||
784 | 9 | from __future__ import absolute_import | ||
785 | 10 | 9 | ||
786 | 11 | from autopilot.matchers import Eventually | 10 | from autopilot.matchers import Eventually |
787 | 12 | from os import environ | 11 | from os import environ |
788 | @@ -34,9 +33,9 @@ class GcinTestHangul(GcinTestCase): | |||
789 | 34 | """Tests the Dash and Hud with gcin in hangul mode.""" | 33 | """Tests the Dash and Hud with gcin in hangul mode.""" |
790 | 35 | 34 | ||
791 | 36 | scenarios = [ | 35 | scenarios = [ |
795 | 37 | ('hangul', {'input': 'han geul ', 'result': u'\ud55c\uae00'}), | 36 | ('hangul', {'input': 'han geul ', 'result': '\ud55c\uae00'}), |
796 | 38 | ('morning letters', {'input': 'a chimgeul ', 'result': u'\uc544\uce68\uae00'}), | 37 | ('morning letters', {'input': 'a chimgeul ', 'result': '\uc544\uce68\uae00'}), |
797 | 39 | ('national script', {'input': 'gug mun ', 'result': u'\uad6d\ubb38'}), | 38 | ('national script', {'input': 'gug mun ', 'result': '\uad6d\ubb38'}), |
798 | 40 | ] | 39 | ] |
799 | 41 | 40 | ||
800 | 42 | def setUp(self): | 41 | def setUp(self): |
801 | diff --git a/tools/makebootchart.py b/tools/makebootchart.py | |||
802 | index 8915494..15e941a 100755 | |||
803 | --- a/tools/makebootchart.py | |||
804 | +++ b/tools/makebootchart.py | |||
805 | @@ -76,7 +76,7 @@ def draw_bg_graph (ctx, seconds, height): | |||
806 | 76 | ctx.stroke () | 76 | ctx.stroke () |
807 | 77 | 77 | ||
808 | 78 | per_ten = 0 | 78 | per_ten = 0 |
810 | 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)): |
811 | 80 | ctx.set_line_width (1) | 80 | ctx.set_line_width (1) |
812 | 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) |
813 | 82 | 82 | ||
814 | @@ -156,7 +156,7 @@ def build_graph (data, filename, info): | |||
815 | 156 | def build_data_structure (input): | 156 | def build_data_structure (input): |
816 | 157 | reader = csv.reader(open(input)) | 157 | reader = csv.reader(open(input)) |
817 | 158 | structure = [] | 158 | structure = [] |
819 | 159 | print "reading", input | 159 | print("reading", input) |
820 | 160 | for row in reader: | 160 | for row in reader: |
821 | 161 | name = row[0] | 161 | name = row[0] |
822 | 162 | start = float(row[1]) | 162 | start = float(row[1]) |
823 | @@ -168,15 +168,15 @@ def build_data_structure (input): | |||
824 | 168 | 168 | ||
825 | 169 | 169 | ||
826 | 170 | def usage(): | 170 | def usage(): |
828 | 171 | print "use --input=filename.log and --output=filename.svg :)" | 171 | print("use --input=filename.log and --output=filename.svg :)") |
829 | 172 | 172 | ||
830 | 173 | def main(): | 173 | def main(): |
831 | 174 | 174 | ||
832 | 175 | try: | 175 | try: |
833 | 176 | opts, args = getopt.getopt(sys.argv[1:], "h", ["help", "output=", "input="]) | 176 | opts, args = getopt.getopt(sys.argv[1:], "h", ["help", "output=", "input="]) |
835 | 177 | except getopt.GetoptError, err: | 177 | except getopt.GetoptError as err: |
836 | 178 | # print help information and exit: | 178 | # print help information and exit: |
838 | 179 | print str(err) # will print something like "option -a not recognized" | 179 | print(str(err)) # will print something like "option -a not recognized" |
839 | 180 | usage() | 180 | usage() |
840 | 181 | sys.exit(2) | 181 | sys.exit(2) |
841 | 182 | 182 | ||
842 | diff --git a/tools/unity-introspection-visualiser.py b/tools/unity-introspection-visualiser.py | |||
843 | index c56b241..a30c67e 100755 | |||
844 | --- a/tools/unity-introspection-visualiser.py | |||
845 | +++ b/tools/unity-introspection-visualiser.py | |||
846 | @@ -9,16 +9,16 @@ import dbus | |||
847 | 9 | 9 | ||
848 | 10 | try: | 10 | try: |
849 | 11 | from autopilot.emulators.unity import get_state_by_path | 11 | from autopilot.emulators.unity import get_state_by_path |
853 | 12 | except ImportError, e: | 12 | except ImportError as e: |
854 | 13 | print "Error: could not import the autopilot python module." | 13 | print("Error: could not import the autopilot python module.") |
855 | 14 | print "Make sure the autopilot module is in your $PYTHONPATH." | 14 | print("Make sure the autopilot module is in your $PYTHONPATH.") |
856 | 15 | exit(1) | 15 | exit(1) |
857 | 16 | 16 | ||
858 | 17 | try: | 17 | try: |
859 | 18 | import pydot | 18 | import pydot |
860 | 19 | except ImportError: | 19 | except ImportError: |
863 | 20 | print "Error: the 'pydot' module is required to run this script." | 20 | print("Error: the 'pydot' module is required to run this script.") |
864 | 21 | print "Try installing the 'python-pydot' package." | 21 | print("Try installing the 'python3-pydot' package.") |
865 | 22 | exit(1) | 22 | exit(1) |
866 | 23 | 23 | ||
867 | 24 | NEXT_NODE_ID=1 | 24 | NEXT_NODE_ID=1 |
868 | @@ -53,7 +53,7 @@ def traverse_tree(state, parent, graph): | |||
869 | 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'] |
870 | 54 | lbl += "\l".join(bits) | 54 | lbl += "\l".join(bits) |
871 | 55 | parent.set_label(escape('"{' + lbl + '}"')) | 55 | parent.set_label(escape('"{' + lbl + '}"')) |
873 | 56 | if state.has_key('Children'): | 56 | if 'Children' in state: |
874 | 57 | # Add all array nodes as children of this node. | 57 | # Add all array nodes as children of this node. |
875 | 58 | for child_name, child_state in state['Children']: | 58 | for child_name, child_state in state['Children']: |
876 | 59 | if child_name in NODE_BLACKLIST: | 59 | if child_name in NODE_BLACKLIST: |
877 | @@ -94,7 +94,7 @@ if __name__ == '__main__': | |||
878 | 94 | if hasattr(graph, write_method_name): | 94 | if hasattr(graph, write_method_name): |
879 | 95 | getattr(graph, write_method_name)(args.output[0]) | 95 | getattr(graph, write_method_name)(args.output[0]) |
880 | 96 | else: | 96 | else: |
882 | 97 | print "Error: unsupported format: '%s'" % (extension) | 97 | print("Error: unsupported format: '%s'" % (extension)) |
883 | 98 | elif args.display: | 98 | elif args.display: |
884 | 99 | from tempfile import NamedTemporaryFile | 99 | from tempfile import NamedTemporaryFile |
885 | 100 | from subprocess import call | 100 | from subprocess import call |
886 | @@ -104,6 +104,6 @@ if __name__ == '__main__': | |||
887 | 104 | call(["eog", tf.name]) | 104 | call(["eog", tf.name]) |
888 | 105 | remove(tf.name) | 105 | remove(tf.name) |
889 | 106 | else: | 106 | else: |
891 | 107 | print 'unknown output mode!' | 107 | print('unknown output mode!') |
892 | 108 | 108 | ||
893 | 109 | 109 |
LGTM