Repository: incubator-ponymail Updated Branches: refs/heads/master cce4e09a0 -> 4e4266b6b
Don't change working directory unnecessarily Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/4e4266b6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/4e4266b6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/4e4266b6 Branch: refs/heads/master Commit: 4e4266b6b62469a216dcd19f0536be5ec15ea92d Parents: cce4e09 Author: Sebb <[email protected]> Authored: Tue Nov 1 17:24:27 2016 +0000 Committer: Sebb <[email protected]> Committed: Tue Nov 1 17:24:27 2016 +0000 ---------------------------------------------------------------------- tools/import-mbox.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/4e4266b6/tools/import-mbox.py ---------------------------------------------------------------------- diff --git a/tools/import-mbox.py b/tools/import-mbox.py index 0a37d0d..d464875 100755 --- a/tools/import-mbox.py +++ b/tools/import-mbox.py @@ -45,10 +45,6 @@ except: print("Sorry, you need to install the elasticsearch and formatflowed modules from pip first.") sys.exit(-1) -# change working directory to location of this script - -os.chdir(os.path.dirname(os.path.abspath(__file__))) - y = 0 baddies = 0 block = Lock() @@ -78,8 +74,9 @@ dedup = False dedupped = 0 # Fetch config +path = os.path.dirname(os.path.realpath(__file__)) config = configparser.RawConfigParser() -config.read('ponymail.cfg') +config.read("%s/ponymail.cfg" % path) auth = None if config.has_option('elasticsearch', 'user'): auth = (config.get('elasticsearch','user'), config.get('elasticsearch','password'))
