mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-04 07:25:10 -04:00
Exception handling on printing the banner
This commit is contained in:
parent
aecb7bef93
commit
516c0f2484
1 changed files with 201 additions and 192 deletions
|
@ -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):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue