plainbox:secure:plugins: add now()

This patch adds a function ``now()`` suitable for short-term relative
time measurement (benchmarks). It is implemented differently, depending
on the version of python used, either with time.perf_counter()
or time.clock().

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:secure:plugins: add IPlugIn.plugin_{load,wrap}_time properties

This patch adds two new properties to the IPlugIn interface, that can be
used to inspect the overhead incurred by loading and wrapping
(processing) a given plugin (loadable entity).

In addition, both properties are implemented on all the concrete
sub-classes of the interface, namely the PlugIn, UnitPlugIn,
WhiteListPlugIn and Provider1PlugIn classes.

Since the load time is external (i.e. the collection loads the plugin,
not the plugin itself) all IPlugIn sub-classes gained a new, mandatory
argument to __init__(), which holds the load time. Subsequently all of
the collection classes FsPlugInCollection and
PkgResourcePlugInCollection were patched to measure that time and pass
it along.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:secure:plugins: add IPlugInCollection.{discovery_time,get_total_time}

This patch adds one property and one method on the plug-in collection
interface.

The discovery_time property describes the amount of time that was spent
while the collection was looking for plugins. This typically reflects
file system traversal and filtering time.

The get_total_time() method aggregates discovery time with load and wrap
time of each plugin to give the total cost of using a given collection.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:secure:plugins: fix typo

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
checkbox-touch: add error dialog

This patch introduces error-popup that might be used to signal errors from
within the app.
checkbox-touch: make use of error popup in main.qml

This patch makes CBT show popup when pyotherside encounters error and
when test plan is missing.
support: don't use PPAs on newer Ubuntu releases

This patch adds a new variable NEEDS_PPAS that controls if we should try
to enable PPAs before we try to install packages. It's not perfect (not
granular) but it's good enough for this case and is rather simple to
implement.

In addition, mark 15.04 as supported.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:color: add get_color_for_tty()

This patch adds an utility function for obtaining either ansi_on
or ansi_off color set that is applicable to a given stream (stdout by
default).

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:command: make Colorizer smarter by interpreting color as policy

If the Colorizer is initialized with True, it will always use colors.
If the Colorizer is initialized with False, it will never use colors.
If the Colorizer is initialized with None, it will use colors if sys.stdout
is a TTY. Otherwise, it will use whatever was passed as argument (keeping
compatibility with current APIs)

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox: move Colorizer from impl.commands.inv_run to impl.color

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:commands:run: implement --no-color as policy

This patch changes how cmd_run and inv_run cooperate in setting up the
colorizer. Before, we would do some poking and interpret it as ansi_on
or ansi_off. Now we simply pass a tri-state (True, False, None) which
is understood by the Colorizer.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:exporter:text: make the test exporter more friendly

This patch changes the text exporter to behave better in practice, when
someone uses plainbox run without specifying any additional options. The
output is colorized (if applicable), and uses pretty, readable format
somewhat similar to more polished unit test runners.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
"automatic merge of lp:~zkrynicki/checkbox/less-ppas/ by tarmac [r=roadmr][bug=][author=zkrynicki]"
"automatic merge of lp:~zkrynicki/checkbox/prettier-text-exporter/ by tarmac [r=roadmr][bug=][author=zkrynicki]"
checkbox-touch:components: Fix margins for all Buttons

units.gu(2) -> units.gu(3)
"automatic merge of lp:~zkrynicki/checkbox/plugin-timings/ by tarmac [r=sylvain-pineau][bug=][author=zkrynicki]"
checkbox-touch:components: Use LatchButton for the first screens

As loading providers with hundreds of jobs takes time, using this control
avoids the user to skip selection screens.
plainbox:impl:session optimize creating session dump

This patch optimizes how we create session repr. Complexity should go to
n*log(n) from n^2.

Fixes: https://bugs.launchpad.net/checkbox-touch/+bug/1392129
Signed-off-by: Maciej Kisielewski <maciej.kisielewski@canonical.com>
"automatic merge of lp:~kissiel/checkbox/fix-1392129/ by tarmac [r=sylvain-pineau][bug=1392129][author=kissiel]"
"automatic merge of lp:~sylvain-pineau/checkbox/latch_buttons_first_screens/ by tarmac [r=kissiel][bug=][author=sylvain-pineau]"