mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
hotfix for callsigns without missing ssid
This commit is contained in:
parent
7c40067eab
commit
2e66d3d836
3 changed files with 7 additions and 30 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "FreeDATA",
|
"name": "FreeDATA",
|
||||||
"version": "0.0.1-alpha.12",
|
"version": "v0.0.1-alpha.14",
|
||||||
"description": "FreeDATA ",
|
"description": "FreeDATA ",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -160,31 +160,3 @@ def bytes_to_callsign(bytestring):
|
||||||
|
|
||||||
return bytes(callsign)
|
return bytes(callsign)
|
||||||
|
|
||||||
'''
|
|
||||||
def setup_logging():
|
|
||||||
"""
|
|
||||||
Author: DJ2LS
|
|
||||||
|
|
||||||
Set the custom logging format so we can use colors
|
|
||||||
|
|
||||||
# https://stackoverflow.com/questions/384076/how-can-i-color-python-logging-output
|
|
||||||
# 'DEBUG' : 37, # white
|
|
||||||
# 'INFO' : 36, # cyan
|
|
||||||
# 'WARNING' : 33, # yellow
|
|
||||||
# 'ERROR' : 31, # red
|
|
||||||
# 'CRITICAL': 41, # white on red bg
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
logging.basicConfig(level=logging.INFO,encoding='utf-8',format='%(asctime)s.%(msecs)03d %(levelname)s:\t%(message)s',datefmt='%H:%M:%S',handlers=[logging.FileHandler("FreeDATA-TNC.log"), logging.StreamHandler()])
|
|
||||||
|
|
||||||
logging.addLevelName(logging.DEBUG, "\033[1;36m%s\033[1;0m" % logging.getLevelName(logging.DEBUG))
|
|
||||||
logging.addLevelName(logging.INFO, "\033[1;37m%s\033[1;0m" % logging.getLevelName(logging.INFO))
|
|
||||||
logging.addLevelName(logging.WARNING, "\033[1;33m%s\033[1;0m" % logging.getLevelName(logging.WARNING))
|
|
||||||
logging.addLevelName(logging.ERROR, "\033[1;31m%s\033[1;0m" % "FAILED")
|
|
||||||
#logging.addLevelName( logging.ERROR, "\033[1;31m%s\033[1;0m" % logging.getLevelName(logging.ERROR))
|
|
||||||
logging.addLevelName(logging.CRITICAL, "\033[1;41m%s\033[1;0m" % logging.getLevelName(logging.CRITICAL))
|
|
||||||
|
|
||||||
logging.addLevelName(25, "\033[1;32m%s\033[1;0m" % "SUCCESS")
|
|
||||||
logging.addLevelName(24, "\033[1;34m%s\033[1;0m" % "DATA")
|
|
||||||
'''
|
|
||||||
|
|
|
@ -60,7 +60,12 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
ARGS = PARSER.parse_args()
|
ARGS = PARSER.parse_args()
|
||||||
|
|
||||||
static.MYCALLSIGN = bytes(ARGS.mycall, 'utf-8')
|
# additional step for beeing sure our callsign is correctly
|
||||||
|
# in case we are not getting a station ssid
|
||||||
|
# then we are forcing a station ssid = 0
|
||||||
|
mycallsign = bytes(ARGS.mycall.upper(), 'utf-8')
|
||||||
|
mycallsign = helpers.callsign_to_bytes(mycallsign)
|
||||||
|
static.MYCALLSIGN = helpers.bytes_to_callsign(mycallsign)
|
||||||
static.MYCALLSIGN_CRC = helpers.get_crc_16(static.MYCALLSIGN)
|
static.MYCALLSIGN_CRC = helpers.get_crc_16(static.MYCALLSIGN)
|
||||||
|
|
||||||
static.MYGRID = bytes(ARGS.mygrid, 'utf-8')
|
static.MYGRID = bytes(ARGS.mygrid, 'utf-8')
|
||||||
|
|
Loading…
Reference in a new issue