Skip to content

Commit

Permalink
cant import
Browse files Browse the repository at this point in the history
  • Loading branch information
dadav committed Apr 1, 2020
1 parent 03c014f commit 9a15658
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pwnagotchi/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 4,8 @@
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


Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 9a15658

Please sign in to comment.