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