mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
@ -29,11 +29,7 @@ args = parser.parse_args()
|
||||
config = utils.load_config(args)
|
||||
utils.setup_logging(args, config)
|
||||
|
||||
plugins.load_from_path(plugins.default_path, enabled=config['main']['plugins'])
|
||||
if 'custom_plugins' in config['main'] and config['main']['custom_plugins'] is not None:
|
||||
plugins.load_from_path(config['main']['custom_plugins'], enabled=config['main']['plugins'])
|
||||
|
||||
plugins.on('loaded')
|
||||
plugins.load(config)
|
||||
|
||||
display = Display(config=config, state={'name': '%s>' % pwnagotchi.name()})
|
||||
agent = Agent(view=display, config=config)
|
||||
|
@ -40,3 +40,11 @@ def load_from_path(path, enabled=()):
|
||||
loaded[name] = plugin
|
||||
|
||||
return loaded
|
||||
|
||||
|
||||
def load(config):
|
||||
load_from_path(default_path, enabled=config['main']['plugins'])
|
||||
if 'custom_plugins' in config['main'] and config['main']['custom_plugins'] is not None:
|
||||
load_from_path(config['main']['custom_plugins'], enabled=config['main']['plugins'])
|
||||
|
||||
on('loaded')
|
||||
|
Reference in New Issue
Block a user