From 689741bcdfe2842bc9e8900c554e5e8eb42a0bc5 Mon Sep 17 00:00:00 2001
From: lukken <lukken@astron.nl>
Date: Sat, 25 Mar 2023 11:22:49 +0000
Subject: [PATCH] Install dependencies for docs

---
 .../toolkit/udp_simulator.py                  | 26 ++++++++++++-------
 tangostationcontrol/tox.ini                   |  1 +
 2 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/tangostationcontrol/tangostationcontrol/toolkit/udp_simulator.py b/tangostationcontrol/tangostationcontrol/toolkit/udp_simulator.py
index 26488aaf7..98dc26805 100644
--- a/tangostationcontrol/tangostationcontrol/toolkit/udp_simulator.py
+++ b/tangostationcontrol/tangostationcontrol/toolkit/udp_simulator.py
@@ -4,22 +4,28 @@
 import socket
 import time
 
-i = 1
-
 UDP_IP = "127.0.0.1"
 UDP_PORT = 5001
-MESSAGE = "{}".format(i)
 
-print(f"UDP target IP: {UDP_IP}")
-print(f"UDP target port: {UDP_PORT}")
 
-sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)  # create UDP socket
+def main():
+    message = "{}".format(i)
+    i = 1
+
+    print(f"UDP target IP: {UDP_IP}")
+    print(f"UDP target port: {UDP_PORT}")
+
+    sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)  # create UDP socket
 
-if __name__ == "__main__":
     while True:
-        sock.sendto(bytes(MESSAGE, "utf-8"), (UDP_IP, UDP_PORT))
+        sock.sendto(bytes(message, "utf-8"), (UDP_IP, UDP_PORT))
         i += 1
-        MESSAGE = "{}".format(i)
+        message = "{}".format(i)
 
-        # sleep for an arbitrary amount of time. Currently 0.2 settings for visual testing.
+        # sleep for an arbitrary amount of time. Currently 0.2 settings for
+        # visual testing.
         time.sleep(0.2)
+
+
+if __name__ == "__main__":
+    main()
diff --git a/tangostationcontrol/tox.ini b/tangostationcontrol/tox.ini
index a4c0c0549..fef359345 100644
--- a/tangostationcontrol/tox.ini
+++ b/tangostationcontrol/tox.ini
@@ -106,6 +106,7 @@ commands = {envpython} -m build
 envdir = {toxworkdir}/docs
 deps =
     -r{toxinidir}/../docker-compose/lofar-device-base/lofar-requirements.txt
+    -r{toxinidir}/requirements.txt
     -r{toxinidir}/docs/docs-requirements.txt
 commands =
     sphinx-build --version
-- 
GitLab