Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
df-aggregator
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Oleksandr Barabash
df-aggregator
Commits
8b40c213
Commit
8b40c213
authored
Aug 06, 2023
by
Oleksandr Barabash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better filtering by station_ids
parent
1e905c5f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
app.py
app.py
+14
-5
No files found.
app.py
View file @
8b40c213
...
@@ -22,6 +22,7 @@ logger = logging.getLogger(__name__)
...
@@ -22,6 +22,7 @@ logger = logging.getLogger(__name__)
flags
.
DEFINE_string
(
'station_id'
,
None
,
"Station Id"
)
flags
.
DEFINE_string
(
'station_id'
,
None
,
"Station Id"
)
flags
.
DEFINE_list
(
'station_ids'
,
[],
'Station IDs'
)
flags
.
DEFINE_string
(
'file'
,
None
,
"File where to save the history"
)
flags
.
DEFINE_string
(
'file'
,
None
,
"File where to save the history"
)
...
@@ -123,11 +124,19 @@ def on_data_handler(packet_logger: PacketLogger):
...
@@ -123,11 +124,19 @@ def on_data_handler(packet_logger: PacketLogger):
# noinspection PyBroadException
# noinspection PyBroadException
try
:
try
:
kr_packet
=
KrPacketV2
.
load
(
message
,
unknown
=
EXCLUDE
)
kr_packet
=
KrPacketV2
.
load
(
message
,
unknown
=
EXCLUDE
)
station_id
=
flags
.
FLAGS
.
station_id
station_ids
=
flags
.
FLAGS
.
station_ids
if
station_id
is
None
or
\
if
len
(
station_ids
)
>
0
:
station_id
.
lower
()
==
kr_packet
.
station_id
.
lower
():
for
station_id
in
station_ids
:
logger
.
info
(
f
"{kr_packet}"
)
if
station_id
is
None
or
\
packet_logger
.
log
(
kr_packet
)
station_id
.
lower
()
==
kr_packet
.
station_id
.
lower
():
logger
.
info
(
f
"{kr_packet}"
)
packet_logger
.
log
(
kr_packet
)
else
:
station_id
=
flags
.
FLAGS
.
station_id
if
station_id
is
None
or
\
station_id
.
lower
()
==
kr_packet
.
station_id
.
lower
():
logger
.
info
(
f
"{kr_packet}"
)
packet_logger
.
log
(
kr_packet
)
except
Exception
:
except
Exception
:
logging
.
error
(
"handle_message: Error!"
,
exc_info
=
sys
.
exc_info
())
logging
.
error
(
"handle_message: Error!"
,
exc_info
=
sys
.
exc_info
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment