From 66d411c97ba82bfe3b072b57d2b7f8a6554723d6 Mon Sep 17 00:00:00 2001 From: Jinwei Zhao Date: Tue, 31 Jan 2017 08:35:05 +0800 Subject: format --- ingrex/intel.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ingrex/intel.py') diff --git a/ingrex/intel.py b/ingrex/intel.py index f13b2a2..506c6bc 100755 --- a/ingrex/intel.py +++ b/ingrex/intel.py @@ -2,7 +2,7 @@ import requests import re import json -import os + class Intel(object): "main class with all Intel functions" @@ -43,7 +43,7 @@ class Intel(object): count = 0 while count < 3: try: - request = self.session.post(url, data=json.dumps(payload), headers=self.headers) + request = self.session.post(url, data=json.dumps(payload), headers=self.headers, timeout=600) return request.json()['result'] except requests.ConnectionError: raise IntelError @@ -132,10 +132,12 @@ class Intel(object): } return self.fetch(url, payload) + class IntelError(BaseException): """Intel Error""" pass + class CookieError(IntelError): """Intel Error""" pass -- cgit v1.2.3