From 476863a44b6f068ede2e2c4dd33f4979d09bebda Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Tue, 5 Aug 2014 22:35:59 +0000 Subject: [PATCH] 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 --- lib/newfol/database.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/newfol/database.py b/lib/newfol/database.py index 8d34d96..9e9147d 100644 --- a/lib/newfol/database.py +++ b/lib/newfol/database.py @@ -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", "sí"): 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