summaryrefslogtreecommitdiffstats
path: root/themis
diff options
context:
space:
mode:
authorSerghei MIHAI <smihai@entrouvert.com>2013-11-20 15:23:49 (GMT)
committerSerghei MIHAI <smihai@entrouvert.com>2013-11-20 15:23:49 (GMT)
commitcf9c4994b1edc520655c2c79958730ebcfb9e484 (patch)
tree5b5a78e106e9e43201e88ff798cf8ac6f3c2cded /themis
parentf10abf3afaeb3ff5ccb46f099585ec64d08585d4 (diff)
downloadthemis.config-cf9c4994b1edc520655c2c79958730ebcfb9e484.zip
themis.config-cf9c4994b1edc520655c2c79958730ebcfb9e484.tar.gz
themis.config-cf9c4994b1edc520655c2c79958730ebcfb9e484.tar.bz2
returning the category or subcategory folder, if providedHEADmaster
Diffstat (limited to 'themis')
-rw-r--r--themis/config/utils.py8
1 files 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