[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [gettor/master] Fix bug in email and twitter parser



commit 983dbbd6cbdeab7d179e65411f072a27f30730bf
Author: hiro <hiro@xxxxxxxxxxxxxx>
Date:   Wed Oct 16 12:53:15 2019 +0200

    Fix bug in email and twitter parser
---
 gettor/parse/email.py | 35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/gettor/parse/email.py b/gettor/parse/email.py
index 5abf856..fdeefba 100644
--- a/gettor/parse/email.py
+++ b/gettor/parse/email.py
@@ -150,6 +150,24 @@ class EmailParser(object):
 
         return request
 
+
+    def check_num_requests(self, request_id, hid, request_service, limit):
+        # check limit first
+        num_requests = limit
+
+        if hid.hexdigest() == self.settings.get('test_hid'):
+            num_requests = 1
+        else:
+            num_requests = yield conn.get_num_requests(
+                id=hid.hexdigest(), service=request_service
+            )
+
+        if num_requests[0][0] < email_requests_limit:
+            return 1
+        else:
+            return 0
+
+
     def parse(self, msg_str):
         """
         Parse message content. Check if email address is well formed, if DKIM
@@ -198,23 +216,6 @@ class EmailParser(object):
         return request
 
 
-    def check_num_requests(self, request_id, hid, request_service, limit):
-        # check limit first
-        num_requests = limit
-
-        if hid.hexdigest() == self.settings.get('test_hid'):
-            num_requests = 1
-        else:
-            num_requests = yield conn.get_num_requests(
-                id=hid.hexdigest(), service=request_service
-            )
-
-        if num_requests[0][0] < email_requests_limit:
-            return 1
-        else:
-            return 0
-
-
     @defer.inlineCallbacks
     def parse_callback(self, request):
         """

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits