From 9a1565813cc113a7bef963026abc8a38e438ceb8 Mon Sep 17 00:00:00 2001 From: dadav <33197631+dadav@users.noreply.github.com> Date: Wed, 1 Apr 2020 18:21:12 +0200 Subject: [PATCH] cant import --- pwnagotchi/plugins/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pwnagotchi/plugins/__init__.py b/pwnagotchi/plugins/__init__.py index 5c2a662..6616be6 100644 --- a/pwnagotchi/plugins/__init__.py +++ b/pwnagotchi/plugins/__init__.py @@ -4,8 +4,8 @@ import _thread import threading import importlib, importlib.util import logging +import pwnagotchi from pwnagotchi.ui import view -from pwnagotchi import config from pwnagotchi.utils import save_config @@ -39,11 +39,11 @@ def toggle_plugin(name, enable=True): returns True if changed, otherwise False """ - global loaded, database, config + global loaded, database - if config: - config['main']['plugins'][name] = enable - save_config(config, '/etc/pwnagotchi/config.toml') + if pwnagotchi.config: + pwnagotchi.config['main']['plugins'][name]['enabled'] = enable + save_config(pwnagotchi.config, '/etc/pwnagotchi/config.toml') if not enable and name in loaded: if getattr(loaded[name], 'on_unload', None):