summaryrefslogtreecommitdiffstats
path: root/ocrloader.py
diff options
context:
space:
mode:
Diffstat (limited to 'ocrloader.py')
-rw-r--r--ocrloader.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/ocrloader.py b/ocrloader.py
index 3ce9ea0..2120e94 100644
--- a/ocrloader.py
+++ b/ocrloader.py
@@ -11,6 +11,14 @@ import sys
import tempfile
import time
+import argparse
+parser = argparse.ArgumentParser()
+parser.add_argument('--config', default='ocrloader.ini')
+args = parser.parse_args()
+
+config_filepath = args.config
+
+
import logging
logging.basicConfig(level=logging.DEBUG)
def process(cfg, filename, payload, enable_ocr=True):
@@ -73,7 +81,7 @@ def process(cfg, filename, payload, enable_ocr=True):
while True:
cfg = ConfigParser.ConfigParser()
- cfg.read('ocrloader.ini')
+ cfg.read(config_filepath)
for section in cfg.sections():
print 'processing', section
imap_server = cfg.get(section, 'imap_server')