chore: object description

This commit is contained in:
relikd
2025-09-03 11:14:10 +02:00
parent 05febfae3b
commit a6b53f2f96

View File

@@ -238,6 +238,8 @@ def cli_upgrade(args: ArgParams) -> None:
Log.error('You cannot use both, use either <package> param or --all')
return
Log.info('==> {} package manifests ...'.format(
'download latest' if args.force else 'get'))
queue = InstallQueue(dryRun=args.dry, force=False)
for pkg in Cellar.infoAll(args.packages, assertInstalled=True):
@@ -1121,6 +1123,9 @@ class LocalPackage:
self.name = pkg
self.path = Cellar.installPath(pkg)
def __repr__(self) -> str:
return f'<LocalPackage {self.name}>'
def assertInstalled(self, msg: str = 'unknown package:') -> 'LocalPackage':
'''If not installed: print error message and exit with status code 1'''
if not self.installed:
@@ -1286,6 +1291,9 @@ class LocalPackageVersion:
self.version = version
self.path = os.path.join(pkg.path, version)
def __repr__(self) -> str:
return f'<LocalPackageVersion {self.pkg.name} ({self.version})>'
@cached_property
def installed(self) -> bool:
''' Returns `True` if version is installed (`.brew` dir exists) '''