+ file.write(u"\\end_layout\n")
+ file.write(u"\n")
+
+def write_sections(file,lfuns):
+ """Write sections of LFUNs"""
+ sections = ["Layout", "Edit", "Math", "Buffer", "System", "Hidden"]
+ section_headings = {
+ "Layout": u"Layout Functions (Font, Layout and Textclass related)",
+ "Edit": u"Editing Functions (Cursor and Mouse Movement, Copy/Paste etc.)",
+ "Math": u"Math Editor Functions",
+ "Buffer": u"Buffer Fuctions (File and Window related)",
+ "System": u"System Functions (Preferences, LyX Server etc.)",
+ "Hidden": u"Hidden Functions (not listed for configuration)"
+ }
+ # write the lfuns to the file
+ for val in sections:
+ file.write(u"\\begin_layout Section\n")
+ file.write(section_headings[val] + "\n")
+ file.write(u"\\end_layout\n")
+ file.write(u"\n")
+ for lf in lfuns:
+ if lf["type"] == val:
+ write_fields(file, lf)