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,6 +8,7 @@ import _thread
import pwnagotchi
import pwnagotchi.utils as utils
import pwnagotchi.plugins as plugins
from pwnagotchi.ui.web.server import Server
from pwnagotchi.automata import Automata
from pwnagotchi.log import LastSession
from pwnagotchi.bettercap import Client
@ -18,8 +19,6 @@ RECOVERY_DATA_FILE = '/root/.pwnagotchi-recovery'
class Agent(Client, Automata, AsyncAdvertiser, AsyncTrainer):
INSTANCE = None
def __init__(self, view, config, keypair):
Client.__init__(self, config['bettercap']['hostname'],
config['bettercap']['scheme'],
@ -36,6 +35,8 @@ class Agent(Client, Automata, AsyncAdvertiser, AsyncTrainer):
self._supported_channels = utils.iface_channels(config['main']['iface'])
self._view = view
self._view.set_agent(self)
self._web_ui = Server(self, self.config['ui']['display'])
self._access_points = []
self._last_pwnd = None
self._history = {}
@ -46,8 +47,6 @@ class Agent(Client, Automata, AsyncAdvertiser, AsyncTrainer):
if not os.path.exists(config['bettercap']['handshakes']):
os.makedirs(config['bettercap']['handshakes'])
Agent.INSTANCE = self
def config(self):
return self._config