Allow longer names for schema fields.

The current names are hard to remember.  Allow using longer names for
most fields.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
This commit is contained in:
brian m. carlson 2014-08-05 22:35:59 +00:00
parent ee1a228919
commit 476863a44b
No known key found for this signature in database
GPG key ID: BF535D811F52F68B

View file

@ -354,31 +354,31 @@ class Schema:
sch._nfields = nfields = int(i.fields[1])
if not len(sch._layout):
sch._layout = list(range(nfields))
elif rectype == "exe":
elif rectype in ['exe', 'execute']:
if exe_seen:
exe_ok = False
continue
exe_seen = True
if i.fields[1].lower() in ("yes", "oui", ""):
exe_ok = True
elif rectype == "imp":
elif rectype in ['imp', 'import']:
sch._imports = filter(lambda x: x, i.fields[1:])
elif rectype == "pvu":
elif rectype in ['pvu', 'preview']:
pass
elif rectype == "col":
elif rectype in ['col', 'column']:
sch._columns = int(i.fields[1])
elif rectype == "txn":
elif rectype in ['txn', 'transaction']:
sch._txntype = i.fields[1:]
elif rectype == "dpy":
elif rectype in ['dpy', 'display']:
sch._layout = list(map(fix_up_layout, i.fields[1:]))
elif rectype == "edo":
elif rectype in ['edo', 'editor', 'editor-option']:
sch._options["editor"][i.fields[1]] = i.fields[2]
elif rectype == "clr":
elif rectype in ['clr', 'color']:
if len(i.fields) == 3:
sch._palette[i.fields[1]] = i.fields[2]
elif len(i.fields) == 4:
sch._palette[i.fields[1]] = i.fields[2:]
elif rectype == "ksh":
elif rectype in ['ksh', 'keymap', 'shortcut']:
sch._keys[i.fields[1]] = i.fields[2]
sch._mapping = mapping
sch._keyfields = keyfields