summaryrefslogtreecommitdiff
diff options
-rw-r--r--data/CMakeLists.txt1
-rw-r--r--data/compiz/CMakeLists.txt26
-rw-r--r--data/compiz/unity-lowgfx.ini53
-rw-r--r--data/compiz/unity.conf11
-rw-r--r--data/compiz/unity.ini2
-rw-r--r--data/compiz/upgrades/com.canonical.unity.unity-lowgfx.01.upgrade12
-rw-r--r--data/compiz/upgrades/com.canonical.unity.unity.01.upgrade5
-rw-r--r--data/compiz/upgrades/com.canonical.unity.unity.02.upgrade8
-rw-r--r--data/compiz/upgrades/com.canonical.unity.unity.03.upgrade2
-rw-r--r--data/compiz/upgrades/com.canonical.unity.unity.04.upgrade2
-rw-r--r--data/compiz/upgrades/com.canonical.unity.unity.05.upgrade3
-rw-r--r--data/compiz/upgrades/com.canonical.unity.unity.06.upgrade2
-rw-r--r--data/compiz/upgrades/com.canonical.unity.unity.07.upgrade2
-rw-r--r--debian/changelog42
-rw-r--r--debian/control27
-rwxr-xr-xdebian/rules4
-rw-r--r--debian/unity.install2
-rw-r--r--lockscreen/LockScreenController.cpp2
-rw-r--r--lockscreen/UserAuthenticator.h1
-rw-r--r--lockscreen/UserAuthenticatorPam.cpp30
-rw-r--r--lockscreen/UserAuthenticatorPam.h2
-rw-r--r--tests/autopilot/unity/emulators/X11.py3
-rw-r--r--tests/autopilot/unity/emulators/compiz.py2
-rw-r--r--tests/autopilot/unity/emulators/dash.py1
-rw-r--r--tests/autopilot/unity/emulators/hud.py5
-rw-r--r--tests/autopilot/unity/emulators/ibus.py3
-rw-r--r--tests/autopilot/unity/emulators/icons.py1
-rw-r--r--tests/autopilot/unity/emulators/launcher.py5
-rw-r--r--tests/autopilot/unity/emulators/panel.py5
-rw-r--r--tests/autopilot/unity/emulators/quicklist.py1
-rw-r--r--tests/autopilot/unity/emulators/screen.py1
-rw-r--r--tests/autopilot/unity/emulators/shortcut_hint.py1
-rw-r--r--tests/autopilot/unity/emulators/switcher.py3
-rw-r--r--tests/autopilot/unity/emulators/tooltip.py1
-rw-r--r--tests/autopilot/unity/emulators/unity.py1
-rw-r--r--tests/autopilot/unity/emulators/window_manager.py1
-rw-r--r--tests/autopilot/unity/emulators/workspace.py1
-rw-r--r--tests/autopilot/unity/tests/__init__.py1
-rw-r--r--tests/autopilot/unity/tests/launcher/test_capture.py1
-rw-r--r--tests/autopilot/unity/tests/launcher/test_icon_behavior.py1
-rw-r--r--tests/autopilot/unity/tests/launcher/test_keynav.py1
-rw-r--r--tests/autopilot/unity/tests/launcher/test_reveal.py1
-rw-r--r--tests/autopilot/unity/tests/launcher/test_scroll.py1
-rw-r--r--tests/autopilot/unity/tests/launcher/test_shortcut.py1
-rw-r--r--tests/autopilot/unity/tests/launcher/test_switcher.py1
-rw-r--r--tests/autopilot/unity/tests/launcher/test_visual.py1
-rw-r--r--tests/autopilot/unity/tests/test_command_lens.py1
-rw-r--r--tests/autopilot/unity/tests/test_dash.py9
-rw-r--r--tests/autopilot/unity/tests/test_gnome_key_grabber.py2
-rwxr-xr-xtests/autopilot/unity/tests/test_gobject_introspection.py1
-rw-r--r--tests/autopilot/unity/tests/test_home_lens.py1
-rw-r--r--tests/autopilot/unity/tests/test_hud.py5
-rw-r--r--tests/autopilot/unity/tests/test_ibus.py25
-rw-r--r--tests/autopilot/unity/tests/test_panel.py1
-rw-r--r--tests/autopilot/unity/tests/test_quicklist.py1
-rw-r--r--tests/autopilot/unity/tests/test_search.py1
-rw-r--r--tests/autopilot/unity/tests/test_shopping_lens.py7
-rw-r--r--tests/autopilot/unity/tests/test_shortcut_hint.py1
-rw-r--r--tests/autopilot/unity/tests/test_showdesktop.py1
-rw-r--r--tests/autopilot/unity/tests/test_spread.py1
-rw-r--r--tests/autopilot/unity/tests/test_switcher.py1
-rw-r--r--tests/autopilot/unity/tests/test_unity_logging.py2
-rw-r--r--tests/autopilot/unity/tests/test_wm_keybindings.py1
-rw-r--r--tests/autopilot/unity/tests/xim/test_gcin.py7
-rw-r--r--tests/test_launcher_hide_machine.cpp6
-rw-r--r--tests/test_launcher_hover_machine.cpp18
-rwxr-xr-xtools/makebootchart.py10
-rwxr-xr-xtools/unity-introspection-visualiser.py16
68 files changed, 281 insertions, 120 deletions
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
index adc5f9c61..4b8d7221c 100644
--- a/data/CMakeLists.txt
+++ b/data/CMakeLists.txt
@@ -1,3 +1,4 @@
+add_subdirectory(compiz)
add_subdirectory(pam)
# GSettings Schema
diff --git a/data/compiz/CMakeLists.txt b/data/compiz/CMakeLists.txt
new file mode 100644
index 000000000..c24e404e1
--- /dev/null
+++ b/data/compiz/CMakeLists.txt
@@ -0,0 +1,26 @@
+find_package (PkgConfig REQUIRED)
+
+pkg_check_modules (COMPIZCONFIG libcompizconfig)
+
+if (COMPIZCONFIG_FOUND)
+ pkg_get_variable (COMPIZCONFIG_CONFIG_DIR libcompizconfig configdir)
+ pkg_get_variable (COMPIZCONFIG_UPGRADES_DIR libcompizconfig upgradesdir)
+
+ set (config_files
+ unity.conf
+ unity.ini
+ unity-lowgfx.ini)
+
+ set (upgrade_files
+ upgrades/com.canonical.unity.unity.01.upgrade
+ upgrades/com.canonical.unity.unity.02.upgrade
+ upgrades/com.canonical.unity.unity.03.upgrade
+ upgrades/com.canonical.unity.unity.04.upgrade
+ upgrades/com.canonical.unity.unity.05.upgrade
+ upgrades/com.canonical.unity.unity.06.upgrade
+ upgrades/com.canonical.unity.unity.07.upgrade
+ upgrades/com.canonical.unity.unity-lowgfx.01.upgrade)
+
+ install (FILES ${config_files} DESTINATION ${COMPIZCONFIG_CONFIG_DIR})
+ install (FILES ${upgrade_files} DESTINATION ${COMPIZCONFIG_UPGRADES_DIR})
+endif ()
diff --git a/data/compiz/unity-lowgfx.ini b/data/compiz/unity-lowgfx.ini
new file mode 100644
index 000000000..e5e76a6dc
--- /dev/null
+++ b/data/compiz/unity-lowgfx.ini
@@ -0,0 +1,53 @@
+[core]
+s0_active_plugins = core;composite;opengl;copytex;compiztoolbox;vpswitch;snap;mousepoll;resize;place;move;wall;grid;regex;imgpng;session;fade;unitymtgrabhandles;workarounds;scale;expo;ezoom;unityshell
+
+[ezoom]
+s0_speed = 100
+
+[expo]
+s0_expo_animation = 3
+
+[fade]
+s0_fade_mode = 1
+s0_fade_time = 1
+
+[grid]
+s0_animation_duration = 0
+s0_draw_stretched_window = false
+
+[move]
+s0_mode = 2
+s0_lazy_positioning = true
+s0_increase_border_contrast = true
+
+[resize]
+s0_mode = 2
+s0_increase_border_contrast = true
+
+[opengl]
+s0_texture_filter = 0
+
+[scale]
+s0_skip_animation = true
+
+[unityshell]
+s0_dash_blur_experimental = 0
+
+s0_override_decoration_theme = true
+s0_shadow_x_offset = 1
+s0_shadow_y_offset = 1
+s0_active_shadow_radius = 3
+s0_inactive_shadow_radius = 2
+
+s0_menus_fadein = 0
+s0_menus_fadeout = 0
+s0_menus_discovery_fadein = 0
+s0_menus_discovery_fadeout = 0
+
+s0_autohide_animation = 1
+
+[wall]
+s0_slide_duration = 0
+
+[showdesktop]
+s0_skip_animation = true
diff --git a/data/compiz/unity.conf b/data/compiz/unity.conf
new file mode 100644
index 000000000..4594e2175
--- /dev/null
+++ b/data/compiz/unity.conf
@@ -0,0 +1,11 @@
+[general_ubuntu]
+backend = gsettings
+integration = true
+plugin_list_autosort = true
+profile = unity
+
+[general_ubuntu-lowgfx]
+backend = gsettings
+integration = true
+plugin_list_autosort = true
+profile = unity-lowgfx
diff --git a/data/compiz/unity.ini b/data/compiz/unity.ini
new file mode 100644
index 000000000..7591bcbb1
--- /dev/null
+++ b/data/compiz/unity.ini
@@ -0,0 +1,2 @@
+[core]
+s0_active_plugins = core;composite;opengl;copytex;compiztoolbox;vpswitch;snap;mousepoll;resize;place;move;wall;grid;regex;imgpng;session;animation;fade;unitymtgrabhandles;workarounds;scale;expo;ezoom;commands;unityshell
diff --git a/data/compiz/upgrades/com.canonical.unity.unity-lowgfx.01.upgrade b/data/compiz/upgrades/com.canonical.unity.unity-lowgfx.01.upgrade
new file mode 100644
index 000000000..288881f1c
--- /dev/null
+++ b/data/compiz/upgrades/com.canonical.unity.unity-lowgfx.01.upgrade
@@ -0,0 +1,12 @@
+[grid]
++s0_animation_duration = 0
++s0_draw_stretched_window = false
+
+[move]
++s0_mode = 2
++s0_increase_border_contrast = true
++s0_lazy_positioning = true
+
+[resize]
++s0_mode = 2
++s0_increase_border_contrast = true
diff --git a/data/compiz/upgrades/com.canonical.unity.unity.01.upgrade b/data/compiz/upgrades/com.canonical.unity.unity.01.upgrade
new file mode 100644
index 000000000..d7576b73d
--- /dev/null
+++ b/data/compiz/upgrades/com.canonical.unity.unity.01.upgrade
@@ -0,0 +1,5 @@
+[core]
+-s0_active_plugins = staticswitcher
+
+[unityshell]
++s0_alt_tab_timeout = true
diff --git a/data/compiz/upgrades/com.canonical.unity.unity.02.upgrade b/data/compiz/upgrades/com.canonical.unity.unity.02.upgrade
new file mode 100644
index 000000000..7034bce27
--- /dev/null
+++ b/data/compiz/upgrades/com.canonical.unity.unity.02.upgrade
@@ -0,0 +1,8 @@
+[expo]
++s0_distance = 0.005
++s0_vp_brightness = 40.0
++s0_vp_saturation = 40.0
++s0_vp_distance = 0.2
++s0_reflection = false
++s0_x_offset = 64
++s0_y_offset = 24
diff --git a/data/compiz/upgrades/com.canonical.unity.unity.03.upgrade b/data/compiz/upgrades/com.canonical.unity.unity.03.upgrade
new file mode 100644
index 000000000..06e0c2485
--- /dev/null
+++ b/data/compiz/upgrades/com.canonical.unity.unity.03.upgrade
@@ -0,0 +1,2 @@
+[core]
++s0_active_plugins = copytex
diff --git a/data/compiz/upgrades/com.canonical.unity.unity.04.upgrade b/data/compiz/upgrades/com.canonical.unity.unity.04.upgrade
new file mode 100644
index 000000000..9b39661f7
--- /dev/null
+++ b/data/compiz/upgrades/com.canonical.unity.unity.04.upgrade
@@ -0,0 +1,2 @@
+[core]
+-s0_active_plugins = decor
diff --git a/data/compiz/upgrades/com.canonical.unity.unity.05.upgrade b/data/compiz/upgrades/com.canonical.unity.unity.05.upgrade
new file mode 100644
index 000000000..e4d094d91
--- /dev/null
+++ b/data/compiz/upgrades/com.canonical.unity.unity.05.upgrade
@@ -0,0 +1,3 @@
+[scale]
++s0_speed = 5.0
++s0_spacing = 20
diff --git a/data/compiz/upgrades/com.canonical.unity.unity.06.upgrade b/data/compiz/upgrades/com.canonical.unity.unity.06.upgrade
new file mode 100644
index 000000000..859b21ad1
--- /dev/null
+++ b/data/compiz/upgrades/com.canonical.unity.unity.06.upgrade
@@ -0,0 +1,2 @@
+[core]
+-s0_active_plugins = scalefilter
diff --git a/data/compiz/upgrades/com.canonical.unity.unity.07.upgrade b/data/compiz/upgrades/com.canonical.unity.unity.07.upgrade
new file mode 100644
index 000000000..c8e9c9282
--- /dev/null
+++ b/data/compiz/upgrades/com.canonical.unity.unity.07.upgrade
@@ -0,0 +1,2 @@
+[core]
+-s0_active_plugins = gnomecompat
diff --git a/debian/changelog b/debian/changelog
index bfc0f2fe6..c30e50b5f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,44 @@
+unity (7.5.0+19.04.20190304-0ubuntu1) disco; urgency=medium
+
+ [ disco/unity: Failed to merge https://git.launchpad.net/unity. ]
+ * Add missing includes for build w/o pch
+
+ -- Marco Trevisan (Treviño) <mail@3v1n0.net> Mon, 04 Mar 2019 17:07:16 +0000
+
+unity (7.5.0+19.04.20190217-0ubuntu1) disco; urgency=medium
+
+ [ Andrea Azzarone ]
+ * locksreen: cancel authentication if externally unlocked (LP:
+ #1733557)
+
+ -- Dmitry Shachnev <mitya57@ubuntu.com> Sun, 17 Feb 2019 19:14:19 +0000
+
+unity (7.5.0+19.04.20190208-0ubuntu1) disco; urgency=medium
+
+ [ Alberts Muktupāvels ]
+ * Install compiz configuration files.
+
+ [ Khurshid Alam ]
+ * Recommend nemo for unity. (LP: #1814506)
+
+ -- Dmitry Shachnev <mitya57@ubuntu.com> Fri, 08 Feb 2019 11:46:59 +0000
+
+unity (7.5.0+19.04.20190103-0ubuntu1) disco; urgency=medium
+
+ [ Marco Trevisan (Treviño) ]
+ * debian/gbp.conf: add default settings to use gbp-buildpackage
+
+ [ Alberts Muktupāvels ]
+ * Port to Python 3. (LP: #1310794)
+
+ [ Dmitry Shachnev ]
+ * Use std::get instead of std::tr1::get for std::tuple.
+ * Build-depend on yaru-theme-icon to fix the test failure.
+
+ -- Dmitry Shachnev <mitya57@ubuntu.com> Thu, 03 Jan 2019 18:07:42 +0000
+
+<<<<<<<
+=======
unity (7.5.0+18.10.20180926.2-0ubuntu2) UNRELEASED; urgency=medium
[ Marco Trevisan (Treviño) ]
@@ -9,6 +50,7 @@ unity (7.5.0+18.10.20180926.2-0ubuntu2) UNRELEASED; urgency=medium
-- Marco Trevisan (Treviño) <marco@ubuntu.com> Sun, 04 Nov 2018 20:26:08 -0600
+>>>>>>>
unity (7.5.0+18.10.20180926.2-0ubuntu1) cosmic; urgency=medium
[ Alexander Hale ]
diff --git a/debian/control b/debian/control
index c3dc0cfc8..4d00e53d6 100644
--- a/debian/control
+++ b/debian/control
@@ -19,7 +19,7 @@ Build-Depends: cmake,
libbamf3-dev (>= 0.5.3~bzr0),
libboost-dev,
libcairo2-dev,
- libcompizconfig0-dev,
+ libcompizconfig0-dev (>= 1:0.9.13.1+19.04.20190208-0ubuntu1),
libdbus-1-dev,
libdbusmenu-glib-dev (>= 0.3.91),
libdee-dev (>= 1.2.6),
@@ -50,13 +50,13 @@ Build-Depends: cmake,
libxtst-dev,
libzeitgeist-2.0-dev,
pkg-config,
- python (>= 2.7),
- python3 (>= 3.4),
- python-setuptools,
+ python3-all (>= 3.4),
+ python3-setuptools,
quilt,
systemd,
xserver-xorg-video-dummy,
xsltproc,
+ yaru-theme-icon,
Standards-Version: 3.9.5
Homepage: https://launchpad.net/unity
# If you aren't a member of ~unity-team but need to upload packaging changes,
@@ -88,6 +88,7 @@ Depends: ${shlibs:Depends},
Recommends: unity-control-center,
${unity-default-masterscopes}
nautilus,
+ nemo,
gnome-disk-utility,
hud,
session-shortcuts,
@@ -97,6 +98,8 @@ Breaks: unity-lens-applications (<< 5.12.0-0ubuntu2),
unity-lens-music (<< 6.0.0),
unity-lens-video (<< 0.3.6-0ubuntu2),
ubuntu-session (<< 3.24.1-0ubuntu3~),
+ compiz-gnome (<< 1:0.9.13.1+19.04.20190208-0ubuntu1~),
+Replaces: compiz-gnome (<< 1:0.9.13.1+19.04.20190208-0ubuntu1~),
Description: Interface designed for efficiency of space and interaction.
Unity is a desktop experience that sings. Designed by Canonical and the Ayatana
community, Unity is all about the combination of familiarity and the future. We
@@ -194,19 +197,19 @@ Package: unity-autopilot
Section: python
Architecture: all
Depends: ${misc:Depends},
- ${python:Depends},
- autopilot-desktop-legacy,
- python-windowmocker,
+ ${python3:Depends},
+ autopilot-desktop,
+ python3-windowmocker,
gir1.2-appindicator3-0.1,
gir1.2-dee-1.0,
gir1.2-glib-2.0,
gir1.2-ibus-1.0,
gir1.2-unity-5.0,
- python-compizconfig,
- python-dbus,
- python-testtools,
- python-xdg,
- python-xlib,
+ python3-compizconfig,
+ python3-dbus,
+ python3-testtools,
+ python3-xdg,
+ python3-xlib,
libxpathselect1.4v5 (>= 1.4),
mesa-utils,
Description: Autopiloted tests for Unity
diff --git a/debian/rules b/debian/rules
index fea379dda..4b29c43fb 100755
--- a/debian/rules
+++ b/debian/rules
@@ -36,7 +36,7 @@ override_dh_auto_configure:
override_dh_install:
# install autopilot tests
cd tests/autopilot; \
- set -ex; for python in $(shell pyversions -r); do \
+ set -ex; for python in $(shell py3versions -r); do \
$$python setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb; \
done; \
cd $(CURDIR)
@@ -59,4 +59,4 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
endif
%:
- dh $@ --with translations,quilt,python2,python3,migrations --parallel
+ dh $@ --with translations,quilt,python3,migrations --parallel
diff --git a/debian/unity.install b/debian/unity.install
index 3469bef3d..b60c76294 100644
--- a/debian/unity.install
+++ b/debian/unity.install
@@ -1,3 +1,4 @@
+etc/compizconfig
etc/pam.d
usr/bin
usr/lib/*/compiz/libunity*.so
@@ -8,5 +9,6 @@ usr/lib/*/unity/*-prestart-check
usr/lib/systemd/user/unity7.service
usr/share/man/*/unity.1
usr/share/compiz
+usr/share/compizconfig
usr/share/locale
usr/share/upstart/systemd-session/upstart/unity7.override
diff --git a/lockscreen/LockScreenController.cpp b/lockscreen/LockScreenController.cpp
index 8f6e7bc9b..907a1308d 100644
--- a/lockscreen/LockScreenController.cpp
+++ b/lockscreen/LockScreenController.cpp
@@ -536,6 +536,8 @@ void Controller::OnUnlockRequested()
HideBlankWindow();
HideShields();
+
+ user_authenticator_->AuthenticateCancel();
}
void Controller::HideShields()
diff --git a/lockscreen/UserAuthenticator.h b/lockscreen/UserAuthenticator.h
index e30ce2fdb..60e868482 100644
--- a/lockscreen/UserAuthenticator.h
+++ b/lockscreen/UserAuthenticator.h
@@ -43,6 +43,7 @@ public:
// Authenticate the user in a background thread.
virtual bool AuthenticateStart(std::string const& username, AuthenticateEndCallback const&) = 0;
+ virtual void AuthenticateCancel() = 0;
sigc::signal<void> start_failed;
sigc::signal<void, std::string, PromiseAuthCodePtr const&> echo_on_requested;
diff --git a/lockscreen/UserAuthenticatorPam.cpp b/lockscreen/UserAuthenticatorPam.cpp
index 463d8f949..d1d6c271b 100644
--- a/lockscreen/UserAuthenticatorPam.cpp
+++ b/lockscreen/UserAuthenticatorPam.cpp
@@ -50,6 +50,7 @@ bool UserAuthenticatorPam::AuthenticateStart(std::string const& username,
}
first_prompt_ = true;
+ cancelled_ = false;
username_ = username;
authenticate_cb_ = authenticate_cb;
@@ -64,6 +65,18 @@ bool UserAuthenticatorPam::AuthenticateStart(std::string const& username,
return !error;
}
+void UserAuthenticatorPam::AuthenticateCancel()
+{
+ if (!pam_handle_)
+ {
+ LOG_DEBUG(logger) << "Unable to cancel authentication because none has been started";
+ return;
+ }
+
+ LOG_DEBUG(logger) << "Cancelling the authentication";
+ cancelled_ = true;
+}
+
gpointer UserAuthenticatorPam::AuthenticationThreadFunc(gpointer data)
{
auto self = static_cast<UserAuthenticatorPam*>(data);
@@ -92,7 +105,10 @@ gpointer UserAuthenticatorPam::AuthenticationThreadFunc(gpointer data)
pam_end(self->pam_handle_, self->status_);
self->pam_handle_ = nullptr;
- self->source_manager_.AddTimeout(0, [self] { self->authenticate_cb_(self->status_ == PAM_SUCCESS); return false; });
+
+ if (!self->cancelled_)
+ self->source_manager_.AddTimeout(0, [self] { self->authenticate_cb_(self->status_ == PAM_SUCCESS); return false; });
+
return nullptr;
}
@@ -188,9 +204,17 @@ int UserAuthenticatorPam::ConversationFunction(int num_msg,
auto future = promise->get_future();
pam_response* resp_item = &tmp_response[i++];
resp_item->resp_retcode = 0;
- resp_item->resp = strdup(future.get().c_str());
+ resp_item->resp = nullptr;
+
+ std::future_status status;
+ do
+ {
+ status = future.wait_for(std::chrono::seconds(1));
+ if (status == std::future_status::ready)
+ resp_item->resp = strdup(future.get().c_str());
+ } while (status != std::future_status::ready && !user_auth->cancelled_);
- if (!resp_item->resp)
+ if (!resp_item->resp || user_auth->cancelled_)
{
raise_error = true;
break;
diff --git a/lockscreen/UserAuthenticatorPam.h b/lockscreen/UserAuthenticatorPam.h
index 82273cd49..4043cd429 100644
--- a/lockscreen/UserAuthenticatorPam.h
+++ b/lockscreen/UserAuthenticatorPam.h
@@ -39,6 +39,7 @@ class UserAuthenticatorPam : public UserAuthenticator
public:
UserAuthenticatorPam() = default;
bool AuthenticateStart(std::string const& username, AuthenticateEndCallback const&) override;
+ void AuthenticateCancel() override;
private:
UserAuthenticatorPam(UserAuthenticatorPam const&) = delete;
@@ -57,6 +58,7 @@ private:
int status_ = 0;
bool first_prompt_ = true;
+ bool cancelled_ = false;
pam_handle* pam_handle_ = nullptr;
glib::SourceManager source_manager_;
};
diff --git a/tests/autopilot/unity/emulators/X11.py b/tests/autopilot/unity/emulators/X11.py
index 3bbf89d6e..a49efa7f1 100644
--- a/tests/autopilot/unity/emulators/X11.py
+++ b/tests/autopilot/unity/emulators/X11.py
@@ -1,4 +1,3 @@
-from __future__ import absolute_import
from autopilot.utilities import Silence
from autopilot.display import Display
@@ -90,7 +89,7 @@ def set_primary_monitor(monitor):
"""
try:
glxinfo_out = subprocess.check_output("glxinfo")
- except OSError, e:
+ except OSError as e:
raise OSError("Failed to run glxinfo: %s. (do you have mesa-utils installed?)" % e)
for dri in _blacklisted_drivers:
diff --git a/tests/autopilot/unity/emulators/compiz.py b/tests/autopilot/unity/emulators/compiz.py
index abdc98f45..4b7c37534 100644
--- a/tests/autopilot/unity/emulators/compiz.py
+++ b/tests/autopilot/unity/emulators/compiz.py
@@ -1,8 +1,6 @@
-from __future__ import absolute_import
"""Functions that wrap compizconfig to avoid some unpleasantness in that module."""
-from __future__ import absolute_import
from autopilot.utilities import Silence
diff --git a/tests/autopilot/unity/emulators/dash.py b/tests/autopilot/unity/emulators/dash.py
index 8511d64a9..e4fcfe351 100644
--- a/tests/autopilot/unity/emulators/dash.py
+++ b/tests/autopilot/unity/emulators/dash.py
@@ -7,7 +7,6 @@
# by the Free Software Foundation.
#
-from __future__ import absolute_import
from autopilot.input import Keyboard, Mouse
diff --git a/tests/autopilot/unity/emulators/hud.py b/tests/autopilot/unity/emulators/hud.py
index 81e184c35..fc24a055d 100644
--- a/tests/autopilot/unity/emulators/hud.py
+++ b/tests/autopilot/unity/emulators/hud.py
@@ -7,14 +7,13 @@
# by the Free Software Foundation.
#
-from __future__ import absolute_import
from logging import getLogger
from autopilot.input import Keyboard
from autopilot.introspection.dbus import StateNotFoundError
from autopilot.keybindings import KeybindingsHelper
-from HTMLParser import HTMLParser
+from html.parser import HTMLParser
import re
from unity.emulators import UnityIntrospectionObject
@@ -125,7 +124,7 @@ class HudController(UnityIntrospectionObject, KeybindingsHelper):
try:
if len(self.hud_buttons) is 0:
return 0
- [button] = filter(lambda x: x.focused, self.hud_buttons)
+ [button] = [x for x in self.hud_buttons if x.focused]
return button
except IndexError:
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 b21d99c9a..9ae4fbe40 100644
--- a/tests/autopilot/unity/emulators/ibus.py
+++ b/tests/autopilot/unity/emulators/ibus.py
@@ -20,7 +20,6 @@
"""Functions to deal with ibus service."""
-from __future__ import absolute_import
from gi.repository import IBus, GLib
import os
@@ -93,7 +92,7 @@ def set_active_engines(engine_list):
raise TypeError("engine_list must be a list of valid engine names.")
available_engines = get_available_input_engines()
for engine in engine_list:
- if not isinstance(engine, basestring):
+ if not isinstance(engine, str):
raise TypeError("Engines in engine_list must all be strings.")
if engine not in available_engines:
raise ValueError(
diff --git a/tests/autopilot/unity/emulators/icons.py b/tests/autopilot/unity/emulators/icons.py
index 8230194dc..15ac1713a 100644
--- a/tests/autopilot/unity/emulators/icons.py
+++ b/tests/autopilot/unity/emulators/icons.py
@@ -7,7 +7,6 @@
# by the Free Software Foundation.
#
-from __future__ import absolute_import
from unity.emulators import UnityIntrospectionObject
from unity.emulators.quicklist import Quicklist
diff --git a/tests/autopilot/unity/emulators/launcher.py b/tests/autopilot/unity/emulators/launcher.py
index f846f3c75..b95ec597e 100644
--- a/tests/autopilot/unity/emulators/launcher.py
+++ b/tests/autopilot/unity/emulators/launcher.py
@@ -7,7 +7,6 @@
# by the Free Software Foundation.
#
-from __future__ import absolute_import
from autopilot.input import Mouse
from autopilot.display import Display, move_mouse_to_screen
@@ -136,7 +135,7 @@ class Launcher(UnityIntrospectionObject, KeybindingsHelper):
found = False
# Only try 10 times (5 secs.) before giving up.
- for i in xrange(0, 10):
+ for i in range(0, 10):
mouse_x = target_x = icon.center.x
mouse_y = target_y = icon.center.y
if target_y > h + y:
@@ -225,7 +224,7 @@ class Launcher(UnityIntrospectionObject, KeybindingsHelper):
continue
logger.debug("Selected icon = %s", icon.tooltip_text)
matches = True
- for arg,val in kwargs.iteritems():
+ for arg,val in kwargs.items():
if not hasattr(icon, arg) or getattr(icon, arg, None) != val:
matches = False
break
diff --git a/tests/autopilot/unity/emulators/panel.py b/tests/autopilot/unity/emulators/panel.py
index 78b10859d..71502f138 100644
--- a/tests/autopilot/unity/emulators/panel.py
+++ b/tests/autopilot/unity/emulators/panel.py
@@ -7,7 +7,6 @@
# by the Free Software Foundation.
#
-from __future__ import absolute_import
import logging
from time import sleep
@@ -132,14 +131,14 @@ class UnityPanel(UnityIntrospectionObject, KeybindingsHelper):
def get_active_indicator(self):
"""Returns the indicator entry that is currently active"""
entries = self.get_indicator_entries(False, True)
- entries = filter(lambda e: e.active == True, entries)
+ entries = [e for e in entries if e.active == True]
assert(len(entries) <= 1)
return entries[0] if entries else None
def get_indicator_entry(self, entry_id):
"""Returns the indicator entry for the given ID or None"""
entries = self.get_indicator_entries(False, True)
- entries = filter(lambda e: e.entry_id == entry_id, entries)
+ entries = [e for e in entries if e.entry_id == entry_id]
assert(len(entries) <= 1)
return entries[0] if entries else None
diff --git a/tests/autopilot/unity/emulators/quicklist.py b/tests/autopilot/unity/emulators/quicklist.py
index 42601bd3d..bfb79385f 100644
--- a/tests/autopilot/unity/emulators/quicklist.py
+++ b/tests/autopilot/unity/emulators/quicklist.py
@@ -7,7 +7,6 @@
# by the Free Software Foundation.
#
-from __future__ import absolute_import
import logging
diff --git a/tests/autopilot/unity/emulators/screen.py b/tests/autopilot/unity/emulators/screen.py
index b9299a2b6..c570178b2 100644
--- a/tests/autopilot/unity/emulators/screen.py
+++ b/tests/autopilot/unity/emulators/screen.py
@@ -7,7 +7,6 @@
# by the Free Software Foundation.
#
-from __future__ import absolute_import
import logging
from unity.emulators import UnityIntrospectionObject
diff --git a/tests/autopilot/unity/emulators/shortcut_hint.py b/tests/autopilot/unity/emulators/shortcut_hint.py
index 279b4f108..8448308a8 100644
--- a/tests/autopilot/unity/emulators/shortcut_hint.py
+++ b/tests/autopilot/unity/emulators/shortcut_hint.py
@@ -7,7 +7,6 @@
# by the Free Software Foundation.
#
-from __future__ import absolute_import
import logging
diff --git a/tests/autopilot/unity/emulators/switcher.py b/tests/autopilot/unity/emulators/switcher.py
index 9bd9a256c..4b5df9bc1 100644
--- a/tests/autopilot/unity/emulators/switcher.py
+++ b/tests/autopilot/unity/emulators/switcher.py
@@ -7,7 +7,6 @@
# by the Free Software Foundation.
#
-from __future__ import absolute_import
import logging
@@ -152,7 +151,7 @@ class SwitcherController(UnityIntrospectionObject, KeybindingsHelper):
for i in self.model.icons:
current_icon = self.current_icon
passed=True
- for key,val in kwargs.iteritems():
+ for key,val in kwargs.items():
if not hasattr(current_icon, key) or getattr(current_icon, key) != val:
passed=False
if passed:
diff --git a/tests/autopilot/unity/emulators/tooltip.py b/tests/autopilot/unity/emulators/tooltip.py
index 17c3740a3..6ab4f393c 100644
--- a/tests/autopilot/unity/emulators/tooltip.py
+++ b/tests/autopilot/unity/emulators/tooltip.py
@@ -7,7 +7,6 @@
# by the Free Software Foundation.
#
-from __future__ import absolute_import
from unity.emulators import UnityIntrospectionObject
diff --git a/tests/autopilot/unity/emulators/unity.py b/tests/autopilot/unity/emulators/unity.py
index 22fdde19b..418ffa1c2 100644
--- a/tests/autopilot/unity/emulators/unity.py
+++ b/tests/autopilot/unity/emulators/unity.py
@@ -7,7 +7,6 @@
# by the Free Software Foundation.
#
-from __future__ import absolute_import
from dbus import Interface, SessionBus
diff --git a/tests/autopilot/unity/emulators/window_manager.py b/tests/autopilot/unity/emulators/window_manager.py
index d07fec8ed..527046b8b 100644
--- a/tests/autopilot/unity/emulators/window_manager.py
+++ b/tests/autopilot/unity/emulators/window_manager.py
@@ -7,7 +7,6 @@
# by the Free Software Foundation.
#
-from __future__ import absolute_import
import logging
from autopilot.introspection.types import Rectangle
diff --git a/tests/autopilot/unity/emulators/workspace.py b/tests/autopilot/unity/emulators/workspace.py
index a13972c1b..ce929cf3d 100644
--- a/tests/autopilot/unity/emulators/workspace.py
+++ b/tests/autopilot/unity/emulators/workspace.py
@@ -7,7 +7,6 @@
# by the Free Software Foundation.
#
-from __future__ import absolute_import
from autopilot.keybindings import KeybindingsHelper
from autopilot.display import Display
diff --git a/tests/autopilot/unity/tests/__init__.py b/tests/autopilot/unity/tests/__init__.py
index da114f955..4c62c0968 100644
--- a/tests/autopilot/unity/tests/__init__.py
+++ b/tests/autopilot/unity/tests/__init__.py
@@ -8,7 +8,6 @@
"""Autopilot test case class for Unity-specific tests."""
-from __future__ import absolute_import
from codecs import open
diff --git a/tests/autopilot/unity/tests/launcher/test_capture.py b/tests/autopilot/unity/tests/launcher/test_capture.py
index 24da2a746..28d59c348 100644
--- a/tests/autopilot/unity/tests/launcher/test_capture.py
+++ b/tests/autopilot/unity/tests/launcher/test_capture.py
@@ -7,7 +7,6 @@
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-from __future__ import absolute_import
from autopilot.matchers import Eventually
import logging
diff --git a/tests/autopilot/unity/tests/launcher/test_icon_behavior.py b/tests/autopilot/unity/tests/launcher/test_icon_behavior.py
index b51267dee..f8876ba43 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 @@
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-from __future__ import absolute_import
from autopilot.matchers import Eventually
from 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 85b2baded..57a9ccc1a 100644
--- a/tests/autopilot/unity/tests/launcher/test_keynav.py
+++ b/tests/autopilot/unity/tests/launcher/test_keynav.py
@@ -7,7 +7,6 @@
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-from __future__ import absolute_import
from autopilot.matchers import Eventually
import logging
diff --git a/tests/autopilot/unity/tests/launcher/test_reveal.py b/tests/autopilot/unity/tests/launcher/test_reveal.py
index 7d57f12b2..2bc6d22ee 100644
--- a/tests/autopilot/unity/tests/launcher/test_reveal.py
+++ b/tests/autopilot/unity/tests/launcher/test_reveal.py
@@ -7,7 +7,6 @@
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-from __future__ import absolute_import
from autopilot.display import move_mouse_to_screen
from 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 5e500c765..8dcac1954 100644
--- a/tests/autopilot/unity/tests/launcher/test_scroll.py
+++ b/tests/autopilot/unity/tests/launcher/test_scroll.py
@@ -6,7 +6,6 @@
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-from __future__ import absolute_import
from autopilot.matchers import Eventually
import logging
diff --git a/tests/autopilot/unity/tests/launcher/test_shortcut.py b/tests/autopilot/unity/tests/launcher/test_shortcut.py
index 28d661395..9aafc4f62 100644
--- a/tests/autopilot/unity/tests/launcher/test_shortcut.py
+++ b/tests/autopilot/unity/tests/launcher/test_shortcut.py
@@ -7,7 +7,6 @@
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-from __future__ import absolute_import
from autopilot.matchers import Eventually
import logging
diff --git a/tests/autopilot/unity/tests/launcher/test_switcher.py b/tests/autopilot/unity/tests/launcher/test_switcher.py
index 657cc2357..833c03edd 100644
--- a/tests/autopilot/unity/tests/launcher/test_switcher.py
+++ b/tests/autopilot/unity/tests/launcher/test_switcher.py
@@ -7,7 +7,6 @@
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-from __future__ import absolute_import
from autopilot.matchers import Eventually
diff --git a/tests/autopilot/unity/tests/launcher/test_visual.py b/tests/autopilot/unity/tests/launcher/test_visual.py
index c44e9237d..262a2cb72 100644
--- a/tests/autopilot/unity/tests/launcher/test_visual.py
+++ b/tests/autopilot/unity/tests/launcher/test_visual.py
@@ -7,7 +7,6 @@
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-from __future__ import absolute_import
from autopilot.matchers import Eventually
import logging
diff --git a/tests/autopilot/unity/tests/test_command_lens.py b/tests/autopilot/unity/tests/test_command_lens.py
index acafc4983..4076c01e9 100644
--- a/tests/autopilot/unity/tests/test_command_lens.py
+++ b/tests/autopilot/unity/tests/test_command_lens.py
@@ -6,7 +6,6 @@
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-from __future__ import absolute_import
from autopilot.matchers import Eventually
from 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 8f4943abc..c7b2106f6 100644
--- a/tests/autopilot/unity/tests/test_dash.py
+++ b/tests/autopilot/unity/tests/test_dash.py
@@ -6,7 +6,6 @@
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-from __future__ import absolute_import
from autopilot.clipboard import get_clipboard_contents
from autopilot.display import move_mouse_to_screen
@@ -266,14 +265,14 @@ class DashMultiKeyTests(DashSearchInputTests):
self.unity.dash.reveal_application_scope()
self.keyboard.press_and_release('Multi_key')
self.keyboard.type("^o")
- self.assertSearchText(u'\xf4')
+ self.assertSearchText('\xf4')
def test_multi_key_copyright(self):
"""Pressing the sequences 'Multi_key' + 'c' + 'o' must produce '©'."""
self.unity.dash.reveal_application_scope()
self.keyboard.press_and_release('Multi_key')
self.keyboard.type("oc")
- self.assertSearchText(u'\xa9')
+ self.assertSearchText('\xa9')
def test_multi_key_delete(self):
"""Pressing 'Multi_key' must not get stuck looking for a sequence."""
@@ -382,7 +381,7 @@ class DashKeyNavTests(DashTestCase):
self.keyboard.release('Control')
scopebar = self.unity.dash.view.get_scopebar()
- self.assertEqual(scopebar.active_scope, u'applications.scope')
+ self.assertEqual(scopebar.active_scope, 'applications.scope')
self.keyboard.press('Control')
self.keyboard.press('Shift')
@@ -722,7 +721,7 @@ class DashScopeBarTests(DashTestCase):
"""Scope selection should work when clicking in
the rectangle outside of the icon.
"""
- app_icon = self.scopebar.get_icon_by_name(u'applications.scope')
+ app_icon = self.scopebar.get_icon_by_name('applications.scope')
self.mouse.click_object(app_icon)
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 d7c49f60d..e0767b113 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):
self.check_accelerator(accelerator)
def test_grab_same_accelerator(self):
- accelerators = [Accelerator('<Shift><Control><Alt>b', 'Shift+Control+Alt+b') for i in xrange(3)]
+ accelerators = [Accelerator('<Shift><Control><Alt>b', 'Shift+Control+Alt+b') for i in range(3)]
actions = self.interface.GrabAccelerators([(accelerator.accelerator, 0) for accelerator in accelerators])
self.activatable.clear()
diff --git a/tests/autopilot/unity/tests/test_gobject_introspection.py b/tests/autopilot/unity/tests/test_gobject_introspection.py
index 58a0c38ea..d1a7573a7 100755
--- a/tests/autopilot/unity/tests/test_gobject_introspection.py
+++ b/tests/autopilot/unity/tests/test_gobject_introspection.py
@@ -6,7 +6,6 @@
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-from __future__ import absolute_import
from testtools import TestCase
diff --git a/tests/autopilot/unity/tests/test_home_lens.py b/tests/autopilot/unity/tests/test_home_lens.py
index 4094d8487..f88066658 100644
--- a/tests/autopilot/unity/tests/test_home_lens.py
+++ b/tests/autopilot/unity/tests/test_home_lens.py
@@ -6,7 +6,6 @@
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-from __future__ import absolute_import
from autopilot.matchers import Eventually
from testtools.matchers import Equals
diff --git a/tests/autopilot/unity/tests/test_hud.py b/tests/autopilot/unity/tests/test_hud.py
index 310ceb17f..719c7fd80 100644
--- a/tests/autopilot/unity/tests/test_hud.py
+++ b/tests/autopilot/unity/tests/test_hud.py
@@ -7,7 +7,6 @@
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-from __future__ import absolute_import
from autopilot.matchers import Eventually
from autopilot.display import Display, move_mouse_to_screen, is_rect_on_screen
@@ -230,7 +229,7 @@ class HudBehaviorTests(HudTestsBase):
self.keyboard.type("save")
- self.hud_query_check(u'Save\u2002(File)')
+ self.hud_query_check('Save\u2002(File)')
self.keyboard.press_and_release('Return')
self.addCleanup(self.keyboard.press_and_release, "Ctrl+s")
@@ -338,7 +337,7 @@ class HudBehaviorTests(HudTestsBase):
self.keyboard.type("Quit")
self.assertThat(self.unity.hud.search_string, Eventually(Equals("Quit")))
- self.hud_query_check(u'Quit\u2002(File)')
+ self.hud_query_check('Quit\u2002(File)')
self.keyboard.press_and_release("Enter")
diff --git a/tests/autopilot/unity/tests/test_ibus.py b/tests/autopilot/unity/tests/test_ibus.py
index 580e5b87f..5173dd7d6 100644
--- a/tests/autopilot/unity/tests/test_ibus.py
+++ b/tests/autopilot/unity/tests/test_ibus.py
@@ -8,7 +8,6 @@
"""Tests to ensure unity is compatible with ibus input method."""
-from __future__ import absolute_import
from unity.emulators.ibus import (
get_active_input_engines,
@@ -85,7 +84,7 @@ class IBusQuery:
timeout.start()
while self._context.get_engine() is None:
if self._abort is True:
- print "Error! Could not set the engine correctly."
+ print ("Error! Could not set the engine correctly.")
return None
continue
timeout.cancel()
@@ -99,7 +98,7 @@ class IBusQuery:
GLib.timeout_add_seconds(5, lambda *args: self._glibloop.quit())
self._glibloop.run()
- return unicode(self.result, "UTF-8")
+ return str(self.result, "UTF-8")
@@ -240,10 +239,10 @@ class IBusTestsPinyin(IBusWidgetScenariodTests):
scenarios = multiply_scenarios(
IBusWidgetScenariodTests.scenarios,
[
- ('photo', {'input': 'zhaopian ', 'result' : u'\u7167\u7247' }),
- ('internet', {'input': 'hulianwang ', 'result' : u'\u4e92\u8054\u7f51'}),
- ('hello', {'input': 'ninhao ', 'result' : u'\u60a8\u597d' }),
- ('management', {'input': 'guanli ', 'result' : u'\u7ba1\u7406' }),
+ ('photo', {'input': 'zhaopian ', 'result' : '\u7167\u7247' }),
+ ('internet', {'input': 'hulianwang ', 'result' : '\u4e92\u8054\u7f51'}),
+ ('hello', {'input': 'ninhao ', 'result' : '\u60a8\u597d' }),
+ ('management', {'input': 'guanli ', 'result' : '\u7ba1\u7406' }),
]
)
@@ -263,9 +262,9 @@ class IBusTestsHangul(IBusWidgetScenariodTests):
scenarios = multiply_scenarios(
IBusWidgetScenariodTests.scenarios,
[
- ('transmission', {'input': 'xmfostmaltus ', 'result': u'\ud2b8\ub79c\uc2a4\ubbf8\uc158 '}),
- ('social', {'input': 'httuf ', 'result': u'\uc18c\uc15c '}),
- ('document', {'input': 'anstj ', 'result': u'\ubb38\uc11c '}),
+ ('transmission', {'input': 'xmfostmaltus ', 'result': '\ud2b8\ub79c\uc2a4\ubbf8\uc158 '}),
+ ('social', {'input': 'httuf ', 'result': '\uc18c\uc15c '}),
+ ('document', {'input': 'anstj ', 'result': '\ubb38\uc11c '}),
]
)
@@ -285,9 +284,9 @@ class IBusTestsAnthy(IBusWidgetScenariodTests):
scenarios = multiply_scenarios(
IBusWidgetScenariodTests.scenarios,
[
- ('system', {'input': 'shisutemu ', 'result' : u'\u30b7\u30b9\u30c6\u30e0' }),
- ('game', {'input': 'ge-mu ', 'result' : u'\u30b2\u30fc\u30e0' }),
- ('user', {'input': 'yu-za- ', 'result' : u'\u30e6\u30fc\u30b6\u30fc' }),
+ ('system', {'input': 'shisutemu ', 'result' : '\u30b7\u30b9\u30c6\u30e0' }),
+ ('game', {'input': 'ge-mu ', 'result' : '\u30b2\u30fc\u30e0' }),
+ ('user', {'input': 'yu-za- ', 'result' : '\u30e6\u30fc\u30b6\u30fc' }),
],
[
('commit_enter', {'commit_key': 'Enter'}),
diff --git a/tests/autopilot/unity/tests/test_panel.py b/tests/autopilot/unity/tests/test_panel.py
index 634fd9347..d2119ab24 100644
--- a/tests/autopilot/unity/tests/test_panel.py
+++ b/tests/autopilot/unity/tests/test_panel.py
@@ -6,7 +6,6 @@
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-from __future__ import absolute_import
from autopilot.display import Display
#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 a6a197196..32c356674 100644
--- a/tests/autopilot/unity/tests/test_quicklist.py
+++ b/tests/autopilot/unity/tests/test_quicklist.py
@@ -7,7 +7,6 @@
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-from __future__ import absolute_import
from autopilot.display import move_mouse_to_screen
from autopilot.matchers import Eventually
diff --git a/tests/autopilot/unity/tests/test_search.py b/tests/autopilot/unity/tests/test_search.py
index 87d038bc0..d7297b147 100644
--- a/tests/autopilot/unity/tests/test_search.py
+++ b/tests/autopilot/unity/tests/test_search.py
@@ -6,7 +6,6 @@
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-from __future__ import absolute_import
from autopilot.matchers import Eventually
from testtools.matchers import (
diff --git a/tests/autopilot/unity/tests/test_shopping_lens.py b/tests/autopilot/unity/tests/test_shopping_lens.py
index 94a435dbc..8f7bcb1a3 100644
--- a/tests/autopilot/unity/tests/test_shopping_lens.py
+++ b/tests/autopilot/unity/tests/test_shopping_lens.py
@@ -6,12 +6,11 @@
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-from __future__ import absolute_import
from autopilot.matchers import Eventually
from testtools.matchers import Equals, GreaterThan
from time import sleep
-import urllib2
+import urllib.request, urllib.error, urllib.parse
import gettext
from unity.tests import UnityTestCase
@@ -23,8 +22,8 @@ class ShoppingScopeTests(UnityTestCase):
def setUp(self):
super(ShoppingScopeTests, self).setUp()
try:
- urllib2.urlopen("http://www.google.com", timeout=2)
- except urllib2.URLError, e:
+ urllib.request.urlopen("http://www.google.com", timeout=2)
+ except urllib.error.URLError as e:
self.skip("Skipping test, no internet connection")
gettext.install("unity-scope-shopping")
diff --git a/tests/autopilot/unity/tests/test_shortcut_hint.py b/tests/autopilot/unity/tests/test_shortcut_hint.py
index 0320516a7..899c77ada 100644
--- a/tests/autopilot/unity/tests/test_shortcut_hint.py
+++ b/tests/autopilot/unity/tests/test_shortcut_hint.py
@@ -6,7 +6,6 @@
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-from __future__ import absolute_import
from autopilot.matchers import Eventually
from testtools.matchers import Equals
diff --git a/tests/autopilot/unity/tests/test_showdesktop.py b/tests/autopilot/unity/tests/test_showdesktop.py
index 546b716f2..ce00894e4 100644
--- a/tests/autopilot/unity/tests/test_showdesktop.py
+++ b/tests/autopilot/unity/tests/test_showdesktop.py
@@ -6,7 +6,6 @@
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-from __future__ import absolute_import
from autopilot.matchers import Eventually
from testtools.matchers import Equals
diff --git a/tests/autopilot/unity/tests/test_spread.py b/tests/autopilot/unity/tests/test_spread.py
index 0cc91a10e..961ac1e79 100644
--- a/tests/autopilot/unity/tests/test_spread.py
+++ b/tests/autopilot/unity/tests/test_spread.py
@@ -6,7 +6,6 @@
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-from __future__ import absolute_import
from autopilot.display import Display
from autopilot.matchers import Eventually
diff --git a/tests/autopilot/unity/tests/test_switcher.py b/tests/autopilot/unity/tests/test_switcher.py
index d302db10f..38d7985c4 100644
--- a/tests/autopilot/unity/tests/test_switcher.py
+++ b/tests/autopilot/unity/tests/test_switcher.py
@@ -6,7 +6,6 @@
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-from __future__ import absolute_import
from autopilot.display import move_mouse_to_screen
from 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 0aa88440a..4b106b744 100644
--- a/tests/autopilot/unity/tests/test_unity_logging.py
+++ b/tests/autopilot/unity/tests/test_unity_logging.py
@@ -6,8 +6,6 @@
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-from __future__ import absolute_import
-
from os import remove
from os.path import exists
from tempfile import mktemp
diff --git a/tests/autopilot/unity/tests/test_wm_keybindings.py b/tests/autopilot/unity/tests/test_wm_keybindings.py
index fe5418d6a..89390bb40 100644
--- a/tests/autopilot/unity/tests/test_wm_keybindings.py
+++ b/tests/autopilot/unity/tests/test_wm_keybindings.py
@@ -6,7 +6,6 @@
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-from __future__ import absolute_import
from autopilot.matchers import Eventually
from 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 81420cd86..7f0cda1b8 100644
--- a/tests/autopilot/unity/tests/xim/test_gcin.py
+++ b/tests/autopilot/unity/tests/xim/test_gcin.py
@@ -6,7 +6,6 @@
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
-from __future__ import absolute_import
from autopilot.matchers import Eventually
from os import environ
@@ -34,9 +33,9 @@ class GcinTestHangul(GcinTestCase):
"""Tests the Dash and Hud with gcin in hangul mode."""
scenarios = [
- ('hangul', {'input': 'han geul ', 'result': u'\ud55c\uae00'}),
- ('morning letters', {'input': 'a chimgeul ', 'result': u'\uc544\uce68\uae00'}),
- ('national script', {'input': 'gug mun ', 'result': u'\uad6d\ubb38'}),
+ ('hangul', {'input': 'han geul ', 'result': '\ud55c\uae00'}),
+ ('morning letters', {'input': 'a chimgeul ', 'result': '\uc544\uce68\uae00'}),
+ ('national script', {'input': 'gug mun ', 'result': '\uad6d\ubb38'}),
]
def setUp(self):
diff --git a/tests/test_launcher_hide_machine.cpp b/tests/test_launcher_hide_machine.cpp
index 41adc7b66..47a7c66a5 100644
--- a/tests/test_launcher_hide_machine.cpp
+++ b/tests/test_launcher_hide_machine.cpp
@@ -52,9 +52,9 @@ struct HideModeNever : public TestWithParam<std::tuple<ul::LauncherHideMachine::
#pragma GCC diagnostic ignored "-Wunused-variable"
TEST_P(HideModeNever, Bool2Bool) {
- auto quirk = std::tr1::get<0>(GetParam());
- bool initial_value = std::tr1::get<1>(GetParam());
- bool final_value = std::tr1::get<2>(GetParam());
+ auto quirk = std::get<0>(GetParam());
+ bool initial_value = std::get<1>(GetParam());
+ bool final_value = std::get<2>(GetParam());
machine.SetMode(ul::LauncherHideMachine::HIDE_NEVER);
machine.SetQuirk(quirk, initial_value);
diff --git a/tests/test_launcher_hover_machine.cpp b/tests/test_launcher_hover_machine.cpp
index fb3939e3e..94843008d 100644
--- a/tests/test_launcher_hover_machine.cpp
+++ b/tests/test_launcher_hover_machine.cpp
@@ -40,9 +40,9 @@ struct SingleQuirk : public TestWithParam<std::tuple<unity::LauncherHoverMachine
};
TEST_P(SingleQuirk, Bool2Bool) {
- auto quirk = std::tr1::get<0>(GetParam());
- bool initial_value = std::tr1::get<1>(GetParam());
- bool final_value = std::tr1::get<2>(GetParam());
+ auto quirk = std::get<0>(GetParam());
+ bool initial_value = std::get<1>(GetParam());
+ bool final_value = std::get<2>(GetParam());
machine.SetQuirk(quirk, initial_value);
Utils::WaitForTimeoutMSec(20); // ignore the first signal
@@ -79,16 +79,16 @@ struct MultipleQuirks : public TestWithParam<std::tuple<unity::LauncherHoverMach
};
TEST_P(MultipleQuirks, DoubleBool2Bool) {
- auto quirk1 = std::tr1::get<0>(GetParam());
- auto quirk2 = std::tr1::get<3>(GetParam());
+ auto quirk1 = std::get<0>(GetParam());
+ auto quirk2 = std::get<3>(GetParam());
if (quirk1 == quirk2)
return;
- bool initial_value1 = std::tr1::get<1>(GetParam());
- bool final_value1 = std::tr1::get<2>(GetParam());
- bool initial_value2 = std::tr1::get<4>(GetParam());
- bool final_value2 = std::tr1::get<5>(GetParam());
+ bool initial_value1 = std::get<1>(GetParam());
+ bool final_value1 = std::get<2>(GetParam());
+ bool initial_value2 = std::get<4>(GetParam());
+ bool final_value2 = std::get<5>(GetParam());
machine.SetQuirk(quirk1, initial_value1);
machine.SetQuirk(quirk2, initial_value2);
diff --git a/tools/makebootchart.py b/tools/makebootchart.py
index 891549470..15e941aee 100755
--- a/tools/makebootchart.py
+++ b/tools/makebootchart.py
@@ -76,7 +76,7 @@ def draw_bg_graph (ctx, seconds, height):
ctx.stroke ()
per_ten = 0
- for pos in xrange (0, int(total_width), int (0.01 * width_multiplier)):
+ for pos in range (0, int(total_width), int (0.01 * width_multiplier)):
ctx.set_line_width (1)
ctx.set_source_rgba (0.0, 0.0, 0.0, 0.10)
@@ -156,7 +156,7 @@ def build_graph (data, filename, info):
def build_data_structure (input):
reader = csv.reader(open(input))
structure = []
- print "reading", input
+ print("reading", input)
for row in reader:
name = row[0]
start = float(row[1])
@@ -168,15 +168,15 @@ def build_data_structure (input):
def usage():
- print "use --input=filename.log and --output=filename.svg :)"
+ print("use --input=filename.log and --output=filename.svg :)")
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "h", ["help", "output=", "input="])
- except getopt.GetoptError, err:
+ except getopt.GetoptError as err:
# print help information and exit:
- print str(err) # will print something like "option -a not recognized"
+ print(str(err)) # will print something like "option -a not recognized"
usage()
sys.exit(2)
diff --git a/tools/unity-introspection-visualiser.py b/tools/unity-introspection-visualiser.py
index c56b241fb..a30c67e25 100755
--- a/tools/unity-introspection-visualiser.py
+++ b/tools/unity-introspection-visualiser.py
@@ -9,16 +9,16 @@ import dbus
try:
from autopilot.emulators.unity import get_state_by_path
-except ImportError, e:
- print "Error: could not import the autopilot python module."
- print "Make sure the autopilot module is in your $PYTHONPATH."
+except ImportError as e:
+ print("Error: could not import the autopilot python module.")
+ print("Make sure the autopilot module is in your $PYTHONPATH.")
exit(1)
try:
import pydot
except ImportError:
- print "Error: the 'pydot' module is required to run this script."
- print "Try installing the 'python-pydot' package."
+ print("Error: the 'pydot' module is required to run this script.")
+ print("Try installing the 'python3-pydot' package.")
exit(1)
NEXT_NODE_ID=1
@@ -53,7 +53,7 @@ def traverse_tree(state, parent, graph):
bits = ["%s=%s" % (k, string_rep(state[k])) for k in sorted(state.keys()) if k != 'Children']
lbl += "\l".join(bits)
parent.set_label(escape('"{' + lbl + '}"'))
- if state.has_key('Children'):
+ if 'Children' in state:
# Add all array nodes as children of this node.
for child_name, child_state in state['Children']:
if child_name in NODE_BLACKLIST:
@@ -94,7 +94,7 @@ if __name__ == '__main__':
if hasattr(graph, write_method_name):
getattr(graph, write_method_name)(args.output[0])
else:
- print "Error: unsupported format: '%s'" % (extension)
+ print("Error: unsupported format: '%s'" % (extension))
elif args.display:
from tempfile import NamedTemporaryFile
from subprocess import call
@@ -104,6 +104,6 @@ if __name__ == '__main__':
call(["eog", tf.name])
remove(tf.name)
else:
- print 'unknown output mode!'
+ print('unknown output mode!')