def main():
    def set_stdio_encoding(enc=NATIVE):
        import codecs; stdio = ["stdin", "stdout", "stderr"]
        for x in stdio:
            obj = getattr(sys, x)
            if not obj.encoding: setattr(sys,  x, codecs.getwriter(enc)(obj))
    set_stdio_encoding()

    log_level = log.INFO
    log.basicConfig(format="%(levelname)s>> %(message)s", level=log_level)

    shortcuts1 = [
        shortcut_entry("Quit", gesture="gesture-two-finger-swipe-left"),
    ]

    shortcuts2 = [
        shortcut_entry("Import channels from file", "<ctrl>o"),
        shortcut_entry("Export channels to file", "<ctrl>e"),
    ]

    groups = [
            group_entry("Application", shortcuts1),
            group_entry("Import/Export Channels", shortcuts2),
            ]
    sections = [
            section_entry("shortcut", groups)
            ]

    entry = shortcut_window_entry("shortcut-window", sections, modal=1)

    content = shortcut_xml_gen(entry)
    print(content)

    def test_gui(shortcut_xml):
        import gi
        gi.require_version("Gtk", "3.0")
        from gi.repository import Gtk
        builder = Gtk.Builder()
        builder.add_from_string(shortcut_xml)
        win = builder.get_object("shortcut-window")
        win.connect("delete-event", lambda *w: Gtk.main_quit())
        win.show_all()
        Gtk.main()
    test_gui(content)