From bc85ff2caf1a4f0dbdb64cb464c11ecc1e6b0cc5 Mon Sep 17 00:00:00 2001 From: Xevion Date: Sat, 9 Nov 2019 20:30:52 -0600 Subject: [PATCH] added in .gitignore for msinfo32 file, decided on Windows processing and data collection model --- .gitignore | 3 +++ specs/__main__.py | 1 - specs/cmd.py | 24 ++++++++++++++++++++---- 3 files changed, 23 insertions(+), 5 deletions(-) delete mode 100644 specs/__main__.py diff --git a/.gitignore b/.gitignore index 894a44c..1ab62f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Repository Specific files/folders +/specs/data/** + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/specs/__main__.py b/specs/__main__.py deleted file mode 100644 index 39d1a5a..0000000 --- a/specs/__main__.py +++ /dev/null @@ -1 +0,0 @@ -from . import log \ No newline at end of file diff --git a/specs/cmd.py b/specs/cmd.py index 5094dc5..bb483fb 100644 --- a/specs/cmd.py +++ b/specs/cmd.py @@ -1,5 +1,8 @@ import click -import cpuinfo +import pprint +import os +import platform +import shutil from . import log @@ -10,6 +13,19 @@ def cli(): pass @cli.command() -@clic.option('-c', '--copy', default=False, show_default=True, help='Copy returned specs to the clipboard') -def run(): - log.info('specs.run') \ No newline at end of file +@click.option('-c', '--copy', default=False, show_default=True, help='Copy returned specs to the clipboard') +def collect(): + systype, sysname = os.name, platform.system() + if os.name == 'nt': + log.info(f'{systype}/{sysname} system detected') + if not shutil.which('msinfo32'): + log.critical('msinfo32 not detected in path') + raise click.ClickException('msinfo32 not detected in path - override to use linux OS specs detection via --linux') + print( + f'{key} : {value}' for key, value in { + 'Motherboard' : + } + ) + else: + log.critical(f'Unspported Platform \"{systype}\/{sysname}" detected, failing') + return \ No newline at end of file