You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2018/05/23 19:37:33 UTC

[incubator-ponymail] branch master updated: Use common config parser module

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail.git


The following commit(s) were added to refs/heads/master by this push:
     new 172ba61  Use common config parser module
172ba61 is described below

commit 172ba61d357f855afde0b9a8e430a94dbd3a8df1
Author: Sebb <se...@apache.org>
AuthorDate: Wed May 23 20:37:32 2018 +0100

    Use common config parser module
---
 tools/archiver.py    | 6 ++----
 tools/import-mbox.py | 6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/tools/archiver.py b/tools/archiver.py
index 03f13e4..5659587 100755
--- a/tools/archiver.py
+++ b/tools/archiver.py
@@ -50,7 +50,7 @@ from collections import namedtuple
 import re
 from base64 import standard_b64encode
 import chardet
-import configparser
+from ponymailconfig import PonymailConfig
 import os
 import fnmatch
 import logging
@@ -62,9 +62,7 @@ import json
 import certifi
 
 # Fetch config
-path = os.path.dirname(os.path.realpath(__file__))
-config = configparser.RawConfigParser()
-config.read("%s/ponymail.cfg" % path)
+config = PonymailConfig()
 auth = None
 parseHTML = False
 iBody = None  # N.B. Also used by import-mbox.py
diff --git a/tools/import-mbox.py b/tools/import-mbox.py
index ffb5444..8fab50e 100755
--- a/tools/import-mbox.py
+++ b/tools/import-mbox.py
@@ -26,7 +26,7 @@ import mailbox
 import email.errors, email.utils, email.header
 from urllib.request import urlopen
 import re
-import configparser
+from ponymailconfig import PonymailConfig
 import argparse
 from os import listdir
 from os.path import isfile, join, isdir
@@ -80,9 +80,7 @@ dedupped = 0
 noMboxo = False # Don't skip MBoxo patch
 
 # Fetch config
-path = os.path.dirname(os.path.realpath(__file__))
-config = configparser.RawConfigParser()
-config.read("%s/ponymail.cfg" % path)
+config = PonymailConfig()
 auth = None
 if config.has_option('elasticsearch', 'user'):
     auth = (config.get('elasticsearch','user'), config.get('elasticsearch','password'))

-- 
To stop receiving notification emails like this one, please contact
sebb@apache.org.