Exception handling on printing the banner

This commit is contained in:
Micah Lee 2021-11-15 18:16:10 -08:00
parent a4db0d26c9
commit 267e9eb1e4
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73

View File

@ -87,13 +87,11 @@ class Common:
""" """
if self.platform == "Windows": try:
pass
else:
pass
print( print(
Back.MAGENTA + Fore.WHITE + "╭───────────────────────────────────────────╮" Back.MAGENTA
+ Fore.WHITE
+ "╭───────────────────────────────────────────╮"
) )
print( print(
Back.MAGENTA Back.MAGENTA
@ -247,7 +245,9 @@ class Common:
+ "" + ""
) )
print( print(
Back.MAGENTA + Fore.WHITE + "│ │" Back.MAGENTA
+ Fore.WHITE
+ "│ │"
) )
left_spaces = (43 - len(self.version) - 1) // 2 left_spaces = (43 - len(self.version) - 1) // 2
right_spaces = left_spaces right_spaces = left_spaces
@ -263,7 +263,9 @@ class Common:
+ "" + ""
) )
print( print(
Back.MAGENTA + Fore.WHITE + "│ │" Back.MAGENTA
+ Fore.WHITE
+ "│ │"
) )
print( print(
Back.MAGENTA Back.MAGENTA
@ -275,9 +277,16 @@ class Common:
+ "" + ""
) )
print( print(
Back.MAGENTA + Fore.WHITE + "╰───────────────────────────────────────────╯" Back.MAGENTA
+ Fore.WHITE
+ "╰───────────────────────────────────────────╯"
) )
print() print()
except:
# If anything fails, print a boring banner
print(f"OnionShare v{self.version}")
print("https://onionshare.org/")
print()
def load_settings(self, config=None): def load_settings(self, config=None):
""" """