mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2026-04-04 22:07:45 +00:00
some refactorings
This commit is contained in:
parent
45062bd888
commit
4f389723c0
9 changed files with 67 additions and 85 deletions
54
boswatch/utils/misc.py
Normal file
54
boswatch/utils/misc.py
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
"""!
|
||||
____ ____ ______ __ __ __ _____
|
||||
/ __ )/ __ \/ ___/ | / /___ _/ /______/ /_ |__ /
|
||||
/ __ / / / /\__ \| | /| / / __ `/ __/ ___/ __ \ /_ <
|
||||
/ /_/ / /_/ /___/ /| |/ |/ / /_/ / /_/ /__/ / / / ___/ /
|
||||
/_____/\____//____/ |__/|__/\__,_/\__/\___/_/ /_/ /____/
|
||||
German BOS Information Script
|
||||
by Bastian Schroll
|
||||
|
||||
@file: misc.py
|
||||
@date: 11.03.2019
|
||||
@author: Bastian Schroll
|
||||
@description: Some misc functions
|
||||
"""
|
||||
import logging
|
||||
from boswatch import version
|
||||
|
||||
logging.debug("- %s loaded", __name__)
|
||||
|
||||
|
||||
def addClientDataToPacket(bwPacket, config):
|
||||
"""!Add the client information to the decoded data
|
||||
|
||||
This function adds the following data to the bwPacket:
|
||||
- clientName
|
||||
- clientVersion
|
||||
- clientBuildDate
|
||||
- clientBranch
|
||||
- inputSource
|
||||
- frequency"""
|
||||
logging.debug("add client data to bwPacket")
|
||||
bwPacket.set("clientName", config.get("client", "name"))
|
||||
bwPacket.set("clientVersion", version.client)
|
||||
bwPacket.set("clientBuildDate", version.date)
|
||||
bwPacket.set("clientBranch", version.branch)
|
||||
bwPacket.set("inputSource", config.get("client", "inoutSource"))
|
||||
bwPacket.set("frequency", config.get("inputSource", "sdr", "frequency"))
|
||||
|
||||
|
||||
def addServerDataToPacket(bwPacket, config):
|
||||
"""!Add the server information to the decoded data
|
||||
|
||||
This function adds the following data to the bwPacket:
|
||||
- serverName
|
||||
- serverVersion
|
||||
- serverBuildDate
|
||||
- serverBranch"""
|
||||
logging.debug("add server data to bwPacket")
|
||||
bwPacket.set("serverName", config.get("server", "name"))
|
||||
bwPacket.set("serverVersion", version.server)
|
||||
bwPacket.set("serverBuildDate", version.date)
|
||||
bwPacket.set("serverBranch", version.branch)
|
||||
Loading…
Add table
Add a link
Reference in a new issue