fix: on_internet_available plugins callback is now called for both MANU and AUTO mode (fixes #210)

This commit is contained in:
Simone Margaritelli
2019-10-08 14:54:03 +02:00
parent 1c526b0bf1
commit 55d99836e7
14 changed files with 139 additions and 102 deletions

View File

@ -125,23 +125,23 @@ class Voice:
def on_rebooting(self):
return self._("Ops, something went wrong ... Rebooting ...")
def on_log(self, log):
status = self._('Kicked {num} stations\n').format(num=log.deauthed)
status += self._('Made {num} new friends\n').format(num=log.associated)
status += self._('Got {num} handshakes\n').format(num=log.handshakes)
if log.peers == 1:
def on_last_session_data(self, last_session):
status = self._('Kicked {num} stations\n').format(num=last_session.deauthed)
status += self._('Made {num} new friends\n').format(num=last_session.associated)
status += self._('Got {num} handshakes\n').format(num=last_session.handshakes)
if last_session.peers == 1:
status += self._('Met 1 peer')
elif log.peers > 0:
status += self._('Met {num} peers').format(num=log.peers)
elif last_session.peers > 0:
status += self._('Met {num} peers').format(num=last_session.peers)
return status
def on_log_tweet(self, log):
def on_last_session_tweet(self, last_session):
return self._(
'I\'ve been pwning for {duration} and kicked {deauthed} clients! I\'ve also met {associated} new friends and ate {handshakes} handshakes! #pwnagotchi #pwnlog #pwnlife #hacktheplanet #skynet').format(
duration=log.duration_human,
deauthed=log.deauthed,
associated=log.associated,
handshakes=log.handshakes)
duration=last_session.duration_human,
deauthed=last_session.deauthed,
associated=last_session.associated,
handshakes=last_session.handshakes)
def hhmmss(self, count, fmt):
if count > 1: