29 lines
806 B
Python
Executable File
29 lines
806 B
Python
Executable File
#!/usr/bin/env python3
|
|
def init():
|
|
app = mfp.require("main")
|
|
|
|
def main():
|
|
mfp.setProgramName(open(mfp.p(mfp.sd,"appname.txt"),"r",encoding="utf-8").read().strip(" \t\r\n"))
|
|
app = mfp.require("main")
|
|
app.main()
|
|
|
|
def bootstrap(name,modName):
|
|
if name in globals(): return
|
|
import sys, os, importlib
|
|
if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'):
|
|
s = os.path.realpath(sys.executable)
|
|
else:
|
|
s = os.path.realpath(__file__)
|
|
|
|
if not os.path.join(os.path.dirname(s),"module","py") in sys.path:
|
|
sys.path = [os.path.join(os.path.dirname(s),"module","py")] + sys.path
|
|
|
|
mod = importlib.import_module(modName); modl = mod.Bunch()
|
|
mod.init(mod,modl,s,name)
|
|
globals()[name] = mod; globals()[name + "l"] = modl
|
|
|
|
bootstrap("mfp","me.fier.python")
|
|
init()
|
|
if __name__ == '__main__':
|
|
main()
|