misc: small fix or general refactoring i did not bother commenting

This commit is contained in:
Simone Margaritelli
2019-11-05 14:48:26 +01:00
parent 0830e0c74b
commit aba5b938bc
5 changed files with 15 additions and 14 deletions

View File

@@ -8,7 +8,6 @@ os.environ['WERKZEUG_RUN_MAIN'] = 'true'
import pwnagotchi
import pwnagotchi.ui.web as web
from pwnagotchi.agent import Agent
from pwnagotchi import plugins
from flask import send_file
@@ -87,7 +86,8 @@ STATUS_PAGE = """<html>
class Handler:
def __init__(self, app):
def __init__(self, agent, app):
self._agent = agent
self._app = app
self._app.add_url_rule('/', 'index', self.index)
self._app.add_url_rule('/ui', 'ui', self.ui)
@@ -102,7 +102,7 @@ class Handler:
def index(self):
return render_template_string(INDEX, title=pwnagotchi.name(),
other_mode='AUTO' if Agent.INSTANCE.mode == 'manual' else 'MANU')
other_mode='AUTO' if self._agent.mode == 'manual' else 'MANU')
def plugins(self, name, subpath):
if name is None: