summaryrefslogtreecommitdiff
path: root/Biz/Que
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2024-12-01 21:46:29 -0500
committerBen Sima <ben@bsima.me>2024-12-21 10:08:01 -0500
commitaafa73c47325185ed733da387c9649d934f6529c (patch)
treebc2e180afa7151b736a02a37701b731baf9ce795 /Biz/Que
parent2ed757bc8c60fad0f2bf9d07478e2a287b7e24aa (diff)
Test Python code with bild --test
I had forgotten to add this feature, apparently, so bild --test just didn't do the test part.
Diffstat (limited to 'Biz/Que')
-rw-r--r--Biz/Que/Client.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/Biz/Que/Client.py b/Biz/Que/Client.py
index 9620c5e..ccbb980 100644
--- a/Biz/Que/Client.py
+++ b/Biz/Que/Client.py
@@ -215,21 +215,26 @@ def get_args() -> argparse.Namespace:
return cli.parse_args()
-if __name__ == "__main__":
- ARGV = get_args()
- if ARGV.test:
+def main() -> None:
+ """Entrypoint."""
+ argv = get_args()
+ if argv.test:
sys.stdout.write("ok\n")
sys.exit()
- if ARGV.debug:
+ if argv.debug:
logging.basicConfig(
format="%(asctime)s: %(levelname)s: %(message)s",
level=logging.DEBUG,
datefmt="%Y.%m.%d..%H.%M.%S",
)
try:
- if ARGV.infile:
- send(ARGV)
+ if argv.infile:
+ send(argv)
else:
- recv(ARGV)
+ recv(argv)
except KeyboardInterrupt:
sys.exit(0)
+
+
+if __name__ == "__main__":
+ main()