cant import

This commit is contained in:
dadav 2020-04-01 18:21:12 +02:00
parent 03c014f414
commit 9a1565813c

View File

@ -4,8 +4,8 @@ import _thread
import threading import threading
import importlib, importlib.util import importlib, importlib.util
import logging import logging
import pwnagotchi
from pwnagotchi.ui import view from pwnagotchi.ui import view
from pwnagotchi import config
from pwnagotchi.utils import save_config from pwnagotchi.utils import save_config
@ -39,11 +39,11 @@ def toggle_plugin(name, enable=True):
returns True if changed, otherwise False returns True if changed, otherwise False
""" """
global loaded, database, config global loaded, database
if config: if pwnagotchi.config:
config['main']['plugins'][name] = enable pwnagotchi.config['main']['plugins'][name]['enabled'] = enable
save_config(config, '/etc/pwnagotchi/config.toml') save_config(pwnagotchi.config, '/etc/pwnagotchi/config.toml')
if not enable and name in loaded: if not enable and name in loaded:
if getattr(loaded[name], 'on_unload', None): if getattr(loaded[name], 'on_unload', None):