Skip to content

Commit

Permalink
add unofficial plugin support
Browse files Browse the repository at this point in the history
  • Loading branch information
rking32 committed May 14, 2020
1 parent 5c04213 commit a18415c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Aptfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ wget
wget2
pv
jq
p7zip-full
p7zip-rar
4 changes: 4 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions config.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -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 ----------- #


Expand All @@ -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 = ""

Expand Down
9 changes: 9 additions & 0 deletions userge/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/")
2 changes: 1 addition & 1 deletion userge/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__,
Expand Down

0 comments on commit a18415c

Please sign in to comment.