plainbox:setup.py: make lxml dependency optional

This patch makes lxml dependency optional by removing it from
install_requires= section in setup.py
and also by marking the affected xml/html exporters as an optional
add-on via the extras_require=
mechanis.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:color: add windows support via colorama

This patch adds rough support for Windows via colorama. If colorama is
installed then it is used
to translate ANSI color sequences to appropriate windows console
commands. If colorama is not
available then windows just gets no color support at all.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:logging: rename error.log to problem.log and include warnings

This patch makes the error log file somewhat more useful by also
including warnings in it.
Often (porting to windows now) some problems are only showing up as
warnings but are
a sign of a bigger issue. It is useful to collect those.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:ctrl: make POSIX-specific imports optional

This patch makes plainbox.impl.ctrl importable on windows that lacks
the posix and grp modules.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:runner: add hacky windows support

This patch adds a pretty hacky windows support. It should be cleaned up
once all the execution controllers come from the device object and never
have to be guessed by all the code around.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:session:state: add hacky windows support

This patch adds a pretty hacky windows support (something that can be
fixed by extending
the local device code but that is currently incomplete) by making sure
we don't return
any of the POSIX-specific execution controllers.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:session:storage: add windows support

This patch extends the generic save/load methods to handle
windows on python3.3 or newer. Windows-specific code is similar to the existing python3.2
code (where we don't use the *at() family of functions) with the notable
difference of using binary mode and using os.replace() instead of os.rename() which
annoyingly enough doesn't allow us to replace an existing file (but os.replace() does)

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:session:storage: improve save/load code

This patch applies some improvements made in the Windows-specific
version of the code to Unix variants of those methods.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:commands:run: allow SessionPeekHelper.peek() to fail

This patch fixes a possible crash in 'plainbox run' that might happen
if the session data is corrupted in a way that would cause problems for
the peek machinery. This can happen if the gzip stream is damaged, for example.

Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>