mirror of
https://github.com/Xevion/specs.git
synced 2025-12-06 05:16:35 -06:00
created formatting style
This commit is contained in:
22
specs/app.py
22
specs/app.py
@@ -1,4 +1,24 @@
|
|||||||
class SpecsWindows(object):
|
class WindowsSpecs(object):
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@property
|
||||||
|
def mobo():
|
||||||
|
pass
|
||||||
|
|
||||||
|
@property
|
||||||
|
def cpu():
|
||||||
|
pass
|
||||||
|
|
||||||
|
@property
|
||||||
|
def gpu():
|
||||||
|
pass
|
||||||
|
|
||||||
|
@property
|
||||||
|
def os():
|
||||||
|
pass
|
||||||
|
|
||||||
|
class LinuxSpecs(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
20
specs/cmd.py
20
specs/cmd.py
@@ -5,6 +5,7 @@ import platform
|
|||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
from . import log
|
from . import log
|
||||||
|
from .app import WindowsSpecs, LinuxSpecs
|
||||||
|
|
||||||
log.info('')
|
log.info('')
|
||||||
|
|
||||||
@@ -21,11 +22,20 @@ def collect():
|
|||||||
if not shutil.which('msinfo32'):
|
if not shutil.which('msinfo32'):
|
||||||
log.critical('msinfo32 not detected in path')
|
log.critical('msinfo32 not detected in path')
|
||||||
raise click.ClickException('msinfo32 not detected in path - override to use linux OS specs detection via --linux')
|
raise click.ClickException('msinfo32 not detected in path - override to use linux OS specs detection via --linux')
|
||||||
print(
|
model = WindowsSpecs()
|
||||||
f'{key} : {value}' for key, value in {
|
output = """::: {} Specs :::
|
||||||
'Motherboard' :
|
'Motherboard' : {motherboard},
|
||||||
}
|
'Processor' : {cpu},
|
||||||
|
'Graphics Card' : {gpu},
|
||||||
|
'Drives' : {disks}
|
||||||
|
"""
|
||||||
|
output = output.format(
|
||||||
|
motherboard=model.mobo,
|
||||||
|
cpu=model.cpu,
|
||||||
|
gpu=model.gpu,
|
||||||
|
disks=model.disks
|
||||||
)
|
)
|
||||||
|
print(output)
|
||||||
else:
|
else:
|
||||||
log.critical(f'Unspported Platform \"{systype}\/{sysname}" detected, failing')
|
log.critical(f'Unsupported Platform \"{systype}\/{sysname}" detected, failing')
|
||||||
return
|
return
|
||||||
Reference in New Issue
Block a user