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":
pass
else:
pass
try:
print(
Back.MAGENTA + Fore.WHITE + "╭───────────────────────────────────────────╮"
Back.MAGENTA
+ Fore.WHITE
+ "╭───────────────────────────────────────────╮"
)
print(
Back.MAGENTA
@ -247,7 +245,9 @@ class Common:
+ ""
)
print(
Back.MAGENTA + Fore.WHITE + "│ │"
Back.MAGENTA
+ Fore.WHITE
+ "│ │"
)
left_spaces = (43 - len(self.version) - 1) // 2
right_spaces = left_spaces
@ -263,7 +263,9 @@ class Common:
+ ""
)
print(
Back.MAGENTA + Fore.WHITE + "│ │"
Back.MAGENTA
+ Fore.WHITE
+ "│ │"
)
print(
Back.MAGENTA
@ -275,9 +277,16 @@ class Common:
+ ""
)
print(
Back.MAGENTA + Fore.WHITE + "╰───────────────────────────────────────────╯"
Back.MAGENTA
+ Fore.WHITE
+ "╰───────────────────────────────────────────╯"
)
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):
"""