From cf9c4994b1edc520655c2c79958730ebcfb9e484 Mon Sep 17 00:00:00 2001 From: Serghei MIHAI Date: Wed, 20 Nov 2013 16:23:49 +0100 Subject: [PATCH] returning the category or subcategory folder, if provided --- themis/config/utils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/themis/config/utils.py b/themis/config/utils.py index 0985f67..77aa3a3 100644 --- a/themis/config/utils.py +++ b/themis/config/utils.py @@ -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