From 6950a8bf75687789586ddae67d88a62e793af568 Mon Sep 17 00:00:00 2001 From: Mark Ruys Date: Wed, 11 Jan 2017 11:12:37 +0100 Subject: [PATCH] Shorten API timeout --- gw2pvo/average.py | 5 +++++ gw2pvo/gw_api.py | 7 ++++++- gw2pvo/gw_csv.py | 5 +++++ gw2pvo/gw_scraper.py | 2 ++ gw2pvo/pvo_api.py | 7 ++++++- 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/gw2pvo/average.py b/gw2pvo/average.py index 9634af6..6da386b 100644 --- a/gw2pvo/average.py +++ b/gw2pvo/average.py @@ -1,5 +1,10 @@ import logging +__author__ = "Mark Ruys" +__copyright__ = "Copyright 2017, Mark Ruys" +__license__ = "MIT" +__email__ = "mark@paracas.nl" + class MovingAverage: def __init__(self, n): diff --git a/gw2pvo/gw_api.py b/gw2pvo/gw_api.py index 470f359..ef3fdaf 100644 --- a/gw2pvo/gw_api.py +++ b/gw2pvo/gw_api.py @@ -3,6 +3,11 @@ import datetime import requests +__author__ = "Mark Ruys" +__copyright__ = "Copyright 2017, Mark Ruys" +__license__ = "MIT" +__email__ = "mark@paracas.nl" + class GoodWeApi: def __init__(self, system_id): @@ -86,7 +91,7 @@ def call(self, url, payload): return json except requests.exceptions.RequestException as exp: logging.warning(exp) - time.sleep(30) + time.sleep(3) else: logging.error("Failed to call GoodWe API") diff --git a/gw2pvo/gw_csv.py b/gw2pvo/gw_csv.py index dc54ab8..5fef62b 100644 --- a/gw2pvo/gw_csv.py +++ b/gw2pvo/gw_csv.py @@ -2,6 +2,11 @@ import datetime import csv +__author__ = "Mark Ruys" +__copyright__ = "Copyright 2017, Mark Ruys" +__license__ = "MIT" +__email__ = "mark@paracas.nl" + class GoodWeCSV: def __init__(self, filename): diff --git a/gw2pvo/gw_scraper.py b/gw2pvo/gw_scraper.py index 35a5431..400adc9 100644 --- a/gw2pvo/gw_scraper.py +++ b/gw2pvo/gw_scraper.py @@ -3,6 +3,8 @@ import time from html.parser import HTMLParser +# Deprecated +# # Note that this file is not used anymore as the JSON variant is more reliable. class GwHTMLParser(HTMLParser): diff --git a/gw2pvo/pvo_api.py b/gw2pvo/pvo_api.py index c2a1521..fe46d07 100644 --- a/gw2pvo/pvo_api.py +++ b/gw2pvo/pvo_api.py @@ -2,6 +2,11 @@ import time import requests +__author__ = "Mark Ruys" +__copyright__ = "Copyright 2017, Mark Ruys" +__license__ = "MIT" +__email__ = "mark@paracas.nl" + class PVOutputApi: def __init__(self, system_id, api_key): @@ -67,7 +72,7 @@ def call(self, url, payload): break except requests.exceptions.RequestException as arg: logging.warning(arg) - time.sleep(30) + time.sleep(3) else: logging.error("Failed to call PVOutput API")