mirror of
https://gitlab.com/khumba/nvd.git
synced 2024-11-10 06:59:29 +01:00
Fix reference to undefined variable (issue #12), and fix some lint.
This commit is contained in:
parent
f87f29530b
commit
1bf9d1740d
2 changed files with 5 additions and 3 deletions
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
## 0.2.1 (unreleased)
|
## 0.2.1 (unreleased)
|
||||||
|
|
||||||
|
- Fixed reference to undefined variable in `StorePath` constructor (issue #12),
|
||||||
|
plus some code lint.
|
||||||
|
|
||||||
## 0.2.0 (2022-10-15)
|
## 0.2.0 (2022-10-15)
|
||||||
|
|
||||||
- Add display of the change in closure disk size (issue #8).
|
- Add display of the change in closure disk size (issue #8).
|
||||||
|
|
5
src/nvd
5
src/nvd
|
@ -43,7 +43,6 @@ import os.path
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
from collections import namedtuple
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from signal import SIGPIPE, SIG_DFL, signal
|
from signal import SIGPIPE, SIG_DFL, signal
|
||||||
from subprocess import PIPE
|
from subprocess import PIPE
|
||||||
|
@ -103,7 +102,7 @@ def raise_arg(e):
|
||||||
class StorePath:
|
class StorePath:
|
||||||
def __init__(self, path: Union[str, Path]):
|
def __init__(self, path: Union[str, Path]):
|
||||||
assert str(path).startswith("/nix/store/"), \
|
assert str(path).startswith("/nix/store/"), \
|
||||||
f"Doesn't start with /nix/store/: {str(resolved)!r}"
|
f"Doesn't start with /nix/store/: {str(path)!r}"
|
||||||
self._path = Path(path)
|
self._path = Path(path)
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
|
@ -348,7 +347,7 @@ def render_versions(version_list: List[str], *, colour: bool = False) -> str:
|
||||||
version_list.pop()
|
version_list.pop()
|
||||||
count += 1
|
count += 1
|
||||||
|
|
||||||
if version == None:
|
if version is None:
|
||||||
version = "<none>"
|
version = "<none>"
|
||||||
elif colour: # (Don't apply colour to <none>.)
|
elif colour: # (Don't apply colour to <none>.)
|
||||||
version = sgr(SGR_FG + SGR_YELLOW) + version + sgr(SGR_RESET)
|
version = sgr(SGR_FG + SGR_YELLOW) + version + sgr(SGR_RESET)
|
||||||
|
|
Loading…
Reference in a new issue