mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-10-08 14:54:36 +00:00
Merge pull request #104 from bombsquad-community/invisible-none-type-models
Allow invisible models
This commit is contained in:
commit
d72bdbcc5f
2 changed files with 34 additions and 0 deletions
|
|
@ -651,6 +651,25 @@
|
|||
"md5sum": "cc1738b0326c9679453bdf1489ded483"
|
||||
}
|
||||
}
|
||||
},
|
||||
"allow_invisible_models": {
|
||||
"description": "Changing model to None will make it invisible instead of raising an exception.",
|
||||
"external_url": "",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Rikko",
|
||||
"email": "rikkolovescats@proton.me",
|
||||
"discord": "Rikko#7383"
|
||||
}
|
||||
],
|
||||
"versions": {
|
||||
"1.0.0": {
|
||||
"api_version": 7,
|
||||
"commit_sha": "3221b3a",
|
||||
"released_on": "22-01-2023",
|
||||
"md5sum": "24913c665d05c3056c8ba390fe88155e"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
15
plugins/utilities/allow_invisible_models.py
Normal file
15
plugins/utilities/allow_invisible_models.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# ba_meta require api 7
|
||||
import ba
|
||||
|
||||
original_getmodel = ba.getmodel
|
||||
|
||||
|
||||
def get_model_gracefully(model):
|
||||
if model is not None:
|
||||
return original_getmodel(model)
|
||||
|
||||
|
||||
# ba_meta export plugin
|
||||
class Main(ba.Plugin):
|
||||
def on_app_running(self):
|
||||
ba.getmodel = get_model_gracefully
|
||||
Loading…
Add table
Add a link
Reference in a new issue