-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
7 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -11,7 +11,7 @@ | |
from socket import error as SocketError | ||
from socket import error | ||
import errno | ||
#from software import Softver | ||
|
||
debug = False | ||
product = "MySQL" | ||
|
||
|
@@ -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 | ||
|
||
|
@@ -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() | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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): | ||
|