33
44from . import __version__
55from .utils import DebugOption , VerboseOption , QuietOption , verbose_args_processor
6+
67logger = logging .getLogger ('base' )
78
89
910cli_base = typer .Typer (
10- no_args_is_help = True ,
11- rich_markup_mode = 'rich' ,
12- context_settings = {
13- 'help_option_names' : ['-h' , '--help' , 'help' ]
14- }
11+ no_args_is_help = True ,
12+ rich_markup_mode = 'rich' ,
13+ context_settings = {'help_option_names' : ['-h' , '--help' , 'help' ]},
1514)
1615
1716
@@ -21,19 +20,19 @@ def version_callback(value: bool):
2120 raise typer .Exit ()
2221
2322
24- @cli_base .callback (invoke_without_command = True )
23+ @cli_base .callback (invoke_without_command = True )
2524def callback (
2625 version : bool = typer .Option (
27- None , '--version' ,
28- callback = version_callback ,
29- help = 'Get the current installed version' ,
30- is_eager = True
26+ None ,
27+ '--version' ,
28+ callback = version_callback ,
29+ help = 'Get the current installed version' ,
30+ is_eager = True ,
3131 ),
32-
3332 debug : bool = DebugOption ,
3433 verbose : bool = VerboseOption ,
35- quiet : bool = QuietOption
36- ):
34+ quiet : bool = QuietOption ,
35+ ):
3736 """
3837 [b]Thread CLI[/b]\b \n
3938 [white]Use thread from the terminal![/white]
@@ -45,20 +44,17 @@ def callback(
4544 verbose_args_processor (debug , verbose , quiet )
4645
4746
48-
4947# Help and Others
50- @cli_base .command (rich_help_panel = 'Help and Others' )
48+ @cli_base .command (rich_help_panel = 'Help and Others' )
5149def help ():
5250 """Get [yellow]help[/yellow] from the community. :question:"""
5351 typer .echo ('Feel free to search for or ask questions here!' )
5452 try :
5553 logger .info ('Attempting to open in web browser...' )
5654
5755 import webbrowser
58- webbrowser .open (
59- 'https://github.com/python-thread/thread/issues' ,
60- new = 2
61- )
56+
57+ webbrowser .open ('https://github.com/python-thread/thread/issues' , new = 2 )
6258 typer .echo ('Opening in web browser!' )
6359
6460 except Exception as e :
@@ -67,17 +63,16 @@ def help():
6763 typer .echo ('https://github.com/python-thread/thread/issues' )
6864
6965
70-
71- @cli_base .command (rich_help_panel = 'Help and Others' )
66+ @cli_base .command (rich_help_panel = 'Help and Others' )
7267def docs ():
7368 """View our [yellow]documentation.[/yellow] :book:"""
7469 typer .echo ('Thanks for using Thread, here is our documentation!' )
7570 try :
7671 logger .info ('Attempting to open in web browser...' )
7772 import webbrowser
73+
7874 webbrowser .open (
79- 'https://github.com/python-thread/thread/blob/main/docs/command-line.md' ,
80- new = 2
75+ 'https://github.com/python-thread/thread/blob/main/docs/command-line.md' , new = 2
8176 )
8277 typer .echo ('Opening in web browser!' )
8378
@@ -87,18 +82,15 @@ def docs():
8782 typer .echo ('https://github.com/python-thread/thread/blob/main/docs/command-line.md' )
8883
8984
90-
91- @cli_base .command (rich_help_panel = 'Help and Others' )
85+ @cli_base .command (rich_help_panel = 'Help and Others' )
9286def report ():
9387 """[yellow]Report[/yellow] an issue. :bug:"""
9488 typer .echo ('Sorry you run into an issue, report it here!' )
9589 try :
9690 logger .info ('Attempting to open in web browser...' )
9791 import webbrowser
98- webbrowser .open (
99- 'https://github.com/python-thread/thread/issues' ,
100- new = 2
101- )
92+
93+ webbrowser .open ('https://github.com/python-thread/thread/issues' , new = 2 )
10294 typer .echo ('Opening in web browser!' )
10395
10496 except Exception as e :
@@ -107,11 +99,10 @@ def report():
10799 typer .echo ('https://github.com/python-thread/thread/issues' )
108100
109101
110-
111102# Utils and Configs
112- @cli_base .command (rich_help_panel = 'Utils and Configs' )
103+ @cli_base .command (rich_help_panel = 'Utils and Configs' )
113104def config (configuration : str ):
114105 """
115106 [blue]Configure[/blue] the system. :wrench:
116107 """
117- typer .echo ('Coming soon!' )
108+ typer .echo ('Coming soon!' )
0 commit comments