###############################################################################
import logging
-import subprocess
from . import step
from .i18n import _
def run(self):
# Get a list of all available keymaps
- try:
- keymaps = self.bricklayer.command(["localectl", "list-keymaps"])
+ keymaps = self.bricklayer.command(["localectl", "list-keymaps"], error_ok=True)
- # Split the output by line
- keymaps = { km : km for km in keymaps.splitlines() }
-
- # Silently skip this step if no keymaps could be loaded
- except subprocess.CalledProcessError:
+ # Skip this step if no keymaps could be loaded
+ if not keymaps:
return
+ # Split the output by line
+ keymaps = { km : km for km in keymaps.splitlines() }
+
# Which keymap is currently selected?
keymap = self.bricklayer.settings.get("keymap")