2021.4.1 #11
@ -19,23 +19,17 @@ class Version(CommandABC):
|
|||||||
def run(self, args: list[str]):
|
def run(self, args: list[str]):
|
||||||
Console.set_foreground_color(ForegroundColor.yellow)
|
Console.set_foreground_color(ForegroundColor.yellow)
|
||||||
Console.banner('CPL CLI')
|
Console.banner('CPL CLI')
|
||||||
Console.set_foreground_color('default')
|
Console.set_foreground_color(ForegroundColor.default)
|
||||||
if '__version__' in dir(cpl_cli):
|
if '__version__' in dir(cpl_cli):
|
||||||
Console.set_foreground_color(ForegroundColor.yellow)
|
Console.write_line(f'Common Python library CLI: ')
|
||||||
Console.write_line(f'Common Python Library CLI: ')
|
|
||||||
Console.set_foreground_color(ForegroundColor.default)
|
|
||||||
Console.write(cpl_cli.__version__)
|
Console.write(cpl_cli.__version__)
|
||||||
|
|
||||||
Console.set_foreground_color(ForegroundColor.blue)
|
|
||||||
Console.write_line(f'Python: ')
|
Console.write_line(f'Python: ')
|
||||||
Console.set_foreground_color(ForegroundColor.default)
|
|
||||||
Console.write(f'{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}')
|
Console.write(f'{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}')
|
||||||
|
|
||||||
Console.write_line(f'OS: {platform.system()} {platform.processor()}')
|
Console.write_line(f'OS: {platform.system()} {platform.processor()}')
|
||||||
|
|
||||||
Console.set_foreground_color(ForegroundColor.yellow)
|
|
||||||
Console.write_line('\nCPL packages:')
|
Console.write_line('\nCPL packages:')
|
||||||
Console.set_foreground_color(ForegroundColor.default)
|
|
||||||
packages = []
|
packages = []
|
||||||
for importer, modname, is_pkg in pkgutil.iter_modules(cpl.__path__):
|
for importer, modname, is_pkg in pkgutil.iter_modules(cpl.__path__):
|
||||||
module = importer.find_module(modname).load_module(modname)
|
module = importer.find_module(modname).load_module(modname)
|
||||||
@ -44,9 +38,7 @@ class Version(CommandABC):
|
|||||||
|
|
||||||
Console.table(['Name', 'Version'], packages)
|
Console.table(['Name', 'Version'], packages)
|
||||||
|
|
||||||
Console.set_foreground_color(ForegroundColor.blue)
|
|
||||||
Console.write_line('\nPython packages:')
|
Console.write_line('\nPython packages:')
|
||||||
Console.set_foreground_color(ForegroundColor.default)
|
|
||||||
packages = []
|
packages = []
|
||||||
dependencies = dict(tuple(str(ws).split()) for ws in pkg_resources.working_set)
|
dependencies = dict(tuple(str(ws).split()) for ws in pkg_resources.working_set)
|
||||||
for p in dependencies:
|
for p in dependencies:
|
||||||
|
Loading…
Reference in New Issue
Block a user