55import sys
66from pathlib import Path
77from tempfile import gettempdir
8+ from typing import Optional
89
910from tabulate import tabulate
1011
@@ -20,7 +21,7 @@ class TextStyle:
2021 NC = "\033 [0m" # No Color
2122
2223
23- def colorify (text : str , style : TextStyle ):
24+ def colorify (text : str , style : TextStyle ) -> str :
2425 return f"{ style } { text } { TextStyle .NC } "
2526
2627
@@ -33,7 +34,7 @@ def list_dns() -> None:
3334 print (tabulate (dns_servers , headers = ["ID" , "IP" ], stralign = "center" ))
3435
3536
36- def update_resolv_file (content ):
37+ def update_resolv_file (content ) -> None :
3738 resolv_file = Path ("/etc" , "resolv.conf" )
3839 tmp_resolv_file = Path (gettempdir ()).joinpath ("resolv.conf" )
3940
@@ -59,7 +60,7 @@ def update_resolv_file(content):
5960 logger .error (f"Could not update resolv file: { e } " )
6061
6162
62- def restore_resolv_file ():
63+ def restore_resolv_file () -> None :
6364 tmp_resolv_file = Path (gettempdir (), "resolv.conf" )
6465 resolv_file = Path ("/etc" , "resolv.conf" )
6566 if tmp_resolv_file .exists ():
@@ -94,7 +95,7 @@ def show_current_dns() -> None:
9495 print (tabulate (resolvers , headers = ["Type" , "IP" ], stralign = "center" ))
9596
9697
97- def shecan_cli ():
98+ def shecan_cli () -> Optional [ int ] :
9899 parser = argparse .ArgumentParser (description = "CLI for shecan.ir website." )
99100 parser .add_argument (
100101 "--debug" ,
0 commit comments