mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2026-01-08 17:40:07 +01:00
DescriptionList: support functionchar while loading ids/rics
This commit is contained in:
parent
58b3158e9a
commit
5ccd6d8cc0
|
|
@ -11,6 +11,7 @@ Function to expand the dataset with a description.
|
|||
|
||||
import logging # Global logger
|
||||
import csv # for loading the description files
|
||||
import re # for matching IDs with a regular expression
|
||||
|
||||
from includes import globalVars # Global variables
|
||||
from includes.helper import stringConverter
|
||||
|
|
@ -41,8 +42,8 @@ def loadCSV(typ, idField):
|
|||
reader = csv.DictReader(csvfile)
|
||||
for row in reader:
|
||||
logging.debug(row)
|
||||
# only import rows with an integer as id
|
||||
if row[idField].isdigit() == True:
|
||||
# only import rows with an integer as id, allow subrics though
|
||||
if re.match("^[0-9]+[A-D]?$", idField, re.IGNORECASE):
|
||||
try:
|
||||
resultList[row[idField]] = stringConverter.convertToUTF8(row['description'])
|
||||
except:
|
||||
|
|
|
|||
Loading…
Reference in a new issue