diff --git a/plugins/gdrive/class/gdriveclient.py b/plugins/gdrive/class/gdriveclient.py index d71f1e446..527375ed9 100644 --- a/plugins/gdrive/class/gdriveclient.py +++ b/plugins/gdrive/class/gdriveclient.py @@ -8,7 +8,6 @@ import re import json import io - web_dir = os.getcwd() + "/web" if os.path.exists(web_dir): sys.path.append(web_dir) @@ -16,6 +15,12 @@ if os.path.exists(web_dir): import core.mw as mw +gd_dir = mw.getServerDir() +'/gdrive/lib' +cmd = 'ls '+gd_dir+' | grep python | cut -d \\ -f 1 | awk \'END {print}\'' +info = mw.execShell(cmd) +p = gd_dir +'/'+ info[0].strip() + "/site-packages" +sys.path.append(p) + # ----------------------------- import google.oauth2.credentials import google_auth_oauthlib.flow diff --git a/plugins/gdrive/index.py b/plugins/gdrive/index.py index 4d25f1df8..9a41d9326 100644 --- a/plugins/gdrive/index.py +++ b/plugins/gdrive/index.py @@ -12,7 +12,6 @@ import json if sys.platform != "darwin": os.chdir("/www/server/mdserver-web") - web_dir = os.getcwd() + "/web" if os.path.exists(web_dir): sys.path.append(web_dir) @@ -21,16 +20,6 @@ if os.path.exists(web_dir): import core.mw as mw import core.db as db -_ver = sys.version_info -is_py2 = (_ver[0] == 2) -is_py3 = (_ver[0] == 3) - -DEBUG = False - -if is_py2: - reload(sys) - sys.setdefaultencoding('utf-8') - app_debug = False if mw.isAppleSystem(): app_debug = True