mirror of
https://github.com/lilydjwg/nvchecker.git
synced 2025-03-10 06:14:02 +00:00
mypy might prefer this
This commit is contained in:
parent
281fdf6e57
commit
4bb07a4586
1 changed files with 3 additions and 4 deletions
|
@ -109,13 +109,12 @@ def cmp() -> None:
|
||||||
diff = {
|
diff = {
|
||||||
'name': name,
|
'name': name,
|
||||||
'oldver': oldver,
|
'oldver': oldver,
|
||||||
'newver': newver,
|
'newver': newver
|
||||||
'delta': 'equal' # hoping to satisfy mypy
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if oldver is not None and newver is not None:
|
if oldver is not None and newver is not None:
|
||||||
if oldver == newver:
|
if oldver == newver:
|
||||||
pass # diff['delta'] = 'equal'
|
diff['delta'] = 'equal'
|
||||||
|
|
||||||
elif args.sort == "none":
|
elif args.sort == "none":
|
||||||
diff['delta'] = 'new' # assume it's a new version if we're not comparing
|
diff['delta'] = 'new' # assume it's a new version if we're not comparing
|
||||||
|
@ -179,6 +178,6 @@ def cmp() -> None:
|
||||||
}
|
}
|
||||||
|
|
||||||
for diff in differences:
|
for diff in differences:
|
||||||
style = diffstyles[diff['delta']]
|
style = diffstyles[diff.get('delta', 'equal')]
|
||||||
|
|
||||||
print(f'{diff["name"]} {style["oldc"]}{diff["oldver"]}{c.normal} {style["symbol"]} {c.green}{diff["newver"]}{c.normal}')
|
print(f'{diff["name"]} {style["oldc"]}{diff["oldver"]}{c.normal} {style["symbol"]} {c.green}{diff["newver"]}{c.normal}')
|
||||||
|
|
Loading…
Add table
Reference in a new issue