https://bitbucket.org/daniel_fort/magic-lantern
Revision bc46669fd403a18fd05f21949e9fcb5d1cf489ee authored by alex@thinkpad on 03 December 2017, 20:18:40 UTC, committed by alex@thinkpad on 03 December 2017, 20:18:40 UTC
- always install ML-SETUP.FIR (zip, install, install_qemu)
- build_fir for regular ML (not installer) now gives AUTOEXEC.FIR
- to recompile ML-SETUP.FIR: "make ML-SETUP.FIR -B" from platform directory
- "make zip" will also compile the installer from source, without replacing the precompiled ML-SETUP.FIR
  (just to make sure the source code changes do not interfere with building the installer)
1 parent 5e69462
Raw File
Tip revision: bc46669fd403a18fd05f21949e9fcb5d1cf489ee authored by alex@thinkpad on 03 December 2017, 20:18:40 UTC
Makefile: FIR building updates
Tip revision: bc46669
menuindex.py
import os,sys,string

try:
    f = open("menuindex.txt","rU").readlines()
except:
    print "Could not open menuindex.txt, will not rewrite help index files"
    raise SystemExit

os.system("mkdir cam")
o = open("cam/menuidx.dat", "w")
menu = open("../src/menuindexentries.h", "w")

print >> menu, """
// Auto-generated; do not edit this file.
// Edit doc/menuindex.py instead.
"""

print >> o, "001 About Magic Lantern"

sections = 0

#~ idx = {}
#~ idxp = {}
for l in f[1:]:
    l = l.strip("\n").split(" ")
    try: page, type, name = l[0], l[1], string.join(l[2:], " ")
    except:
        print l
    page = int(page)
    name = name.replace(r"$\leftrightarrow $", "<-->")
    name = name.replace(r"$\rightarrow $", "->")

    if type == "subsubsection": # each menu entry is a subsection
        item = name.split(":")[0]

        if " and " in item:
            and_terms = item.split(" and ")
            for t in and_terms:
                print >> o, "%03d %s" % (page, t.strip())
            continue

        item = item.split(" / ")[0]
        item = item.split(" (")[0]
        item = item.split(" X sec")[0]
        item = item.strip()
        #~ idx[item] = page
        #~ idxp[page] = item
        #print page, item
        print >> o, "%03d %s" % (page, item)

    if type == "section": # main sections in menu
        sections += 1
        item = name
        #print page, item
        print >> o, "%03d %s" % (page, item)
        print >> menu, """    {
        .name = "%s",
        .priv = "%s",
        .select = menu_help_go_to_label,
        .update = user_guide_display,
        .icon_type = IT_ACTION,
    },""" % (item, item)

    if type == "end":
        lastpage = page - 1
        print >> o, "%03d end" % lastpage

#~ print idxp
o.close()
menu.close()
back to top