Skip to content

Commit

Permalink
优化调试模式
Browse files Browse the repository at this point in the history
  • Loading branch information
midoks committed Aug 1, 2022
1 parent 3ff96cc commit 0cc0f16
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions class/core/mw.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,17 @@ def isAppleSystem():
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):
try:
float(s)
Expand Down
4 changes: 2 additions & 2 deletions class/core/plugins_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ def run(self, name, func, version='', args='', script='index'):
return ('', '')
data = mw.execShell(py_cmd)

if mw.isAppleSystem():
if mw.isDebugMode():
print('run', py_cmd)
print(data)
# print os.path.exists(py_cmd)
Expand All @@ -861,7 +861,7 @@ def callback(self, name, func, args='', script='index'):
sys.path.append(package)
eval_str = "__import__('" + script + "')." + func + '(' + args + ')'
newRet = eval(eval_str)
if mw.isAppleSystem():
if mw.isDebugMode():
print('callback', eval_str)

return (True, newRet)

0 comments on commit 0cc0f16

Please sign in to comment.