Commit a307ce8c authored by Juergen Nickelsen's avatar Juergen Nickelsen
Browse files

have the program as pyle.py instead of that symlink

parent a9de5996
#!/usr/bin/env python3
# This file is part of the Python Lambda Experiment (pyle),
# Copyright (C) 2017 Juergen Nickelsen <ni@w21.org>.
# See LICENSE for the conditions under which this code is licensed to you.
"""The main program."""
# Python modules
import os
import sys
# site modules
sys.path.append('/opt/w21/lib/python3')
import posix_getopts
wherefrom = os.path.dirname(sys.argv[0])
sys.path.append(wherefrom)
# Pyle non-object modules
import dep
import info
import dbg
default_loadpath = [wherefrom, "/opt/w21/lib/pyle/l", "l"]
program = sys.argv[0]
usage = """\
usage: pyle [-t] [-l loadfile] [-d debugfflags] [-L loadpath] [program] ...
"""
ovc, argv = posix_getopts.parse({
"t": [0, bool, "traceback", "print python tracebacks on error"],
"l": [[], str, "loadfiles", "load file(s)"],
"d": [[], str, "debugflags", "set debug flag(s)"],
"r": [10000, int, "recursion_limit", "set recursion limit"],
"s": [0, bool, "evalstack", "print eval stack or error"],
"L": [default_loadpath, str, "loadpath", "set the load path"],
"e": [0, bool, "exit_on_error", "exit on error"],
})
# dbg.p(dbg.main, sys.argv[0], "starting up")
for flags in ovc.debugflags:
for flag in flags.split(","):
dbg.addFlag(flag)
sys.setrecursionlimit(ovc.recursion_limit)
info.verbosity = 1
dep.exit_on_error = ovc.exit_on_error
dep.evalstack = ovc.evalstack
import reader
import stdsyms
if ovc.traceback:
stdsyms.enableTraceback(True)
reader.loadpath = ovc.loadpath
if __name__ == "__main__":
reader.load("basedefs.l")
for file in ovc.loadfiles:
reader.load(file)
if len(argv) > 0:
# dbg.p(dbg.main, "args are", argv)
for arg in argv:
# dbg.p(dbg.main, "loading", arg)
reader.loadFile(arg)
else:
# dbg.p(dbg.main, "starting interactive repl...")
reader.repl(sys.stdin, "*stdin*", sys.stdout)
pyle
\ No newline at end of file
#!/usr/bin/env python3
# This file is part of the Python Lambda Experiment (pyle),
# Copyright (C) 2017 Juergen Nickelsen <ni@w21.org>.
# See LICENSE for the conditions under which this code is licensed to you.
"""The main program."""
# Python modules
import os
import sys
# site modules
sys.path.append('/opt/w21/lib/python3')
import posix_getopts
wherefrom = os.path.dirname(sys.argv[0])
sys.path.append(wherefrom)
# Pyle non-object modules
import dep
import info
import dbg
default_loadpath = [wherefrom, "/opt/w21/lib/pyle/l", "l"]
program = sys.argv[0]
usage = """\
usage: pyle [-t] [-l loadfile] [-d debugfflags] [-L loadpath] [program] ...
"""
ovc, argv = posix_getopts.parse({
"t": [0, bool, "traceback", "print python tracebacks on error"],
"l": [[], str, "loadfiles", "load file(s)"],
"d": [[], str, "debugflags", "set debug flag(s)"],
"r": [10000, int, "recursion_limit", "set recursion limit"],
"s": [0, bool, "evalstack", "print eval stack or error"],
"L": [default_loadpath, str, "loadpath", "set the load path"],
"e": [0, bool, "exit_on_error", "exit on error"],
})
# dbg.p(dbg.main, sys.argv[0], "starting up")
for flags in ovc.debugflags:
for flag in flags.split(","):
dbg.addFlag(flag)
sys.setrecursionlimit(ovc.recursion_limit)
info.verbosity = 1
dep.exit_on_error = ovc.exit_on_error
dep.evalstack = ovc.evalstack
import reader
import stdsyms
if ovc.traceback:
stdsyms.enableTraceback(True)
reader.loadpath = ovc.loadpath
if __name__ == "__main__":
reader.load("basedefs.l")
for file in ovc.loadfiles:
reader.load(file)
if len(argv) > 0:
# dbg.p(dbg.main, "args are", argv)
for arg in argv:
# dbg.p(dbg.main, "loading", arg)
reader.loadFile(arg)
else:
# dbg.p(dbg.main, "starting interactive repl...")
reader.repl(sys.stdin, "*stdin*", sys.stdout)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment