From 804f7646d14b0c1feec8e174a847661c9073f95e Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 5 Nov 2024 01:39:07 +0800 Subject: [PATCH] update --- plugins/php-apt/index_php_apt.py | 7 +++++-- plugins/php-yum/index_php_yum.py | 7 +++++-- plugins/php/index_php.py | 8 +++++--- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/plugins/php-apt/index_php_apt.py b/plugins/php-apt/index_php_apt.py index 97ade4c7d..0be394d49 100755 --- a/plugins/php-apt/index_php_apt.py +++ b/plugins/php-apt/index_php_apt.py @@ -11,8 +11,11 @@ import shutil # reload(sys) # sys.setdefaultencoding('utf8') -sys.path.append(os.getcwd() + "/class/core") -import mw +try: + sys.path.append(os.getcwd() + "/class/core") + import mw +except Exception as e: + import core.mw as mw if mw.isAppleSystem(): cmd = 'ls /usr/local/lib/ | grep python | cut -d \\ -f 1 | awk \'END {print}\'' diff --git a/plugins/php-yum/index_php_yum.py b/plugins/php-yum/index_php_yum.py index 0600580d6..5a421e423 100755 --- a/plugins/php-yum/index_php_yum.py +++ b/plugins/php-yum/index_php_yum.py @@ -11,8 +11,11 @@ import shutil # reload(sys) # sys.setdefaultencoding('utf8') -sys.path.append(os.getcwd() + "/class/core") -import mw +try: + sys.path.append(os.getcwd() + "/class/core") + import mw +except Exception as e: + import core.mw as mw if mw.isAppleSystem(): cmd = 'ls /usr/local/lib/ | grep python | cut -d \\ -f 1 | awk \'END {print}\'' diff --git a/plugins/php/index_php.py b/plugins/php/index_php.py index 5ffba3af6..bfd9bca31 100755 --- a/plugins/php/index_php.py +++ b/plugins/php/index_php.py @@ -10,9 +10,11 @@ import shutil # reload(sys) # sys.setdefaultencoding('utf8') - -sys.path.append(os.getcwd() + "/class/core") -import mw +try: + sys.path.append(os.getcwd() + "/class/core") + import mw +except Exception as e: + import core.mw as mw if mw.isAppleSystem(): cmd = 'ls /usr/local/lib/ | grep python | cut -d \\ -f 1 | awk \'END {print}\''