Skip to content

Commit 183809e

Browse files
committed
style: apply quote style rules
1 parent 326c2d8 commit 183809e

20 files changed

+84
-84
lines changed

basilisk/__main__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ def parse_args():
5858
action="store_true",
5959
)
6060
parser.add_argument(
61-
'bskc_file',
62-
nargs='?',
63-
help='Basilisk conversation file to open',
61+
"bskc_file",
62+
nargs="?",
63+
help="Basilisk conversation file to open",
6464
default=None,
6565
)
6666
return parser.parse_args()
@@ -79,7 +79,7 @@ def action_on_already_running() -> None:
7979
send_focus_signal()
8080

8181

82-
if __name__ == '__main__':
82+
if __name__ == "__main__":
8383
# Enable multiprocessing support for frozen executables
8484
multiprocessing.freeze_support()
8585

basilisk/accessible_output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def handle(
129129
except Exception as e:
130130
log.error("Failed to output text to screen reader", exc_info=e)
131131

132-
def handle_stream_buffer(self, new_text: str = ''):
132+
def handle_stream_buffer(self, new_text: str = ""):
133133
"""Processes incoming speech stream text and updates the buffer accordingly.
134134
135135
If the input `new_text` is not a valid string or is empty, it forces flushing the current buffer to the accessible output handler.

basilisk/config/config_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,6 @@ def save_config_file(conf_dict: dict, file_path: str) -> None:
122122
"""
123123
log.debug("Saving config file: %s", file_path)
124124
conf_save_path = search_existing_path(get_config_file_paths(file_path))
125-
with conf_save_path.open(mode='w', encoding="UTF-8") as config_file:
125+
with conf_save_path.open(mode="w", encoding="UTF-8") as config_file:
126126
yaml.dump(conf_dict, config_file, indent=2, sort_keys=False)
127127
log.debug("Config saved to %s", conf_save_path)

basilisk/conversation/conversation_model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ def get_labels(cls) -> dict[MessageRoleEnum, str]:
4646
"""
4747
return {
4848
# Translators: Label indicating that the message is from the user in a conversation
49-
cls.USER: _("User:") + ' ',
49+
cls.USER: _("User:") + " ",
5050
# Translators: Label indicating that the message is from the assistant in a conversation
51-
cls.ASSISTANT: _("Assistant:") + ' ',
51+
cls.ASSISTANT: _("Assistant:") + " ",
5252
# Translators: Label indicating that the message is a system message in a conversation
53-
cls.SYSTEM: _("System:") + ' ',
53+
cls.SYSTEM: _("System:") + " ",
5454
}
5555

5656

basilisk/gui/base_conversation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ def create_max_tokens_widget(self) -> wx.StaticText:
380380
label=_("Max to&kens:"),
381381
)
382382
self.max_tokens_spin_ctrl = wx.SpinCtrl(
383-
self, value='0', min=0, max=2000000
383+
self, value="0", min=0, max=2000000
384384
)
385385

386386
def create_temperature_widget(self) -> wx.StaticText:

basilisk/gui/history_msg_text_ctrl.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -700,19 +700,19 @@ def show_citations(self, event: wx.CommandEvent | None = None):
700700
key_actions = {
701701
(wx.MOD_SHIFT, wx.WXK_SPACE): on_toggle_speak_response,
702702
(wx.MOD_NONE, wx.WXK_SPACE): on_read_current_message,
703-
(wx.MOD_NONE, ord('J')): go_to_previous_message,
704-
(wx.MOD_NONE, ord('K')): go_to_next_message,
705-
(wx.MOD_NONE, ord('S')): on_select_current_message,
706-
(wx.MOD_NONE, ord('H')): on_show_as_html,
707-
(wx.MOD_NONE, ord('Q')): show_citations,
708-
(wx.MOD_NONE, ord('C')): on_copy_message,
709-
(wx.MOD_NONE, ord('B')): move_to_start_of_message,
710-
(wx.MOD_NONE, ord('N')): move_to_end_of_message,
711-
(wx.MOD_NONE, ord('E')): on_edit_message_block,
703+
(wx.MOD_NONE, ord("J")): go_to_previous_message,
704+
(wx.MOD_NONE, ord("K")): go_to_next_message,
705+
(wx.MOD_NONE, ord("S")): on_select_current_message,
706+
(wx.MOD_NONE, ord("H")): on_show_as_html,
707+
(wx.MOD_NONE, ord("Q")): show_citations,
708+
(wx.MOD_NONE, ord("C")): on_copy_message,
709+
(wx.MOD_NONE, ord("B")): move_to_start_of_message,
710+
(wx.MOD_NONE, ord("N")): move_to_end_of_message,
711+
(wx.MOD_NONE, ord("E")): on_edit_message_block,
712712
(wx.MOD_SHIFT, wx.WXK_DELETE): on_remove_message_block,
713713
(wx.MOD_NONE, wx.WXK_F3): on_search_next,
714-
(wx.MOD_NONE, ord('F')): on_search,
715-
(wx.MOD_CONTROL, ord('F')): on_search,
714+
(wx.MOD_NONE, ord("F")): on_search,
715+
(wx.MOD_CONTROL, ord("F")): on_search,
716716
(wx.MOD_SHIFT, wx.WXK_F3): on_search_previous,
717717
}
718718

basilisk/gui/main_frame.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import wx
1313
from more_itertools import locate
1414

15-
if sys.platform == 'win32':
15+
if sys.platform == "win32":
1616
import win32con
1717
import basilisk.config as config
1818
from basilisk import global_vars
@@ -273,17 +273,17 @@ def register_hot_key(self):
273273
self.RegisterHotKey(
274274
HotkeyAction.TOGGLE_VISIBILITY.value,
275275
win32con.MOD_CONTROL | win32con.MOD_ALT | win32con.MOD_SHIFT,
276-
ord('B'),
276+
ord("B"),
277277
)
278278
self.RegisterHotKey(
279279
HotkeyAction.CAPTURE_FULL.value,
280280
win32con.MOD_CONTROL | win32con.MOD_ALT | win32con.MOD_SHIFT,
281-
ord('F'),
281+
ord("F"),
282282
)
283283
self.RegisterHotKey(
284284
HotkeyAction.CAPTURE_WINDOW.value,
285285
win32con.MOD_CONTROL | win32con.MOD_ALT | win32con.MOD_SHIFT,
286-
ord('W'),
286+
ord("W"),
287287
)
288288

289289
def on_hotkey(self, event):
@@ -559,7 +559,7 @@ def on_name_conversation(self, event: wx.Event | None, auto: bool = False):
559559
title = current_tab.generate_conversation_title()
560560
if not title:
561561
return
562-
title = title.strip().replace('\n', ' ')
562+
title = title.strip().replace("\n", " ")
563563
dialog = NameConversationDialog(self, title=title, auto=auto)
564564
if dialog.ShowModal() != wx.ID_OK or not dialog.get_name():
565565
dialog.Destroy()
@@ -778,7 +778,7 @@ def on_install_nvda_addon(self, event):
778778
)
779779
log.debug("Creating NVDA addon: %s", tmp_nvda_addon_path)
780780
with zipfile.ZipFile(
781-
tmp_nvda_addon_path, 'w', zipfile.ZIP_DEFLATED
781+
tmp_nvda_addon_path, "w", zipfile.ZIP_DEFLATED
782782
) as zipf:
783783
for root, _, files in os.walk(res_nvda_addon_path):
784784
for file in files:

basilisk/gui/name_conversation_dialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def on_generate(self, event: wx.Event | None):
8787
try:
8888
title = self.parent.current_tab.generate_conversation_title()
8989
if title:
90-
title = title.strip().replace('\n', ' ')
90+
title = title.strip().replace("\n", " ")
9191
self.text_ctrl.SetValue(title)
9292
except Exception as e:
9393
wx.MessageBox(

basilisk/gui/ocr_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def on_ocr(self, event: wx.CommandEvent):
307307

308308
self.ocr_button.Disable()
309309

310-
cancel_flag = Value('i', 0)
310+
cancel_flag = Value("i", 0)
311311
result_queue = Queue()
312312

313313
progress_bar_dialog = ProgressBarDialog(

basilisk/gui/search_dialog.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def adjust_utf16_position(
4242
count_high_surrogates = sum(1 for c in relevant_text if ord(c) >= 0x10000)
4343
if reverse:
4444
count_high_surrogates -= count_high_surrogates
45-
count_line_breaks = sum(1 for c in relevant_text if c == '\n')
45+
count_line_breaks = sum(1 for c in relevant_text if c == "\n")
4646
if reverse:
4747
count_line_breaks -= count_line_breaks
4848
return position + count_high_surrogates + count_line_breaks
@@ -238,12 +238,12 @@ def _compile_search_pattern(self, query_text: str) -> re.Pattern:
238238
flags |= re.DOTALL
239239
if self._search_mode == SearchMode.EXTENDED:
240240
query_text = (
241-
query_text.replace(r'\n', '\n')
242-
.replace(r'\t', '\t')
243-
.replace(r'\r', '\r')
244-
.replace(r'\x00', '\x00')
245-
.replace(r'\x1F', '\x1f')
246-
.replace(r'\x7F', '\x7f')
241+
query_text.replace(r"\n", "\n")
242+
.replace(r"\t", "\t")
243+
.replace(r"\r", "\r")
244+
.replace(r"\x00", "\x00")
245+
.replace(r"\x1F", "\x1f")
246+
.replace(r"\x7F", "\x7f")
247247
)
248248
return re.compile(query_text, flags)
249249

0 commit comments

Comments
 (0)