Ubuntu 18.04 Bionic comes with an older Python version (3.6) that
doesn't support the `capture_output` parameter on `subprocess.run`
which leads to a crash when installing or uninstalling keyboads to
the shared area. This change works around the problem by calling
a different method on Bionic.
Fixes#6564.
Also rename the .po files to match the new mappings:
- `bwr_NT.po` -> `brw_NG.po`: the language shows up as `bwr-ng` in
Crowdin, and there's no `NT` country code.
- `ha_HG.po` -> `ha.po`: the language shows up as `ha` in Crowdin and
there's no `HG` country code.
- `shu_latn.po` -> `shu@latin.po`: the convention seems to be to put
the script after `@` sign.
Instead of trying to restart ibus by passing True to bus.exit()
we now exit ibus and then let verify_ibus_daemon() start it again.
Also added additional checks to verify that we're not running
multiple ibus-daemons at the start of km-config and before
restarting.
This change adds a 1s sleep after restarting ibus before checking
that it actually runs. Hopefully this will solve the problem. Since
this bug is hard to reproduce, we also log a critical error for the
other code path this could happen.
Fixes#6237.
This change catches the exception we're getting if we try to create
a directory but e.g. there is already a file with that name. In this
case we now output an error message. This change also gracefully
handles failures when linking files.
Fixes#6285.
In the past we already gracefully handled keyboard download failures
when the user triggered the download from the km-config UI. This
change deals with the command line side of things, most often when
the user clicks on the "Install keyboard" button on keyman.com. If
the download fails we already output an error message and now don't
try to install the non-existing .kmp file.
Fixes#6284.
When trying to install a keyboard with `km-package-install` and
the same version was already installed or a newer version was
available and would be installed we now output a simple message
instead of an error.
Additionally, don't print the date in the footer. This often overlaps
with the program name and version.
Also print usage in addition to error if wrong arguments are given.
Fixes#6240.
When we try to restart ibus and that fails and ibus isn't running
afterwards we directly try to start ibus-daemon.
On Ubuntu 21.10 Impish there are two `ibus-daemon` processes
running for the current user. One of them has the `--xim` flag
and is the one we care about. This change improves the detection
that ibus is running after installing a keyboard.
Newer versions of requests-cache (>= 0.6) restructure some code so
that the _core_ namespace is no longer available. However, it turns
out that we don't need to specify that namespace at all, so this
change will work with both older and newer versions of
requests-cache.
This will fix#6085.