-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
61 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
__version__ = "0.0.3" | ||
from tinyfetch.module import Color, Module | ||
|
||
__version__ = "0.0.4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,30 @@ | ||
import argparse | ||
|
||
import tinyfetch | ||
from tinyfetch import core | ||
from tinyfetch import core, module | ||
|
||
|
||
def main() -> None: | ||
parser = argparse.ArgumentParser( | ||
prog="tinyfetch", | ||
description="Python and system information command-line fetch tool", | ||
) | ||
parser.add_argument( | ||
"--title-color", | ||
default="blue", | ||
choices=list(c.name for c in module.Color), | ||
help="set default the title color", | ||
) | ||
parser.add_argument( | ||
"--no-color", | ||
action="store_true", | ||
help="turn off all colors and disables", | ||
) | ||
parser.add_argument( | ||
"--version", | ||
action="version", | ||
version="%(prog)s v{}".format(tinyfetch.__version__), | ||
) | ||
args = parser.parse_args() | ||
|
||
if args: | ||
core.render() | ||
core.render(title_color=args.title_color, no_color=args.no_color) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
from tinyfetch import module | ||
from tinyfetch.module import Color | ||
|
||
modules_list = [ | ||
module.Space, | ||
module.UserHost, | ||
module.SplitLine, | ||
module.PythonVersion, | ||
module.PIPVersion, | ||
module.PIPPackages, | ||
module.Implementation, | ||
module.Compiler, | ||
module.Space, | ||
module.Kernel, | ||
module.OperationSystem, | ||
module.Space, | ||
] | ||
|
||
def render() -> None: | ||
modules = [ | ||
module.Space(), | ||
module.UserHost(), | ||
module.SplitLine(), | ||
module.PythonVersion(), | ||
module.PIPVersion(), | ||
module.PIPPackages(), | ||
module.Implementation(), | ||
module.Compiler(), | ||
module.Space(), | ||
module.Kernel(), | ||
module.OperationSystem(), | ||
module.Space(), | ||
] | ||
|
||
for m in modules: | ||
print(m.output()) | ||
def render(title_color: str, no_color: bool = False) -> None: | ||
for m in modules_list: | ||
print(m.__call__(title_color=Color[title_color], no_color=no_color).output()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters