mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-10-08 14:54:36 +00:00
[ci] auto-format
This commit is contained in:
parent
7dd4c75b8b
commit
4a1e7a559e
1 changed files with 69 additions and 61 deletions
|
|
@ -81,17 +81,20 @@ def display_success(msg=None):
|
|||
else:
|
||||
ba.screenmessage('Successful!', (0, 1, 0))
|
||||
|
||||
|
||||
class Translate(Thread):
|
||||
def __init__(self, data, callback):
|
||||
super().__init__()
|
||||
self.data = data
|
||||
self._callback = callback
|
||||
|
||||
def run(self):
|
||||
_ba.pushcall(ba.Call(ba.screenmessage, 'Translating...'), from_other_thread=True)
|
||||
response = messenger._send_request(f'{url}/translate', self.data)
|
||||
if response:
|
||||
_ba.pushcall(ba.Call(self._callback, response), from_other_thread=True)
|
||||
|
||||
|
||||
class ColorTracker:
|
||||
def __init__(self):
|
||||
self.saved = {}
|
||||
|
|
@ -170,8 +173,8 @@ class PrivateChatHandler:
|
|||
if hash == file_hash:
|
||||
with open(__file__, 'w') as f:
|
||||
f.write(new_file)
|
||||
_ba.pushcall(ba.Call(ba.screenmessage, 'Ultra party window updated\nNeeds restart.'), True)
|
||||
|
||||
_ba.pushcall(ba.Call(ba.screenmessage,
|
||||
'Ultra party window updated\nNeeds restart.'), True)
|
||||
|
||||
def _signup(self, registration_key):
|
||||
data = dict(pb_id=self.myid, registration_key=registration_key)
|
||||
|
|
@ -281,7 +284,8 @@ class PrivateChatHandler:
|
|||
else:
|
||||
message = msg['message']
|
||||
else:
|
||||
message = '[' + msg['filter'] + ']: ' + 'Message from unsaved id. Save id to view message.'
|
||||
message = '[' + msg['filter'] + ']: ' + \
|
||||
'Message from unsaved id. Save id to view message.'
|
||||
return message
|
||||
|
||||
def _get_status(self, id, type='status'):
|
||||
|
|
@ -783,7 +787,6 @@ class TranslationSettings:
|
|||
|
||||
ba.containerwidget(edit=self.root_widget, cancel_button=btn)
|
||||
|
||||
|
||||
def _change_source(self, choice):
|
||||
cfg = ba.app.config
|
||||
cfg['Translate Source Language'] = choice
|
||||
|
|
@ -1019,7 +1022,6 @@ class SettingsWindow:
|
|||
ba.containerwidget(edit=self.root_widget, transition='out_scale')
|
||||
|
||||
|
||||
|
||||
class PartyWindow(ba.Window):
|
||||
"""Party list/chat window."""
|
||||
|
||||
|
|
@ -1214,7 +1216,8 @@ class PartyWindow(ba.Window):
|
|||
button_type='square',
|
||||
autoselect=True,
|
||||
color=self.bg_color,
|
||||
position=(self._width - 530, self._height - 100),
|
||||
position=(self._width - 530,
|
||||
self._height - 100),
|
||||
on_activate_call=self._ip_port_msg)
|
||||
self._settings_button = ba.buttonwidget(parent=self._root_widget,
|
||||
size=(50, 50),
|
||||
|
|
@ -1286,7 +1289,8 @@ class PartyWindow(ba.Window):
|
|||
uiscale = ba.app.ui.uiscale
|
||||
|
||||
choices = ['muteOption', 'modifyColor', 'addQuickReply', 'removeQuickReply', 'credits']
|
||||
choices_display = ['Mute Option', 'Modify Main Color', 'Add as Quick Reply', 'Remove a Quick Reply', 'Credits']
|
||||
choices_display = ['Mute Option', 'Modify Main Color',
|
||||
'Add as Quick Reply', 'Remove a Quick Reply', 'Credits']
|
||||
|
||||
if hasattr(_ba.get_foreground_host_activity(), '_map'):
|
||||
choices.append('manualCamera')
|
||||
|
|
@ -1497,7 +1501,8 @@ class PartyWindow(ba.Window):
|
|||
h_align='center',
|
||||
v_align='center')
|
||||
choices = [i for i in messenger.saved_ids]
|
||||
choices_display = [ba.Lstr(value=messenger.saved_ids[i]) for i in messenger.saved_ids]
|
||||
choices_display = [ba.Lstr(value=messenger.saved_ids[i])
|
||||
for i in messenger.saved_ids]
|
||||
choices.append('add')
|
||||
choices_display.append(ba.Lstr(value='***Add New***'))
|
||||
filter_widget = PopupMenu(
|
||||
|
|
@ -1743,7 +1748,6 @@ class PartyWindow(ba.Window):
|
|||
data['type'] = 'pronunciation'
|
||||
Translate(data, _apply_translation).start()
|
||||
|
||||
|
||||
def _copy_to_clipboard(self):
|
||||
msg = ba.textwidget(query=self._text_field)
|
||||
if msg == '':
|
||||
|
|
@ -1800,7 +1804,8 @@ class PartyWindow(ba.Window):
|
|||
kick_str = ba.Lstr(resource='kickVoteText')
|
||||
uiscale = ba.app.ui.uiscale
|
||||
choices = ['kick', 'mention', 'adminkick']
|
||||
choices_display = [kick_str] + list(self._create_baLstr_list(['Mention this guy', f'Kick ID: {client_id}']))
|
||||
choices_display = [kick_str] + \
|
||||
list(self._create_baLstr_list(['Mention this guy', f'Kick ID: {client_id}']))
|
||||
choices.append('customCommands')
|
||||
choices_display.append(ba.Lstr(value='Custom Commands'))
|
||||
PopupMenuWindow(
|
||||
|
|
@ -1902,7 +1907,6 @@ class PartyWindow(ba.Window):
|
|||
Thread(target=check_new_message).start()
|
||||
ba.textwidget(edit=self._text_field, text='')
|
||||
|
||||
|
||||
def _write_quick_responds(self, data):
|
||||
try:
|
||||
with open(quick_msg_file, 'w') as f:
|
||||
|
|
@ -2032,7 +2036,8 @@ class PartyWindow(ba.Window):
|
|||
def _edit_text_msg_box(self, text, action='add'):
|
||||
if isinstance(text, str):
|
||||
if action == 'add':
|
||||
ba.textwidget(edit=self._text_field, text=ba.textwidget(query=self._text_field) + text)
|
||||
ba.textwidget(edit=self._text_field, text=ba.textwidget(
|
||||
query=self._text_field) + text)
|
||||
elif action == 'replace':
|
||||
ba.textwidget(edit=self._text_field, text=text)
|
||||
|
||||
|
|
@ -2107,7 +2112,9 @@ class LoginWindow:
|
|||
self._id = ba.textwidget(parent=self._root_widget,
|
||||
scale=0.5,
|
||||
color=(1, 1, 1),
|
||||
text=f'Account: ' + ba.internal.get_v1_account_misc_read_val_2('resolvedAccountID', ''),
|
||||
text=f'Account: ' +
|
||||
ba.internal.get_v1_account_misc_read_val_2(
|
||||
'resolvedAccountID', ''),
|
||||
size=(0, 0),
|
||||
position=(220, 170),
|
||||
h_align='center',
|
||||
|
|
@ -2525,7 +2532,8 @@ class Manual_camera_window:
|
|||
elif direction == 'z-':
|
||||
center[2] -= increment
|
||||
elif direction == 'reset':
|
||||
node.area_of_interest_bounds = activity._map.get_def_bound_box('area_of_interest_bounds')
|
||||
node.area_of_interest_bounds = activity._map.get_def_bound_box(
|
||||
'area_of_interest_bounds')
|
||||
return
|
||||
|
||||
aoi = (center[0] - size[0] / 2,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue