[ci] auto-format

This commit is contained in:
vishal332008 2025-01-23 20:45:05 +00:00 committed by github-actions[bot]
parent 5bb972dd34
commit 5e3013990b
14 changed files with 68 additions and 54 deletions

View file

@ -354,7 +354,8 @@ class StartupTasks:
new_supported_plugins[0:show_max_names])
))
if new_supported_plugins_count == 1:
notification_text = f"{new_supported_plugins_count} new plugin ({new_supported_plugins}) is available!"
notification_text = f"{new_supported_plugins_count} new plugin ({
new_supported_plugins}) is available!"
else:
notification_text = new_supported_plugins + \
('' if new_supported_plugins_count <= show_max_names else ' and +' +
@ -413,7 +414,8 @@ class Category:
self.get_plugins(),
)
except KeyError:
raise CategoryMetadataParseError(f"Failed to parse JSON; missing required fields.")
raise CategoryMetadataParseError(f"Failed to parse JSON
missing required fields.")
else:
return True

View file

@ -1697,7 +1697,8 @@ def fetchAccountInfo(account, loading_widget):
fdata = json.load(f)
if account in fdata:
servers = fdata[account]
url = f'https://{BCSSERVER}/player?key={base64.b64encode(account.encode("utf-8")).decode("utf-8")}&base64=true'
url = f'https: //{BCSSERVER}/player?key={base64.b64encode(
account.encode("utf-8")).decode("utf-8")}&base64=true'
req = urllib.request.Request(url, headers={
"User-Agent": f'BS{_babase.env().get("build_number", 0)}', "Accept-Language": "en-US,en;q=0.9", })
data = urllib.request.urlopen(req)

View file

@ -99,11 +99,13 @@ class _cmds:
cmsg(f' {px}freeze all or {px}freeze number of list | freeze the player')
cmsg(
f' {px}unfreeze/thaw all or {px}unfreeze/thaw number of list | unfreeze the player')
cmsg(f' {px}gloves all or {px}gloves number of list | give gloves to player')
cmsg(f' {px}gloves all or {
px}gloves number of list | give gloves to player')
cmsg('============================')
elif n[2] == '2':
cmsg('============== Help 2 Page 2 ==============')
cmsg(f' {px}shield all or {px}shield number of list | give shield the player')
cmsg(f' {px}shield all or {
px}shield number of list | give shield the player')
cmsg(
f' {px}fall all or {px}fall number of list | teleport in down and fall up the player')
cmsg(f' {px}curse all or {px}curse number of list | curse the player')
@ -115,7 +117,8 @@ class _cmds:
cmsg('============================')
elif n[2] == '3':
cmsg('============== Help 2 Page 3 ==============')
cmsg(f' {px}gm all or {px}gm number of list | give bs gods like powers to player')
cmsg(f' {px}gm all or {
px}gm number of list | give bs gods like powers to player')
cmsg(
f' {px}sp all or {px}sp number of list | give superrrrrrr damages when punch to player')
cmsg(f' {px}sleep all or {px}sleep number of list | sleep up the player')
@ -125,7 +128,8 @@ class _cmds:
elif n[0] == '3':
cmsg('============================')
cmsg(f" {px}d_bomb bombType | changes default bomb | do {px}d_bomb help for bomb names ")
cmsg(f" {px}d_bomb bombType | changes default bomb | do {
px}d_bomb help for bomb names ")
cmsg(f' {px}dbc (number of bombs) | changes default count of player')
cmsg('============================')

View file

@ -1559,7 +1559,8 @@ class Nice(mm.MainMenuWindow):
tn.append(i)
try:
attr = getattr(blex, i) if i not in [
"punch_position", "punch_velocity", "punch_momentum_linear"] else (0, 0, 0) # gay
# gay
"punch_position", "punch_velocity", "punch_momentum_linear"] else (0, 0, 0)
except:
attr = None
typez.append(str(type(attr).__name__))
@ -2685,7 +2686,8 @@ class Nice(mm.MainMenuWindow):
elif isinstance(a, tuple) or i == 6 or i == 11 or i == 28:
k = Nice.val_attrs[i]
l = bui.buttonwidget(parent=attr_sub,
label=f"{str(a[0]+0.01)[:3]} {str(a[1]+0.01)[:3]}, {str(a[2]+0.01)[:3]}",
label=f"{str(a[0]+0.01)[:3]} {str(a[1]+0.01)
[:3]}, {str(a[2]+0.01)[:3]}",
scale=s.scale,
size=(30, 12),
color=k,
@ -3662,7 +3664,8 @@ class Nice(mm.MainMenuWindow):
elif isinstance(a, tuple) or i == 6 or i == 11 or i == 28:
k = val_attrs2[i]
l = bui.buttonwidget(parent=mud_sub,
label=f"{str(a[0]+0.01)[:3]} {str(a[1]+0.01)[:3]}, {str(a[2]+0.01)[:3]}",
label=f"{str(a[0]+0.01)[:3]} {str(a[1]+0.01)
[:3]}, {str(a[2]+0.01)[:3]}",
scale=s.scale,
size=(30, 12),
color=k,

View file

@ -46,8 +46,7 @@ def translate(text, _callback, source='auto', target='en'):
url = f'https: //translate.google.com/m?tl={target}&sl={source}&q={text}'
request = urllib.request.Request(url)
data = urllib.request.urlopen(request).read().decode('utf-8')
result = data[(data.find('"result-container">'))+len('"result-container">')
:data.find('</div><div class="links-container">')]
result = data[(data.find('"result-container">'))+len('"result-container">') :data.find('</div><div class="links-container">')]
replace_list = [('&#39;', '\''), ('&quot;', '"'), ('&amp;', '&')]
for i in replace_list:
result = result.replace(i[0], i[1])

View file

@ -99,7 +99,8 @@ class CategoryVersionMetadata:
for plugin_name, plugin_metadata in self.category_metadata["plugins"].items():
for version_name, version_metadata in plugin_metadata["versions"].items():
if version_metadata is None:
plugin_path = f"{os.path.join(self.category_metadata_base, f'{plugin_name}.py')}"
plugin_path = f"{os.path.join(
self.category_metadata_base, f'{plugin_name}.py')}"
yield PluginVersionMetadata(
plugin_name,
version_name,

View file

@ -157,8 +157,10 @@ class BaseCategoryMetadataTestCases:
if md5sum != version_metadata["md5sum"]:
self.fail(
f"{plugin} checksum changed;\n"
f"{version_metadata['md5sum']} (mentioned in {self.category_metadata_file}) ->\n"
f"{plugin} checksum changed
\n"
f"{version_metadata['md5sum']} (mentioned in {
self.category_metadata_file}) ->\n"
f"{md5sum} (actual)"
)
self.assertEqual(int(api_version.decode("utf-8")),
@ -177,8 +179,10 @@ class BaseCategoryMetadataTestCases:
if md5sum != latest_version_metadata["md5sum"]:
self.fail(
f"{plugin} checksum changed;\n"
f"{latest_version_metadata['md5sum']} (mentioned in {self.category_metadata_file}) ->\n"
f"{plugin} checksum changed
\n"
f"{latest_version_metadata['md5sum']} (mentioned in {
self.category_metadata_file}) ->\n"
f"{md5sum} (actual)"
)
self.assertEqual(md5sum, latest_version_metadata["md5sum"])