-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcli.py
68 lines (50 loc) · 1.4 KB
/
cli.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "Christian Heider Nielsen"
__doc__ = r"""
Created on 09/02/2020
"""
import fire
import warg
from pyfiglet import Figlet
from neodroidvision import get_version
sponsors = "Alexandra Institute"
margin_percentage = 0 / 6
terminal_width = warg.get_terminal_size().columns
margin = int(margin_percentage * terminal_width)
width = terminal_width - 2 * margin
underline = "_" * width
indent = " " * margin
class NeodroidVisionCLI(object):
def run(self) -> None:
"""description"""
pass
@staticmethod
def version() -> None:
"""
Prints the version of this Neodroid Vision installation."""
draw_cli_header()
print(f"Version: {get_version()}")
@staticmethod
def sponsors() -> None:
"""description"""
print(sponsors)
def draw_cli_header(*, title: str = "Neodroid Vision", font: str = "big") -> None:
"""
Args:
title:
font:
"""
figlet = Figlet(font=font, justify="center", width=terminal_width)
description = figlet.renderText(title)
print(f"{description}{underline}\n")
def main(*, always_draw_header: bool = False) -> None:
"""
Args:
always_draw_header:
"""
if always_draw_header:
draw_cli_header()
fire.Fire(NeodroidVisionCLI, name="neodroid-vision")
if __name__ == "__main__":
main()