Skip to content

Commit

Permalink
REFACTOR: improve type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
mgmax committed Jan 28, 2024
1 parent a40ca37 commit 8c1869d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion FabLabKasse/shopping/backend/legacy_offline_kassenbuch.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import logging
import contextlib # for "caching" the json
import os
from typing import Tuple


def load_json_from_url(url):
Expand Down Expand Up @@ -78,7 +79,7 @@ def download_with_fallback(url):
yield f


def load_categories_from_web(cfg) -> (list[Category], int):
def load_categories_from_web(cfg) -> Tuple[list[Category], int]:
"""
Download and parse list of categories
Expand Down
4 changes: 2 additions & 2 deletions FabLabKasse/test_kassenbuch.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ def call_kb(command: str) -> str:
path_to_here + "/kassenbuch.py",
"--ensure-dummy-db",
] + command.split(" ")
cmd = [x.encode("UTF-8") for x in cmd]
result = subprocess.run(cmd, encoding="UTF-8", capture_output=True)
cmd_bytes = [x.encode("UTF-8") for x in cmd]
result = subprocess.run(cmd_bytes, encoding="UTF-8", capture_output=True)
self.assertEqual(result.returncode, 0, "Command failed: " + repr(result))
return result.stdout

Expand Down
4 changes: 2 additions & 2 deletions FabLabKasse/tools/dummy-printserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
if not data:
print("\n\n========= client disconnected =======\n\n")
break
data = data.decode("ascii", errors="replace")
sys.stdout.write(data)
data_decoded = data.decode("ascii", errors="replace")
sys.stdout.write(data_decoded)
sys.stdout.flush()
2 changes: 1 addition & 1 deletion install_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install git
# Python3 stuff
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install python3-pip python3 python3-dateutil python3-lxml python3-termcolor python3-serial python3-qrcode python3-docopt python3-requests python3-simplejson python3-sphinx
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install python3-qtpy python3-pyqt5 pyqt5-dev-tools
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install python3-qtpy python3-pyqt5 pyqt5-dev-tools mypy
sudo python3 -m pip install -r requirements.txt
# Dependencies only for Testing / Vagrant automation (dummy printserver / dummy FAUCard device)
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install psmisc socat
Expand Down

0 comments on commit 8c1869d

Please sign in to comment.