From d3be1d938dbf943dc76d03dcd56ba3f333385568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Ostolski?= Date: Tue, 24 Mar 2020 22:50:38 +0100 Subject: [PATCH] poprawki w module propagacja --- .gitignore | 2 +- propagation_sq9atk.py | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 1cd4bce..53bc9fc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ *.pyc imgwpodest_data/* - +propagacja.png sr0wx.log diff --git a/propagation_sq9atk.py b/propagation_sq9atk.py index 057cf23..54b5ca2 100755 --- a/propagation_sq9atk.py +++ b/propagation_sq9atk.py @@ -1,7 +1,7 @@ #!/usr/bin/python -tt # -*- coding: utf-8 -*- -import urllib2 +import urllib import logging import socket @@ -37,19 +37,18 @@ class PropagationSq9atk(SR0WXModule): def rgb2hex(self, rgb): return '#%02x%02x%02x' % rgb - def downloadImage(self, url): try: self.__logger.info("::: OdpytujÄ™ adres: " + url) - webFile = urllib2.urlopen(url, None, 30) - return Image.open(webFile) + webFile = urllib.URLopener() + webFile.retrieve(url, "propagacja.png") + return Image.open("propagacja.png",'r') except urllib2.URLError, e: print e except socket.timeout: print "Timed out!" return "" - def collectBandConditionsFromImage(self, image, dayTime): imageData = image.load() data = list()