mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-11-07 17:36:00 +00:00
[ci] auto-format
This commit is contained in:
parent
4a687c9f6b
commit
4d73fb33f9
2 changed files with 24 additions and 21 deletions
|
|
@ -2083,8 +2083,10 @@ class PluginManagerWindow(bui.Window):
|
||||||
if self.plugin_manager.categories != {}:
|
if self.plugin_manager.categories != {}:
|
||||||
if self.plugin_manager.categories['All'] is not None:
|
if self.plugin_manager.categories['All'] is not None:
|
||||||
category_plugins = await self.plugin_manager.categories[category if category != 'Installed' else 'All'].get_plugins()
|
category_plugins = await self.plugin_manager.categories[category if category != 'Installed' else 'All'].get_plugins()
|
||||||
else: return
|
else:
|
||||||
else: return
|
return
|
||||||
|
else:
|
||||||
|
return
|
||||||
except (KeyError, AttributeError):
|
except (KeyError, AttributeError):
|
||||||
no_internet_text = "Make sure you are connected\n to the Internet and try again."
|
no_internet_text = "Make sure you are connected\n to the Internet and try again."
|
||||||
if bui.textwidget(query=self._plugin_manager_status_text) != no_internet_text:
|
if bui.textwidget(query=self._plugin_manager_status_text) != no_internet_text:
|
||||||
|
|
|
||||||
|
|
@ -316,7 +316,7 @@ if ANDROID: # !can add ios in future
|
||||||
):
|
):
|
||||||
try:
|
try:
|
||||||
with open(f"{getcwd()}/token.txt", 'r') as f:
|
with open(f"{getcwd()}/token.txt", 'r') as f:
|
||||||
token = bytes.fromhex(f.read()).decode('utf-8')
|
token = bytes.fromhex(f.read()).decode('utf-8')
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
with open(f"{_babase.app.env.python_directory_user}/__pycache__/token.txt", 'r') as f:
|
with open(f"{_babase.app.env.python_directory_user}/__pycache__/token.txt", 'r') as f:
|
||||||
token = bytes.fromhex(f.read()).decode('utf-8')
|
token = bytes.fromhex(f.read()).decode('utf-8')
|
||||||
|
|
@ -328,13 +328,12 @@ if ANDROID: # !can add ios in future
|
||||||
while True:
|
while True:
|
||||||
urlopen('http://www.google.com', timeout=5)
|
urlopen('http://www.google.com', timeout=5)
|
||||||
threading.Thread(
|
threading.Thread(
|
||||||
target=self.ws.run_forever, daemon=True, name="websocket"
|
target=self.ws.run_forever, daemon=True, name="websocket"
|
||||||
).start()
|
).start()
|
||||||
return
|
return
|
||||||
except Exception:
|
except Exception:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
self.stop_heartbeat_thread.set()
|
self.stop_heartbeat_thread.set()
|
||||||
self.do_once = True
|
self.do_once = True
|
||||||
|
|
@ -444,7 +443,7 @@ if not ANDROID:
|
||||||
s.close()
|
s.close()
|
||||||
return True
|
return True
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise(e)
|
raise (e)
|
||||||
s.close()
|
s.close()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
@ -466,7 +465,7 @@ if not ANDROID:
|
||||||
"format_version": 1,
|
"format_version": 1,
|
||||||
"hostname": addr,
|
"hostname": addr,
|
||||||
"port": port,
|
"port": port,
|
||||||
}
|
}
|
||||||
self.join_secret = json.dumps(secret_dict)
|
self.join_secret = json.dumps(secret_dict)
|
||||||
print(self.join_secret)
|
print(self.join_secret)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
@ -537,15 +536,15 @@ if not ANDROID:
|
||||||
party_id=self.party_id,
|
party_id=self.party_id,
|
||||||
party_size=[self.party_size, self.party_max],
|
party_size=[self.party_size, self.party_max],
|
||||||
join=self.join_secret)
|
join=self.join_secret)
|
||||||
# buttons = [ #!cant use buttons together with join
|
# buttons = [ #!cant use buttons together with join
|
||||||
# {
|
# {
|
||||||
# "label": "Discord Server",
|
# "label": "Discord Server",
|
||||||
# "url": "https://ballistica.net/discord"
|
# "url": "https://ballistica.net/discord"
|
||||||
# },
|
# },
|
||||||
# {
|
# {
|
||||||
# "label": "Download Bombsquad",
|
# "label": "Download Bombsquad",
|
||||||
# "url": "https://bombsquad.ga/download"}
|
# "url": "https://bombsquad.ga/download"}
|
||||||
# ]
|
# ]
|
||||||
self.handle_event(data)
|
self.handle_event(data)
|
||||||
except Exception:
|
except Exception:
|
||||||
try:
|
try:
|
||||||
|
|
@ -858,6 +857,8 @@ def get_class():
|
||||||
return RpcThread()
|
return RpcThread()
|
||||||
|
|
||||||
# ba_meta export babase.Plugin
|
# ba_meta export babase.Plugin
|
||||||
|
|
||||||
|
|
||||||
class DiscordRP(babase.Plugin):
|
class DiscordRP(babase.Plugin):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
self.update_timer: bs.Timer | None = None
|
self.update_timer: bs.Timer | None = None
|
||||||
|
|
@ -870,8 +871,8 @@ class DiscordRP(babase.Plugin):
|
||||||
def on_app_running(self) -> None:
|
def on_app_running(self) -> None:
|
||||||
if not ANDROID:
|
if not ANDROID:
|
||||||
threading.Thread(
|
threading.Thread(
|
||||||
target=self.rpc_thread.start, daemon=True, name="start_rpc_android"
|
target=self.rpc_thread.start, daemon=True, name="start_rpc_android"
|
||||||
).start()
|
).start()
|
||||||
|
|
||||||
self.update_timer = bs.AppTimer(
|
self.update_timer = bs.AppTimer(
|
||||||
1, bs.WeakCall(self.update_status), repeat=True
|
1, bs.WeakCall(self.update_status), repeat=True
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue