Version 2.3.4

Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com>

Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com>
This commit is contained in:
Jeroen Oudshoorn
2023-09-08 01:46:45 +02:00
parent 7b6cfa2b58
commit ced919ca93
5 changed files with 26 additions and 20 deletions

View File

@ -45,7 +45,7 @@ def toggle_plugin(name, enable=True):
global loaded, database
if pwnagotchi.config:
if not name in pwnagotchi.config['main']['plugins']:
if name not in pwnagotchi.config['main']['plugins']:
pwnagotchi.config['main']['plugins'][name] = dict()
pwnagotchi.config['main']['plugins'][name]['enabled'] = enable
save_config(pwnagotchi.config, '/etc/pwnagotchi/config.toml')
@ -104,6 +104,7 @@ def one(plugin_name, event_name, *args, **kwargs):
else:
logging.warning("Executor is shut down. Cannot schedule new futures.")
def load_from_file(filename):
logging.debug("loading %s" % filename)
plugin_name = os.path.basename(filename.replace(".py", ""))
@ -112,6 +113,7 @@ def load_from_file(filename):
spec.loader.exec_module(instance)
return plugin_name, instance
def load_from_path(path, enabled=()):
global loaded, database
logging.debug("loading plugins from %s - enabled: %s" % (path, enabled))