plainbox:session: respect PLAINBOX_SESSION_REPOSITORY

This patch changes SessionStorageRepository.get_default_location() to be
a more flexible and reliable.

First of all, it now respects the new environment variable,
PLAINBOX_SESSION_REPOSITORY. This variable overrides the default
location of $XDG_CACHE_HOME/plainbox/sessions.

The effective repository location is sanitized so that pointing it to a
file or to a read-only location won't be a fatal problem anymore.
Instead a sensible error message is logged and a emergency, temporary,
session repository is created.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:session: look for non-hidden .session directories

This patch changes how plainbox discovers and enumerates sessions.
Previously any directory would be a "session" that would be inspected.
With this change only non-hidden directories that end with '.session'
are considered. This makes it friendlier to work with when storing
sessions in a different location, such as the regressions repository.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
plainbox:i18n: fix non-default domain lookups

This patch changes how plainbox.i18n.{bind,}textdomain() works. In the
past they would just proxy the calls to the original python gettext
module.

This works okay for anything not using our internal i18n APIs. If, however,
someone is using dgettext() with a domain that's not 'plainbox', it would
fail to load the translation catalog from a custom domain *and* a custom
locale directory at the same time.

This patch moves textdomain and bindtextdomain functions to be a method
of the ITranslator API. Inside the GettextTranslator we now use
bindtextdomain as hints and store the locale directory which is finally
used to instantiate the translation catalog. For compatibility, both
methods are still calling their equivalents from thet gettext module.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
"automatic merge of lp:~zkrynicki/checkbox/flexible-session-repository/ by tarmac [r=sylvain-pineau][bug=][author=zkrynicki]"
"automatic merge of lp:~zkrynicki/checkbox/i18n-fixes/ by tarmac [r=sylvain-pineau][bug=][author=zkrynicki]"