Skip to content

Commit

Permalink
FIx mysql module
Browse files Browse the repository at this point in the history
  • Loading branch information
twkrol committed Feb 3, 2020
1 parent 74533f9 commit 586bec4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
14 changes: 5 additions & 9 deletions servers/mysql.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- encoding: utf-8 -*-
# Copyright (c) Tomasz Krol [email protected]
"""
Module to grab actual editions & versions of Nginx HTTP Server
Module to grab actual editions & versions of MySQL Server
"""
import copy
import urllib.request
Expand All @@ -11,7 +11,7 @@
from socket import error as SocketError
from socket import error
import errno
#from software import Softver

debug = False
product = "MySQL"

Expand All @@ -21,16 +21,12 @@ def __getMysqlReleaseDate(edition, version):
req = urllib.request.Request("https://dev.mysql.com/doc/relnotes/mysql/"+edition+"/en/", None, headers)
try:
body = urllib.request.urlopen(req).read()
# except error as e:
except error:
# except SocketError as e:
# if e.errno != errno.ECONNRESET:
# raise
print("Problem z połączeniem do dev.mysql.com")
print("Error connecting to dev.mysql.com")
raise

soup = BeautifulSoup(body, "html5lib")
dts = soup.find('dl', {"id": "tocdetail"}).find_all("dt")
dts = soup.find('dl', {"class": "toc"}).find_all("dt")
for dt in dts:
#print("__getMysqlReleaseDate:dt.find:", dt) if debug else None

Expand All @@ -40,7 +36,7 @@ def __getMysqlReleaseDate(edition, version):
if value:
return datetime.strptime(value.group(), '%Y-%m-%d').date()
else:
#czasami jest release ale jeszcze nie ma changeloga z datą, więc wpisujemy dzisiejszą datę releasu
#sometimes a release was published but without changelog so we put today instead
return datetime.now().date()


Expand Down
4 changes: 2 additions & 2 deletions start.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
from datetime import datetime, date
import vergrabber

__version__ = '3.3.2'
__version__ = '3.3.3'
__author__ = 'Tomasz Krol'
__author_email__ = '[email protected]'

debug = False
debug_module = None
# debug = True
# debug_module = 'veracrypt'
# debug_module = 'mysql'

def dumper(obj):
if isinstance(obj, date) or isinstance(obj, datetime):
Expand Down

0 comments on commit 586bec4

Please sign in to comment.