Preserve symbol attributes when serializing/deserializing XML.

This commit is contained in:
Daiki Ueno
2011-08-30 17:22:25 +09:00
parent b02ae1b7cc
commit 3777620574
6 changed files with 83 additions and 17 deletions

View File

@ -44,7 +44,8 @@ def remap(keyboard, mapping):
if mapped.has_key('label'):
replace.set_label(mapped['label'])
if mapped.has_key('category'):
replace.set_category(mapped['category'])
cat = Eek.symbol_category_from_name(mapped['category'])
replace.set_category(cat)
matrix.set_symbol(0, level, replace)
def __each_section(element, data):
element.foreach_child(__each_key, data)

View File

@ -149,9 +149,10 @@
(car from)
(or (mim2remap--char-to-keyname (aref from 0))
(error "No keyname for %c" (aref from 0))))
(if (characterp to)
(list (cons :text (char-to-string to)))
(list (cons :text to))))))
(list (cons :text (if (characterp to)
(char-to-string to)
to))
(cons :category 'letter)))))
(cdr sexp))))))
(defun batch-mim2remap ()