mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2026-03-18 10:44:46 +01:00
fix some typos and other
This commit is contained in:
parent
0c7fc84089
commit
6e011301d4
|
|
@ -63,7 +63,7 @@ class Fms:
|
||||||
bwPacket.set("vehicle", vehicle)
|
bwPacket.set("vehicle", vehicle)
|
||||||
bwPacket.set("status", status)
|
bwPacket.set("status", status)
|
||||||
bwPacket.set("direction", direction)
|
bwPacket.set("direction", direction)
|
||||||
bwPacket.set("cirectionText", directionText)
|
bwPacket.set("directionText", directionText)
|
||||||
bwPacket.set("tacticalInfo", tacticalInfo)
|
bwPacket.set("tacticalInfo", tacticalInfo)
|
||||||
|
|
||||||
logging.debug(bwPacket)
|
logging.debug(bwPacket)
|
||||||
|
|
|
||||||
|
|
@ -66,21 +66,21 @@ class DescriptionList:
|
||||||
logging.debug("create new descriptionList")
|
logging.debug("create new descriptionList")
|
||||||
self._descriptionList = {}
|
self._descriptionList = {}
|
||||||
|
|
||||||
def getShortDescription(self, id):
|
def getShortDescription(self, checkId):
|
||||||
"""!Returns the short description of given id
|
"""!Returns the short description of given id
|
||||||
|
|
||||||
@return short description or empty string"""
|
@return short description or empty string"""
|
||||||
try:
|
try:
|
||||||
return self._descriptionList[str(id)]["shortDescription"]
|
return self._descriptionList[str(checkId)]["shortDescription"]
|
||||||
except:
|
except:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
def getLongDescription(self, id):
|
def getLongDescription(self, checkId):
|
||||||
"""!Returns the long description of given id
|
"""!Returns the long description of given id
|
||||||
|
|
||||||
@return long description or empty string"""
|
@return long description or empty string"""
|
||||||
try:
|
try:
|
||||||
return self._descriptionList[str(id)]["longDescription"]
|
return self._descriptionList[str(checkId)]["longDescription"]
|
||||||
except:
|
except:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,9 @@ class TCPClient:
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
logging.error("cannot transmit - no connection established")
|
logging.error("cannot transmit - no connection established")
|
||||||
return False
|
return False
|
||||||
|
except ConnectionResetError:
|
||||||
|
logging.error("cannot transmit - host closed connection")
|
||||||
|
return False
|
||||||
except: # pragma: no cover
|
except: # pragma: no cover
|
||||||
logging.exception("error while transmitting")
|
logging.exception("error while transmitting")
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
|
|
@ -29,15 +29,20 @@ BIN_PATH = ROOT_PATH + "/_bin/"
|
||||||
TEST_PATH = ROOT_PATH + "/test/"
|
TEST_PATH = ROOT_PATH + "/test/"
|
||||||
|
|
||||||
|
|
||||||
def createIfNotExist(dirPath):
|
def ifFileExist(filePath):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def makeDirIfNotExist(dirPath):
|
||||||
"""!Checks if an directory is existing and create it if not
|
"""!Checks if an directory is existing and create it if not
|
||||||
|
|
||||||
@param dirPath: Path of the directory
|
@param dirPath: Path of the directory
|
||||||
@return Path of the directory"""
|
@return Path of the directory or False"""
|
||||||
try:
|
try:
|
||||||
if not os.path.exists(dirPath):
|
if not os.path.exists(dirPath):
|
||||||
os.mkdir(dirPath)
|
os.mkdir(dirPath)
|
||||||
logging.debug("directory created: %s", dirPath)
|
logging.debug("directory created: %s", dirPath)
|
||||||
|
return dirPath
|
||||||
except:
|
except:
|
||||||
logging.exception("error by creating a directory: %s", dirPath)
|
logging.exception("error by creating a directory: %s", dirPath)
|
||||||
return dirPath
|
return False
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue