Skip to content
Snippets Groups Projects
Commit 562edc01 authored by Jiří Kalvoda's avatar Jiří Kalvoda
Browse files

client_config

parent 14845ba2
No related branches found
No related tags found
No related merge requests found
...@@ -6,3 +6,5 @@ ...@@ -6,3 +6,5 @@
*~ *~
*.swp *.swp
__pycache__ __pycache__
/prog/client_config.py
...@@ -164,7 +164,7 @@ Pak už stačí jen spustit příslušné servery. V `systemd/init.sh` je script ...@@ -164,7 +164,7 @@ Pak už stačí jen spustit příslušné servery. V `systemd/init.sh` je script
Pro běh klienta je nutné nainstalovat python, QGis (pyqgis), Qt5 (PyQt), python-cbor2, python-qasync, python-matplotlib a zstd. Pro běh klienta je nutné nainstalovat python, QGis (pyqgis), Qt5 (PyQt), python-cbor2, python-qasync, python-matplotlib a zstd.
Dále je nutné mít přístup na server, ten se konfiguruje v `prog/client-config.py` (vzor v `prog/client-config.py.example`). Dále je nutné mít přístup na server, ten se konfiguruje v `prog/client_config.py` (vzor v `prog/client_config.py.example`).
Klient se spouští pomocí `prog/main.py`. Klient se spouští pomocí `prog/main.py`.
......
import communication
communication.debug = True
# Enable communication debuging
c = None
async def get_communication():
# This function must return communication.MainServer connected to your server
# Multiple calls to this function should return the same connection
global c
cmd='ssh jr@externalArch.jk.dyn.blatto.eu /mnt/jr/jr/prog/run_py server.py'
socket = await communication.SSHRunSocket().connect(cmd)
c = communication.MainServer(socket)
return c
...@@ -28,6 +28,9 @@ import gtfs ...@@ -28,6 +28,9 @@ import gtfs
import math import math
import client_config
from client_config import get_communication
window_title_prefix = "PID realtime" window_title_prefix = "PID realtime"
...@@ -112,12 +115,7 @@ def no_space(lay): ...@@ -112,12 +115,7 @@ def no_space(lay):
communications = {}
async def get_communication(cmd='ssh jr@rpi0.jk.dyn.blatto.eu /aux/jr/prog/run_py server.py'):
if cmd not in communications:
s = await communication.SSHRunSocket().connect(cmd)
communications[cmd] = communication.MainServer(s)
return communications[cmd]
async def gtfs_default_data_getter(date, filename): async def gtfs_default_data_getter(date, filename):
c = await get_communication() c = await get_communication()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment