Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jiří Kalvoda
jr
Commits
562edc01
Commit
562edc01
authored
Jul 19, 2024
by
Jiří Kalvoda
Browse files
Options
Downloads
Patches
Plain Diff
client_config
parent
14845ba2
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+2
-0
2 additions, 0 deletions
.gitignore
dokumentace.md
+1
-1
1 addition, 1 deletion
dokumentace.md
prog/client_config.py.example
+15
-0
15 additions, 0 deletions
prog/client_config.py.example
prog/main.py
+4
-6
4 additions, 6 deletions
prog/main.py
with
22 additions
and
7 deletions
.gitignore
+
2
−
0
View file @
562edc01
...
@@ -6,3 +6,5 @@
...
@@ -6,3 +6,5 @@
*~
*~
*.swp
*.swp
__pycache__
__pycache__
/prog/client_config.py
This diff is collapsed.
Click to expand it.
dokumentace.md
+
1
−
1
View file @
562edc01
...
@@ -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`
.
...
...
This diff is collapsed.
Click to expand it.
prog/client_config.py.example
0 → 100644
+
15
−
0
View file @
562edc01
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
This diff is collapsed.
Click to expand it.
prog/main.py
+
4
−
6
View file @
562edc01
...
@@ -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
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment