commit
c6b12f0056
|
@ -35,12 +35,23 @@ def parse_options(argv):
|
|||
parser = argparse.ArgumentParser(
|
||||
description='SUbiquity - Ubiquity for Servers',
|
||||
prog='subiquity')
|
||||
try:
|
||||
ascii_default = os.ttyname(0) == "/dev/ttysclp0"
|
||||
except OSError:
|
||||
ascii_default = False
|
||||
parser.set_defaults(ascii=ascii_default)
|
||||
parser.add_argument('--dry-run', action='store_true',
|
||||
dest='dry_run',
|
||||
help='menu-only, do not call installer function')
|
||||
parser.add_argument('--serial', action='store_true',
|
||||
dest='run_on_serial',
|
||||
help='Run the installer over serial console.')
|
||||
parser.add_argument('--ascii', action='store_true',
|
||||
dest='ascii',
|
||||
help='Run the installer in ascii mode.')
|
||||
parser.add_argument('--unicode', action='store_false',
|
||||
dest='ascii',
|
||||
help='Run the installer in unicode mode.')
|
||||
parser.add_argument('--machine-config', metavar='CONFIG',
|
||||
dest='machine_config',
|
||||
help="Don't Probe. Use probe data file")
|
||||
|
|
|
@ -164,6 +164,19 @@ def make_screen(colors, is_linux_tty):
|
|||
return TwentyFourBitScreen(_urwid_name_to_rgb)
|
||||
|
||||
|
||||
def extend_dec_special_charmap():
|
||||
urwid.escape.DEC_SPECIAL_CHARMAP.update({
|
||||
ord('\N{BLACK RIGHT-POINTING SMALL TRIANGLE}'): '>',
|
||||
ord('\N{BLACK LEFT-POINTING SMALL TRIANGLE}'): '<',
|
||||
ord('\N{BLACK DOWN-POINTING SMALL TRIANGLE}'): 'v',
|
||||
ord('\N{BLACK UP-POINTING SMALL TRIANGLE}'): '^',
|
||||
ord('\N{check mark}'): '+',
|
||||
ord('\N{bullet}'): '*',
|
||||
ord('\N{lower half block}'): '=',
|
||||
ord('\N{upper half block}'): '=',
|
||||
})
|
||||
|
||||
|
||||
class KeyCodesFilter:
|
||||
"""input_filter that can pass (medium) raw keycodes to the application
|
||||
|
||||
|
@ -567,6 +580,11 @@ class Application:
|
|||
input_filter=self.input_filter.filter,
|
||||
unhandled_input=self.unhandled_input)
|
||||
|
||||
if self.opts.ascii:
|
||||
urwid.util.set_encoding('ascii')
|
||||
|
||||
extend_dec_special_charmap()
|
||||
|
||||
self.toggle_color()
|
||||
|
||||
self.base_model = self.make_model()
|
||||
|
|
Loading…
Reference in New Issue