new command line options

This commit is contained in:
mdipierro
2019-05-01 21:07:52 -07:00
parent 6f12be7e20
commit 1c08c07a0f
25 changed files with 809 additions and 409 deletions
+5 -5
View File
@@ -146,7 +146,7 @@ def env(
request.is_shell = cmd_opts.shell is not None
else:
ip = '127.0.0.1'; port = 8000
# FIXME: what about request.is_shell ?
request.is_shell = False
request.is_scheduler = False
request.env.http_host = '%s:%s' % (ip, port)
request.env.remote_addr = '127.0.0.1'
@@ -213,7 +213,7 @@ def run(
startfile=None,
bpython=False,
python_code=None,
cronjob=False,
cron_job=False,
scheduler_job=False):
"""
Start interactive shell or run Python script (startfile) in web2py
@@ -233,7 +233,7 @@ def run(
adir = os.path.join('applications', a)
if not os.path.exists(adir):
if not cronjob and not scheduler_job and \
if not cron_job and not scheduler_job and \
sys.stdin and not sys.stdin.name == '/dev/null':
confirm = raw_input(
'application %s does not exist, create (y/n)?' % a)
@@ -259,7 +259,7 @@ def run(
pyfile = os.path.join('applications', a, 'controllers', c + '.py')
pycfile = os.path.join('applications', a, 'compiled',
"controllers_%s_%s.pyc" % (c, f))
if ((cronjob and os.path.isfile(pycfile))
if ((cron_job and os.path.isfile(pycfile))
or not os.path.isfile(pyfile)):
exec(read_pyc(pycfile), _env)
elif os.path.isfile(pyfile):
@@ -380,7 +380,7 @@ def test(testpath, import_models=True, verbose=False):
import doctest
if os.path.isfile(testpath):
mo = re.match(r'(|.*/)applications/(?P<a>[^/]+)', testpath)
mo = re.search('/?applications/(?P<a>[^/]+)', testpath)
if not mo:
die('test file is not in application directory: %s'
% testpath)