returning the category or subcategory folder, if provided
This commit is contained in:
parent
f10abf3afa
commit
cf9c4994b1
|
@ -43,10 +43,14 @@ def get_categories_from_ocr_code(ocr_code, doctype):
|
|||
continue
|
||||
if line.count('|') == 2:
|
||||
code, category, subcategory = line.strip().split('|')
|
||||
folder = None
|
||||
if line.count('|') == 3:
|
||||
code, category, subcategory, folder = line.strip().split('|')
|
||||
subcategory = subcategory or None
|
||||
elif line.count('|') == 1:
|
||||
code, category = line.strip().split('|')
|
||||
subcategory = None
|
||||
subcategory, folder = None, None
|
||||
if code == ocr_code:
|
||||
return category, subcategory
|
||||
return category, subcategory, folder
|
||||
return None
|
||||
|
||||
|
|
Reference in New Issue