diff --git a/plugins/webstats/tool_migrate.py b/plugins/webstats/tool_migrate.py index 926cd6474..1c02f8438 100644 --- a/plugins/webstats/tool_migrate.py +++ b/plugins/webstats/tool_migrate.py @@ -6,9 +6,13 @@ import os import time import json -sys.path.append(os.getcwd() + "/class/core") -import mw +web_dir = os.getcwd() + "/web" +if os.path.exists(web_dir): + sys.path.append(web_dir) + os.chdir(web_dir) +import core.mw as mw +from utils.crontab import crontab as MwCrontab app_debug = False if mw.isAppleSystem(): diff --git a/plugins/webstats/webstats_index.py b/plugins/webstats/webstats_index.py index 411c8297d..5c5083519 100644 --- a/plugins/webstats/webstats_index.py +++ b/plugins/webstats/webstats_index.py @@ -8,11 +8,13 @@ import json import re -try: - sys.path.append(os.getcwd() + "/class/core") - import mw -except Exception as e: - import core.mw as mw +web_dir = os.getcwd() + "/web" +if os.path.exists(web_dir): + sys.path.append(web_dir) + os.chdir(web_dir) + +import core.mw as mw +from utils.crontab import crontab as MwCrontab app_debug = False