优化调试模式

pull/144/head
midoks 3 years ago
parent 3ff96cc63b
commit 0cc0f165f5
  1. 11
      class/core/mw.py
  2. 4
      class/core/plugins_api.py

@ -111,6 +111,17 @@ def isAppleSystem():
return False return False
def isDebugMode():
if isAppleSystem():
return True
debugPath = getRunDir() + "/data/debug.pl"
if os.path.exists(debugPath):
return True
return False
def isNumber(s): def isNumber(s):
try: try:
float(s) float(s)

@ -845,7 +845,7 @@ class plugins_api:
return ('', '') return ('', '')
data = mw.execShell(py_cmd) data = mw.execShell(py_cmd)
if mw.isAppleSystem(): if mw.isDebugMode():
print('run', py_cmd) print('run', py_cmd)
print(data) print(data)
# print os.path.exists(py_cmd) # print os.path.exists(py_cmd)
@ -861,7 +861,7 @@ class plugins_api:
sys.path.append(package) sys.path.append(package)
eval_str = "__import__('" + script + "')." + func + '(' + args + ')' eval_str = "__import__('" + script + "')." + func + '(' + args + ')'
newRet = eval(eval_str) newRet = eval(eval_str)
if mw.isAppleSystem(): if mw.isDebugMode():
print('callback', eval_str) print('callback', eval_str)
return (True, newRet) return (True, newRet)

Loading…
Cancel
Save