Cleanup code (#37)
* [apple,distrowatch,pypi] Remove unused imports * [maven] use snake_case for variable names * [eks,palo-alto-networks] Rename variables shadowing names from outer scopes * [eks,palo-alto-networks] Remove unused variables * [apple,haproxy,palo-alto-networks,rhel,ros,unrealircd] Rename variables shadowing built-in names
This commit is contained in:
@@ -6,7 +6,7 @@ import urllib.request
|
||||
URL = "https://www.unrealircd.org/docwiki/index.php?title=History_of_UnrealIRCd_releases&action=raw"
|
||||
REGEX = r"^(?:(\d+\.(?:\d+\.)*\d+))$"
|
||||
|
||||
list = {}
|
||||
versions = {}
|
||||
with urllib.request.urlopen(URL) as response:
|
||||
text = response.read()
|
||||
wikicode = mwparserfromhell.parse(text)
|
||||
@@ -17,8 +17,8 @@ with urllib.request.urlopen(URL) as response:
|
||||
if re.match(REGEX, maybe_version):
|
||||
maybe_date = items[1].__strip__()
|
||||
if re.match(r"\d{4}-\d{2}-\d{2}", maybe_date):
|
||||
list[maybe_version] = maybe_date
|
||||
versions[maybe_version] = maybe_date
|
||||
|
||||
|
||||
with open("releases/unrealircd.json", "w") as f:
|
||||
f.write(json.dumps(list, indent=2))
|
||||
f.write(json.dumps(versions, indent=2))
|
||||
|
||||
Reference in New Issue
Block a user