little adds and changes

This commit is contained in:
Bastian Schroll 2018-01-07 23:41:52 +01:00
parent b275abd86f
commit f64a521bd9
3 changed files with 8 additions and 5 deletions

View file

@ -32,7 +32,7 @@ class Descriptor:
self._lists = {} self._lists = {}
def loadDescription(self, csvType): def loadDescription(self, csvType):
"""!Build a new description list """!Build a new description list from DescriptionList class
@param csvType: Name of the CSV file without `.csv` @param csvType: Name of the CSV file without `.csv`
@return True or False""" @return True or False"""
@ -55,7 +55,7 @@ class Descriptor:
bwPacket.setField("longDescription", bwPacket.setField("longDescription",
self._lists[bwPacket.getField("mode")].getLongDescription(bwPacket.getField(bwPacket.getField("mode")))) self._lists[bwPacket.getField("mode")].getLongDescription(bwPacket.getField(bwPacket.getField("mode"))))
return True return True
except: except: # pragma: no cover
logging.exception("error while adding descriptions") logging.exception("error while adding descriptions")
return False return False

View file

@ -32,7 +32,10 @@ def createIfNotExist(dirPath):
@param dirName: Path of the directory @param dirName: Path of the directory
@return Path of the directory""" @return Path of the directory"""
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)
except:
logging.exception("error by creating a directory: %s", dirPath)
return dirPath return dirPath

BIN
logo/dev.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB