Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: "bottles:run/" uri processing #3444

Merged
merged 2 commits into from
Oct 9, 2024

Conversation

StLyn4
Copy link

@StLyn4 StLyn4 commented Jul 21, 2024

Description

It all started when I created a shortcut for Steam. After launching it, the bottle selection menu appeared and nothing else happened.
As tests have shown, the try block was always executed successfully (the return occurred immediately after the bottle selection GUI was created). Processing of bottles:run/ never occurred.

try:
from bottles.frontend.windows.bottlepicker import BottlePickerDialog
dialog = BottlePickerDialog(application=self, arg_exe=uri)
dialog.present()
return 0

In addition, the URI was then passed as is as the "-e" argument to bottles-cli, which led to a crash.

"-e",
f'"{self.arg_exe}"',

After this small patch, URI processing is now done first. In addition, the bottle selection GUI no longer appears (I can’t understand why the selection is needed if the bottle is ALREADY specified in the URI)

Fixes #3443
(At least it looks a lot like it)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Run xdg-open bottles:run/<bottle>/<program> without patch (not working)
  • Run xdg-open bottles:run/<bottle>/<program> with patch (working)

Vsevolod Volkov and others added 2 commits July 21, 2024 12:28
Copy link
Contributor

github-actions bot commented Oct 9, 2024

Pylint result on modfied files:
************* Module bottles.frontend.main
bottles/frontend/main.py:209:0: C0303: Trailing whitespace (trailing-whitespace)
bottles/frontend/main.py:32:0: C0413: Import "from gi.repository import Gtk, Gio, GLib, GObject, Adw" should be placed at the top of the module (wrong-import-position)
bottles/frontend/main.py:32:0: E0611: No name 'Adw' in module 'gi.repository' (no-name-in-module)
bottles/frontend/main.py:34:0: W0401: Wildcard import bottles.frontend.params (wildcard-import)
bottles/frontend/main.py:34:0: C0413: Import "from bottles.frontend.params import *" should be placed at the top of the module (wrong-import-position)
bottles/frontend/main.py:35:0: C0413: Import "from bottles.backend.logger import Logger" should be placed at the top of the module (wrong-import-position)
bottles/frontend/main.py:36:0: C0413: Import "from bottles.frontend.windows.main_window import MainWindow" should be placed at the top of the module (wrong-import-position)
bottles/frontend/main.py:37:0: C0413: Import "from bottles.frontend.views.preferences import PreferencesWindow" should be placed at the top of the module (wrong-import-position)
bottles/frontend/main.py:38:0: C0413: Import "from bottles.backend.health import HealthChecker" should be placed at the top of the module (wrong-import-position)
bottles/frontend/main.py:49:0: C0103: Constant name "base_dir" doesn't conform to UPPER_CASE naming style (invalid-name)
bottles/frontend/main.py:169:12: R1722: Consider using 'sys.exit' instead (consider-using-sys-exit)
bottles/frontend/main.py:175:12: W0105: String statement has no effect (pointless-string-statement)
bottles/frontend/main.py:213:12: C0415: Import outside toplevel (subprocess) (import-outside-toplevel)
bottles/frontend/main.py:215:12: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
bottles/frontend/main.py:219:12: C0415: Import outside toplevel (bottles.frontend.windows.bottlepicker.BottlePickerDialog) (import-outside-toplevel)
bottles/frontend/main.py:264:8: R1722: Consider using 'sys.exit' instead (consider-using-sys-exit)
bottles/frontend/main.py:255:0: W0613: Unused argument 'args' (unused-argument)
bottles/frontend/main.py:267:15: W0613: Unused argument 'action' (unused-argument)
bottles/frontend/main.py:267:28: W0613: Unused argument 'param' (unused-argument)
bottles/frontend/main.py:277:24: W0613: Unused argument 'action' (unused-argument)
bottles/frontend/main.py:277:37: W0613: Unused argument 'param' (unused-argument)
bottles/frontend/main.py:287:0: W0613: Unused argument 'args' (unused-argument)
bottles/frontend/main.py:291:4: W1113: Keyword argument before variable positional arguments list in the definition of __show_importer_view function (keyword-arg-before-vararg)
bottles/frontend/main.py:291:35: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/main.py:291:0: W0613: Unused argument 'args' (unused-argument)
bottles/frontend/main.py:277:4: W0238: Unused private member `Bottles.__refresh(self, action=None, param=None)` (unused-private-member)
bottles/frontend/main.py:252:8: W0201: Attribute 'win' defined outside __init__ (attribute-defined-outside-init)
bottles/frontend/main.py:382:9: W0613: Unused argument 'version' (unused-argument)
bottles/frontend/main.py:20:0: C0411: standard import "os" should be placed before third party import "gi" (wrong-import-order)
bottles/frontend/main.py:21:0: C0411: standard import "gettext" should be placed before third party import "gi" (wrong-import-order)
bottles/frontend/main.py:22:0: C0411: standard import "locale" should be placed before third party import "gi" (wrong-import-order)
bottles/frontend/main.py:23:0: C0411: standard import "webbrowser" should be placed before third party import "gi" (wrong-import-order)
bottles/frontend/main.py:24:0: C0411: standard import "os.path" should be placed before third party import "gi" (wrong-import-order)
bottles/frontend/main.py:20:0: W0611: Unused import os (unused-import)
bottles/frontend/main.py:34:0: W0614: Unused import(s) APP_NAME_LOWER, APP_ID, BUILD_TYPE, ANIM_DURATION, EXECUTABLE_EXTS and DOC_URL from wildcard import of bottles.frontend.params (unused-wildcard-import)

@mirkobrombin mirkobrombin merged commit def6ce5 into bottlesdevs:main Oct 9, 2024
4 checks passed
@StLyn4 StLyn4 deleted the xdg-open-fix branch October 10, 2024 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Using xdg-open command is causing Bottles to not open requested app
2 participants