summaryrefslogtreecommitdiff
path: root/src/locale/generate-kbd-model-map
blob: 624c5179fa02f5b9b07dce38e595263ad4d4dd14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/python

import sys
import system_config_keyboard.keyboard_models

def strdash(s):
        return s.strip() or '-'

def tab_extend(s, n=1):
        s = strdash(s)
        k = len(s) // 8

        if k >= n:
                f = 1
        else:
                f = n - k

        return s + '\t'*f


models = system_config_keyboard.keyboard_models.KeyboardModels().get_models()

print "# Generated from system-config-keyboard's model list"
print "# consolelayout\t\txlayout\txmodel\t\txvariant\txoptions"

for key, value in reversed(models.items()):
        options = "terminate:ctrl_alt_bksp"
        if value[4]:
                options += ',' + value[4]

        print ''.join((tab_extend(key, 3), tab_extend(value[1]),
                       tab_extend(value[2], 2), tab_extend(value[3], 2),
                       options))