Skip to content
Permalink
Browse files

better logging for tkinter

  • Loading branch information...
sdpython committed Oct 23, 2017
1 parent 8f98be4 commit b0e43e4df0bf0f998076fa8160a3bf907ddea5d4
@@ -700,7 +700,7 @@ def run_unittests_for_setup(file_or_folder, skip_function=default_skip_function,
raise FileNotFoundError(
"the folder {0} should contain run_unittests.py\nCONTENT:\n{1}".format(funit, "\n".join(content)))

fix_tkinter_issues_virtualenv()
fix_tkinter_issues_virtualenv(fLOG=fLOG)

cov = True
if coverage_options:
@@ -83,25 +83,34 @@ def look_for(where, prefix):
loc = location()
p = look_for(loc, "tcl")
if fLOG:
fLOG("Change {0}: '{1}' --> '{2}'".format("TCL_LIBRARY",
os.environ.get("TCL_LIBRARY", None), p))
fLOG("[fix_tkinter_issues_virtualenv] Change {0}: '{1}' --> '{2}'".format("TCL_LIBRARY",
os.environ.get("TCL_LIBRARY", None), p))
os.environ["TCL_LIBRARY"] = p
if fLOG:
fLOG("[fix_tkinter_issues_virtualenv] TCL_LIBRARY='{0}'".format(
os.environ["TCL_LIBRARY"]))

if "TK_LIBRARY" not in os.environ:
loc = location()
p = look_for(loc, "tk")
if fLOG:
fLOG("Change {0}: '{1}' --> '{2}'".format("TK_LIBRARY",
os.environ.get("TK_LIBRARY", None), p))
fLOG("[fix_tkinter_issues_virtualenv] Change {0}: '{1}' --> '{2}'".format("TK_LIBRARY",
os.environ.get("TK_LIBRARY", None), p))
os.environ["TK_LIBRARY"] = p
if fLOG:
fLOG("[fix_tkinter_issues_virtualenv] TK_LIBRARY='{0}'".format(
os.environ["TK_LIBRARY"]))

if "TIX_LIBRARY" not in os.environ:
loc = location()
p = look_for(loc, "tix")
if fLOG:
fLOG("Change {0}: '{1}' --> '{2}'".format("TIX_LIBRARY",
os.environ.get("TIX_LIBRARY", None), p))
fLOG("[fix_tkinter_issues_virtualenv] Change {0}: '{1}' --> '{2}'".format("TIX_LIBRARY",
os.environ.get("TIX_LIBRARY", None), p))
os.environ["TIX_LIBRARY"] = p
if fLOG:
fLOG("[fix_tkinter_issues_virtualenv] TIX_LIBRARY='{0}'".format(
os.environ["TIX_LIBRARY"]))

if "DISPLAY" not in os.environ:
p = ":0"
@@ -162,7 +162,7 @@ def run_main():
from .tkinter_helper import fix_tkinter_issues_virtualenv, _first_execution
fLOG("[main_wrapper_tests] MODULES (1): matplotlib already imported",
"matplotlib" in sys.modules, "first execution", _first_execution)
r = fix_tkinter_issues_virtualenv()
r = fix_tkinter_issues_virtualenv(fLOG=fLOG)
fLOG("[main_wrapper_tests] MODULES (2): matplotlib imported",
"matplotlib" in sys.modules, "first execution", _first_execution)
fLOG("[main_wrapper_tests] fix_tkinter_issues_virtualenv", r)

0 comments on commit b0e43e4

Please sign in to comment.
You can’t perform that action at this time.