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/20 13:24:21 UTC

[incubator-ponymail] branch master updated: pylint: id is a built-in; unused import etc

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 6713a92  pylint: id is a built-in; unused import etc
6713a92 is described below

commit 6713a92ee3654229fe5a12300f53d7a03f5d7d07
Author: Sebb <se...@apache.org>
AuthorDate: Sun May 20 14:24:19 2018 +0100

    pylint: id is a built-in; unused import etc
---
 tools/push-failures.py | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/tools/push-failures.py b/tools/push-failures.py
index e2b4b15..a4c57b5 100755
--- a/tools/push-failures.py
+++ b/tools/push-failures.py
@@ -19,7 +19,6 @@
 """
 
 import sys
-import time
 import configparser
 import argparse
 import json
@@ -27,9 +26,9 @@ import os
 import certifi
 
 try:
-    from elasticsearch import Elasticsearch, helpers
-except:
-    print("Sorry, you need to install the elasticsearch and formatflowed modules from pip first.")
+    from elasticsearch import Elasticsearch
+except ImportError:
+    print("Sorry, you need to install the elasticsearch module from pip first.")
     sys.exit(-1)
 
 
@@ -71,20 +70,20 @@ for f in files:
         ojson = json.load(f)
         if 'mbox' in ojson and 'mbox_source' in ojson:
             try:
-                id = ojson['id']
+                mid = ojson['id']
             except KeyError:
-                id = ojson['mbox']['mid']
+                mid = ojson['mbox']['mid']
             es.index(
                 index=dbname,
                 doc_type="mbox",
-                id=id,
+                id=mid,
                 body = ojson['mbox']
             )
             
             es.index(
                 index=dbname,
                 doc_type="mbox_source",
-                id=id,
+                id=mid,
                 body = ojson['mbox_source']
             )
             

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