added makefile and pipefile updates

This commit is contained in:
Martin Slot 2022-06-22 19:54:27 +02:00
parent cbf0375f8b
commit 9459a820ea
3 changed files with 43 additions and 3 deletions

26
Makefile Normal file
View File

@ -0,0 +1,26 @@
##
# statusd makefile
#
# @file
# @version 0.1
.PHONY: build-dev run-server run-client run-gui-test
build-dev:
PIPENV_PIPFILE=statusd_server/Pipfile pipenv install
PIPENV_PIPFILE=test_client/Pipfile pipenv install
PIPENV_PIPFILE=statusd_server/Pipfile pipenv run protoc --python_betterproto_out statusd_server/proto messages.proto
PIPENV_PIPFILE=test_client/Pipfile pipenv run protoc --python_betterproto_out test_client/proto messages.proto
run-server:
PIPENV_PIPFILE=statusd_server/Pipfile pipenv run python -m statusd_server
run-client:
PIPENV_PIPFILE=test_client/Pipfile pipenv run python -m test_client
run-gui-test:
PIPENV_PIPFILE=statusd_server/Pipfile pipenv run python -m statusd_server &
sleep 2000
PIPENV_PIPFILE=test_client/Pipfile pipenv run python -m test_client
sleep 2000
pkill $!

11
Pipfile Normal file
View File

@ -0,0 +1,11 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
[dev-packages]
[requires]
python_version = "3.10"

View File

@ -8,6 +8,7 @@ import matplotlib.pyplot as plt
from datetime import datetime
from tkinter.constants import RAISED
from statusd_server.converters import Converter
from statusd_server.models import Cpu
from statusd_server import server
@ -41,7 +42,9 @@ class Gui:
root.update()
while True:
item = self.queue.get()
var.set(str(item.value))
label.pack()
root.update()
if type(item) is Cpu:
var.set(str(item.value))
label.pack()
root.update()
self.queue.task_done()