Skip to content

Commit

Permalink
chore: pre-commit black magic
Browse files Browse the repository at this point in the history
  • Loading branch information
EmoonX committed Dec 19, 2024
1 parent 6e0f84a commit 0c7dd0e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 19 deletions.
5 changes: 4 additions & 1 deletion bottles/backend/wine/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ def __init__(
self.config.Parameters.fsr_quality_mode
)

if program_gamescope is not None and program_gamescope != self.config.Parameters.gamescope:
if (
program_gamescope is not None
and program_gamescope != self.config.Parameters.gamescope
):
self.environment["GAMESCOPE"] = "1" if program_gamescope else "0"

if env_dll_overrides:
Expand Down
1 change: 1 addition & 0 deletions bottles/backend/wine/midi.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from bottles.backend.models.config import BottleConfig
from bottles.backend.wine.reg import Reg


class MIDI:
instruments = {}

Expand Down
10 changes: 0 additions & 10 deletions bottles/frontend/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,16 +633,6 @@ def run_program(self):
_keep = self.args.keep_args
_args = " ".join(self.args.args)
_executable = self.args.executable
_cwd = None
_pre_script = None
_post_script = None
_midi_soundfont = None
_program_dxvk = None
_program_vkd3d = None
_program_dxvk_nvapi = None
_program_fsr = None
_program_gamescope = None
_program_virt_desktop = None

mng = Manager(g_settings=self.settings, is_cli=True)
mng.checks()
Expand Down
2 changes: 1 addition & 1 deletion bottles/frontend/utils/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __set_filter(dialog: GObject.Object, name: str, *patterns: str):
filter.set_name(name)
for pattern in patterns:
filter.add_pattern(pattern)

if isinstance(dialog, Gtk.FileDialog):
filters = dialog.get_filters() or Gio.ListStore.new(Gtk.FileFilter)
filters.append(filter)
Expand Down
13 changes: 6 additions & 7 deletions bottles/frontend/windows/launchoptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,24 +351,23 @@ def __reset_cwd(self, *_args):
self.config, self.program["path"]
)
self.action_cwd.set_subtitle(self.__default_cwd_msg)
self.btn_cwd_reset.set_visible(False)
self.btn_cwd_reset.set_visible(False)

def __choose_midi_soundfont(self, *_args):

def set_path(dialog, result):

try:
file = dialog.open_finish(result)
if file is None:
self.action_midi_soundfont.set_subtitle(
self.__default_midi_soundfont_msg)
self.__default_midi_soundfont_msg
)
return

file_path = file.get_path()
self.program["midi_soundfont"] = file_path
self.action_midi_soundfont.set_subtitle(file_path)
self.btn_midi_soundfont_reset.set_visible(True)

except GLib.Error as error:
# also thrown when dialog has been cancelled
if error.code == 2:
Expand All @@ -384,10 +383,10 @@ def set_path(dialog, result):
dialog = Gtk.FileDialog.new()
dialog.set_title(_("Select MIDI SoundFont"))
dialog.set_modal(True)

add_soundfont_filters(dialog)
add_all_filters(dialog)

dialog.open(parent=self.window, callback=set_path)

def __reset_midi_soundfont(self, *_args):
Expand Down

0 comments on commit 0c7dd0e

Please sign in to comment.