ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [incubator-ponymail] branch master updated: pylint: id is a built-in; unused import etc
Date Sun, 20 May 2018 13:24:21 GMT
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 <sebb@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.

Mime
View raw message