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['All'] is not None:
|
||||
category_plugins = await self.plugin_manager.categories[category if category != 'Installed' else 'All'].get_plugins()
|
||||
else: return
|
||||
else: return
|
||||
else:
|
||||
return
|
||||
else:
|
||||
return
|
||||
except (KeyError, AttributeError):
|
||||
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:
|
||||
|
|
|
|||
|
|
@ -316,7 +316,7 @@ if ANDROID: # !can add ios in future
|
|||
):
|
||||
try:
|
||||
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:
|
||||
with open(f"{_babase.app.env.python_directory_user}/__pycache__/token.txt", 'r') as f:
|
||||
token = bytes.fromhex(f.read()).decode('utf-8')
|
||||
|
|
@ -328,13 +328,12 @@ if ANDROID: # !can add ios in future
|
|||
while True:
|
||||
urlopen('http://www.google.com', timeout=5)
|
||||
threading.Thread(
|
||||
target=self.ws.run_forever, daemon=True, name="websocket"
|
||||
).start()
|
||||
target=self.ws.run_forever, daemon=True, name="websocket"
|
||||
).start()
|
||||
return
|
||||
except Exception:
|
||||
return
|
||||
|
||||
|
||||
def close(self):
|
||||
self.stop_heartbeat_thread.set()
|
||||
self.do_once = True
|
||||
|
|
@ -444,7 +443,7 @@ if not ANDROID:
|
|||
s.close()
|
||||
return True
|
||||
except Exception as e:
|
||||
raise(e)
|
||||
raise (e)
|
||||
s.close()
|
||||
return False
|
||||
|
||||
|
|
@ -466,7 +465,7 @@ if not ANDROID:
|
|||
"format_version": 1,
|
||||
"hostname": addr,
|
||||
"port": port,
|
||||
}
|
||||
}
|
||||
self.join_secret = json.dumps(secret_dict)
|
||||
print(self.join_secret)
|
||||
except Exception as e:
|
||||
|
|
@ -537,15 +536,15 @@ if not ANDROID:
|
|||
party_id=self.party_id,
|
||||
party_size=[self.party_size, self.party_max],
|
||||
join=self.join_secret)
|
||||
# buttons = [ #!cant use buttons together with join
|
||||
# {
|
||||
# "label": "Discord Server",
|
||||
# "url": "https://ballistica.net/discord"
|
||||
# },
|
||||
# {
|
||||
# "label": "Download Bombsquad",
|
||||
# "url": "https://bombsquad.ga/download"}
|
||||
# ]
|
||||
# buttons = [ #!cant use buttons together with join
|
||||
# {
|
||||
# "label": "Discord Server",
|
||||
# "url": "https://ballistica.net/discord"
|
||||
# },
|
||||
# {
|
||||
# "label": "Download Bombsquad",
|
||||
# "url": "https://bombsquad.ga/download"}
|
||||
# ]
|
||||
self.handle_event(data)
|
||||
except Exception:
|
||||
try:
|
||||
|
|
@ -858,6 +857,8 @@ def get_class():
|
|||
return RpcThread()
|
||||
|
||||
# ba_meta export babase.Plugin
|
||||
|
||||
|
||||
class DiscordRP(babase.Plugin):
|
||||
def __init__(self) -> None:
|
||||
self.update_timer: bs.Timer | None = None
|
||||
|
|
@ -870,8 +871,8 @@ class DiscordRP(babase.Plugin):
|
|||
def on_app_running(self) -> None:
|
||||
if not ANDROID:
|
||||
threading.Thread(
|
||||
target=self.rpc_thread.start, daemon=True, name="start_rpc_android"
|
||||
).start()
|
||||
target=self.rpc_thread.start, daemon=True, name="start_rpc_android"
|
||||
).start()
|
||||
|
||||
self.update_timer = bs.AppTimer(
|
||||
1, bs.WeakCall(self.update_status), repeat=True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue