2011-09-28 04:25:13 +02:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
2011-10-11 12:34:14 +02:00
|
|
|
import sys
|
|
|
|
import system_config_keyboard.keyboard_models
|
2011-09-28 04:25:13 +02:00
|
|
|
|
|
|
|
def strdash(s):
|
2011-10-11 12:34:14 +02:00
|
|
|
return s.strip() or '-'
|
2011-09-28 04:25:13 +02:00
|
|
|
|
2011-10-11 12:34:14 +02:00
|
|
|
def tab_extend(s, n=1):
|
2011-09-28 04:25:13 +02:00
|
|
|
s = strdash(s)
|
2011-10-11 12:34:14 +02:00
|
|
|
k = len(s) // 8
|
2011-09-28 04:25:13 +02:00
|
|
|
|
|
|
|
if k >= n:
|
|
|
|
f = 1
|
|
|
|
else:
|
|
|
|
f = n - k
|
|
|
|
|
2011-10-11 12:34:14 +02:00
|
|
|
return s + '\t'*f
|
2011-09-28 04:25:13 +02:00
|
|
|
|
|
|
|
|
|
|
|
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"
|
|
|
|
|
2011-10-11 12:34:14 +02:00
|
|
|
for key, value in reversed(models.items()):
|
|
|
|
options = "terminate:ctrl_alt_bksp"
|
|
|
|
if value[4]:
|
|
|
|
options += ',' + value[4]
|
2011-09-28 04:25:13 +02:00
|
|
|
|
2011-10-11 12:34:14 +02:00
|
|
|
print ''.join((tab_extend(key, 3), tab_extend(value[1]),
|
|
|
|
tab_extend(value[2], 2), tab_extend(value[3], 2),
|
|
|
|
options))
|