From a18415c25b83328e2504fb50fc117ba11a7f22aa Mon Sep 17 00:00:00 2001 From: rking32 Date: Thu, 14 May 2020 21:11:11 +0530 Subject: [PATCH] add unofficial plugin support --- Aptfile | 2 ++ app.json | 4 ++++ config.env.sample | 6 ++++++ userge/config.py | 9 +++++++++ userge/versions.py | 2 +- 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Aptfile b/Aptfile index 3418a2870..2be362a81 100644 --- a/Aptfile +++ b/Aptfile @@ -3,3 +3,5 @@ wget wget2 pv jq +p7zip-full +p7zip-rar diff --git a/app.json b/app.json index f6fa50405..acba2ef20 100644 --- a/app.json +++ b/app.json @@ -35,6 +35,10 @@ "description": "Set True if it is TeamDrive", "value": "True" }, + "LOAD_UNOFFICIAL_PLUGINS": { + "description": "Set True if your like to use unofficial plugins", + "value": "False" + }, "DOWN_PATH": { "description": "Set name to your working directory", "required": false diff --git a/config.env.sample b/config.env.sample index c3b44967c..94bced31d 100644 --- a/config.env.sample +++ b/config.env.sample @@ -33,6 +33,10 @@ G_DRIVE_CLIENT_SECRET = "" G_DRIVE_IS_TD = False +# Set True if your like to use unofficial plugins +LOAD_UNOFFICIAL_PLUGINS = False + + # ----------- OPTIONAL ----------- # @@ -47,9 +51,11 @@ PREFERRED_LANGUAGE = "" # get API Key from 'https://free.currencyconverterapi.com/' CURRENCY_API = "" + # get API key for OCR module 'http://eepurl.com/bOLOcf' OCR_SPACE_API_KEY = "" + # add default city for weather WEATHER_DEFCITY = "" diff --git a/userge/config.py b/userge/config.py index 1e79bd6af..58c5ace10 100644 --- a/userge/config.py +++ b/userge/config.py @@ -87,6 +87,8 @@ class Config: HEROKU_APP_NAME = os.environ.get("HEROKU_APP_NAME", None) + LOAD_UNOFFICIAL_PLUGINS = bool(os.environ.get("LOAD_UNOFFICIAL_PLUGINS", False)) + HEROKU_APP = None HEROKU_GIT_URL = None @@ -150,3 +152,10 @@ class Config: downloader = SmartDL(binary, path, progress_bar=False) downloader.start() os.chmod(path, 0o755) + +if Config.LOAD_UNOFFICIAL_PLUGINS: + os.system(f"git clone https://github.com/UsergeTeam/Userge-Plugins.git") + os.system("pip3 install -r Userge-Plugins/requirements.txt") + os.system("rm -rf userge/plugins/unof_plugins/") + os.system("mv Userge-Plugins/plugins/ userge/plugins/unof_plugins/") + os.system("rm -rf Userge-Plugins/") diff --git a/userge/versions.py b/userge/versions.py index 50a4653b5..56f6e5e0c 100644 --- a/userge/versions.py +++ b/userge/versions.py @@ -14,7 +14,7 @@ __version_mjaor__ = 0 __version_minor__ = 1 __version_micro__ = 5 -__version_beta__ = 1 +__version_beta__ = 2 __version__ = "{}.{}.{}".format(__version_mjaor__, __version_minor__,