From ee9aaac7117390f00de426ca1dc0a15cd2777eec Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Wed, 29 Nov 2023 16:00:06 +0100 Subject: [PATCH] 2.5.6 Signed-off-by: Jeroen Oudshoorn --- pwnagotchi/_version.py | 2 +- pwnagotchi/bettercap.py | 2 +- pwnagotchi/plugins/default/auto-update.py | 2 +- pwnagotchi/ui/hw/__init__.py | 2 +- pwnagotchi/ui/hw/libs/waveshare/v4/epd2in13_V4.py | 5 +++-- pwnagotchi/ui/hw/waveshare213inb_v4.py | 3 ++- pwnagotchi/ui/hw/waveshare4.py | 6 +----- scripts/preview.py | 3 +-- 8 files changed, 11 insertions(+), 14 deletions(-) diff --git a/pwnagotchi/_version.py b/pwnagotchi/_version.py index 2e0d1870..5752f761 100644 --- a/pwnagotchi/_version.py +++ b/pwnagotchi/_version.py @@ -1 +1 @@ -__version__ = '2.5.5' +__version__ = '2.5.6' diff --git a/pwnagotchi/bettercap.py b/pwnagotchi/bettercap.py index d5752219..12a9ce8d 100644 --- a/pwnagotchi/bettercap.py +++ b/pwnagotchi/bettercap.py @@ -9,7 +9,7 @@ from time import sleep import pwnagotchi -requests.adapters.DEFAULT_RETRIES = 5 # increase retries number +requests.adapters.DEFAULT_RETRIES = 5 # increase retries number ping_timeout = 180 ping_interval = 15 diff --git a/pwnagotchi/plugins/default/auto-update.py b/pwnagotchi/plugins/default/auto-update.py index 65d633e1..a57eeac9 100644 --- a/pwnagotchi/plugins/default/auto-update.py +++ b/pwnagotchi/plugins/default/auto-update.py @@ -130,7 +130,7 @@ def install(display, update): logging.info("[update] stopping %s ..." % update['service']) os.system("service %s stop" % update['service']) - os.system("mv %s %s" % (source_path, dest_path)) + shutil.move(source_path, dest_path) os.chmod("/usr/local/bin/%s" % name, 0o755) logging.info("[update] restarting %s ..." % update['service']) os.system("service %s start" % update['service']) diff --git a/pwnagotchi/ui/hw/__init__.py b/pwnagotchi/ui/hw/__init__.py index 6968f025..e6cae5c7 100644 --- a/pwnagotchi/ui/hw/__init__.py +++ b/pwnagotchi/ui/hw/__init__.py @@ -56,7 +56,7 @@ def display_for(config): return Waveshare27inch(config) elif config['ui']['display']['type'] == 'waveshare27inchv2': - return Waveshare27inchv2(config) + return Waveshare27inchV2(config) elif config['ui']['display']['type'] == 'waveshare29inch': return Waveshare29inch(config) diff --git a/pwnagotchi/ui/hw/libs/waveshare/v4/epd2in13_V4.py b/pwnagotchi/ui/hw/libs/waveshare/v4/epd2in13_V4.py index a446e4cd..50c5394d 100644 --- a/pwnagotchi/ui/hw/libs/waveshare/v4/epd2in13_V4.py +++ b/pwnagotchi/ui/hw/libs/waveshare/v4/epd2in13_V4.py @@ -32,11 +32,12 @@ import logging from . import epdconfig # Display resolution -EPD_WIDTH = 122 -EPD_HEIGHT = 250 +EPD_WIDTH = 122 +EPD_HEIGHT = 250 logger = logging.getLogger(__name__) + class EPD: def __init__(self): self.reset_pin = epdconfig.RST_PIN diff --git a/pwnagotchi/ui/hw/waveshare213inb_v4.py b/pwnagotchi/ui/hw/waveshare213inb_v4.py index dfddb7f6..eaebf724 100644 --- a/pwnagotchi/ui/hw/waveshare213inb_v4.py +++ b/pwnagotchi/ui/hw/waveshare213inb_v4.py @@ -4,6 +4,7 @@ import pwnagotchi.ui.fonts as fonts from pwnagotchi.ui.hw.base import DisplayImpl from PIL import Image + class Waveshare213bV4(DisplayImpl): def __init__(self, config): super(Waveshare213bV4, self).__init__(config, 'waveshare213inb_v4') @@ -68,4 +69,4 @@ class Waveshare213bV4(DisplayImpl): self._display.display(buffer(imageBlack), buffer(imageRed)) def clear(self): - self._display.Clear() \ No newline at end of file + self._display.Clear() diff --git a/pwnagotchi/ui/hw/waveshare4.py b/pwnagotchi/ui/hw/waveshare4.py index 95ad74b7..35f1e2e8 100644 --- a/pwnagotchi/ui/hw/waveshare4.py +++ b/pwnagotchi/ui/hw/waveshare4.py @@ -2,7 +2,7 @@ import logging import pwnagotchi.ui.fonts as fonts from pwnagotchi.ui.hw.base import DisplayImpl -from PIL import Image + class WaveshareV4(DisplayImpl): def __init__(self, config): @@ -31,8 +31,6 @@ class WaveshareV4(DisplayImpl): } return self._layout - - def initialize(self): logging.info("initializing waveshare v4 display") from pwnagotchi.ui.hw.libs.waveshare.v4.epd2in13_V4 import EPD @@ -40,11 +38,9 @@ class WaveshareV4(DisplayImpl): self._display.init() self._display.Clear(0xFF) - def render(self, canvas): buf = self._display.getbuffer(canvas) self._display.displayPartial(buf) - def clear(self): self._display.Clear(0xFF) \ No newline at end of file diff --git a/scripts/preview.py b/scripts/preview.py index 4c717306..de043ce0 100755 --- a/scripts/preview.py +++ b/scripts/preview.py @@ -89,8 +89,7 @@ def main(): parser = argparse.ArgumentParser(description="This program emulates\ the pwnagotchi display") parser.add_argument('--displays', help="Which displays to use.", nargs="+", default=["waveshare_2"]) - parser.add_argument('--lang', help="Language to use", - default="en") + parser.add_argument('--lang', help="Language to use", default="en") parser.add_argument('--output', help="Path to output image (PNG)", default="preview.png") parser.add_argument('--show-peer', dest="showpeer", help="This options will show a dummy peer", action="store_true") parser.add_argument('--xmargin', help="Add X-Margin", type=int, default=5)