Skip to content

Commit

Permalink
Fix ruff: stop using % to format string
Browse files Browse the repository at this point in the history
  • Loading branch information
Yutsuten committed Apr 26, 2024
1 parent 56d01b8 commit f5d8725
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
python -m pip install ruff
- name: Lint with ruff
run: |
ruff src/
ruff check src/
8 changes: 4 additions & 4 deletions src/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def choose_color() -> None:
if not color_dialog.exec():
return
color = color_dialog.currentColor().name()
css = 'QLabel { background-color: %s; }' % color
css = f'QLabel {{ background-color: {color}; }}'
preview_label.setStyleSheet(css)

label = self._qt.QLabel(label_text)
Expand All @@ -197,15 +197,15 @@ def choose_color() -> None:
preview_label.setToolTip(tooltip)

def set_value(color: str) -> None:
css = 'QLabel { background-color: %s; }' % color
css = f'QLabel {{ background-color: {color}; }}'
color_dialog.setCurrentColor(self._qt.QColor(color))
preview_label.setStyleSheet(css)

color_dialog.get_value = lambda: color_dialog.currentColor().name()
color_dialog.set_value = set_value

setattr(self.widget, '%sPreview' % cs_name, preview_label)
setattr(self.widget, '%sDialog' % cs_name, color_dialog)
setattr(self.widget, f'{cs_name}Preview', preview_label)
setattr(self.widget, f'{cs_name}Dialog', color_dialog)
self._layout.addWidget(label, self._row, 0)
self._layout.addWidget(select_button, self._row, 2)
self._layout.addWidget(preview_label, self._row, 3)
Expand Down

0 comments on commit f5d8725

Please sign in to comment.