for some reason shell forgets settings, this works around temporarily fixes the problem, thanks Vladyslav Kozlovskyy
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.00.0 (2012-06-29 20:55:40) dev
|
Version 2.00.0 (2012-06-30 11:54:31) dev
|
||||||
|
|||||||
+1
-1
@@ -361,7 +361,7 @@ def build_environment(request, response, session, store_current=True):
|
|||||||
"""
|
"""
|
||||||
Build the environment dictionary into which web2py files are executed.
|
Build the environment dictionary into which web2py files are executed.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
environment = {}
|
environment = {}
|
||||||
for key in html.__all__:
|
for key in html.__all__:
|
||||||
environment[key] = getattr(html, key)
|
environment[key] = getattr(html, key)
|
||||||
|
|||||||
@@ -13,3 +13,4 @@ settings = global_settings # legacy compatibility
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+5
-2
@@ -61,7 +61,7 @@ def exec_environment(
|
|||||||
appname = mo.group('appname')
|
appname = mo.group('appname')
|
||||||
request.folder = os.path.join('applications', appname)
|
request.folder = os.path.join('applications', appname)
|
||||||
else:
|
else:
|
||||||
request.folder = ''
|
request.folder = ''
|
||||||
env = build_environment(request, response, session, store_current=False)
|
env = build_environment(request, response, session, store_current=False)
|
||||||
if pyfile:
|
if pyfile:
|
||||||
pycfile = pyfile + 'c'
|
pycfile = pyfile + 'c'
|
||||||
@@ -123,7 +123,7 @@ def env(
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
fileutils.check_credentials = check_credentials
|
fileutils.check_credentials = check_credentials
|
||||||
|
|
||||||
environment = build_environment(request, response, session)
|
environment = build_environment(request, response, session)
|
||||||
|
|
||||||
if import_models:
|
if import_models:
|
||||||
@@ -206,6 +206,9 @@ def run(
|
|||||||
exec ('print %s()' % f, _env)
|
exec ('print %s()' % f, _env)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# "woodoo magic" workaround: reinitialize main.py
|
||||||
|
g={}; exec "import main" in g; del g
|
||||||
|
|
||||||
_env.update(exec_pythonrc())
|
_env.update(exec_pythonrc())
|
||||||
if startfile:
|
if startfile:
|
||||||
try:
|
try:
|
||||||
|
|||||||
+2
-2
@@ -20,12 +20,12 @@ import signal
|
|||||||
import math
|
import math
|
||||||
import logging
|
import logging
|
||||||
import newcron
|
import newcron
|
||||||
import main
|
|
||||||
import getpass
|
import getpass
|
||||||
|
import main
|
||||||
|
|
||||||
from fileutils import w2p_pack, read_file, write_file
|
from fileutils import w2p_pack, read_file, write_file
|
||||||
from shell import run, test
|
|
||||||
from settings import global_settings
|
from settings import global_settings
|
||||||
|
from shell import run, test
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import Tkinter, tkMessageBox
|
import Tkinter, tkMessageBox
|
||||||
|
|||||||
Reference in New Issue
Block a user