-
-
Notifications
You must be signed in to change notification settings - Fork 672
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
Install/Remove/Uninstall from Command line without GUI #3029
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First look review, noticed some misspellings and inconsistencies.
lutris/gui/application.py
Outdated
@@ -46,6 +46,7 @@ | |||
from lutris.util.steam.appmanifest import AppManifest, get_appmanifests | |||
from lutris.util.steam.config import get_steamapps_paths | |||
from lutris.util.wine.dxvk import init_dxvk_versions, wait_for_dxvk_init | |||
from lutris.installer import silient_install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change silient -> silent.
lutris/gui/application.py
Outdated
Gtk.StyleContext.add_provider_for_screen(screen, self.css_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION) | ||
|
||
if options.contains("install_path"): | ||
silient_install.SilenInstall( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change silient -> silent
lutris/gui/application.py
Outdated
game_slug=game_slug, | ||
installer_file=installer_file, | ||
revision=revision, | ||
binary_path=options.lookup_value("bin_path").get_string().split("; "), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is there an empty space after ; in the split string?
lutris/gui/installerwindow.py
Outdated
@@ -527,3 +528,12 @@ def attach_logger(self, command): | |||
self.widget_box.pack_end(scrolledwindow, True, True, 10) | |||
scrolledwindow.show() | |||
self.log_textview.show() | |||
|
|||
def set_cancle_butten_sensitive(self, sensitivity): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change cancle_butten -> cancel_button
lutris/installer/commands.py
Outdated
@@ -365,7 +365,7 @@ def task(self, data): | |||
""" | |||
self._check_required_params("name", data, "task") | |||
if self.parent: | |||
GLib.idle_add(self.parent.cancel_button.set_sensitive, False) | |||
GLib.idle_add(self.parent.cancel_button_set_sensitive, False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is not defined. You defined set_cancel_button_sensitve (after correcting the mispellings reported earlier).
lutris/installer/silient_install.py
Outdated
self._print(self.commandline, text) | ||
|
||
# required by interpreter | ||
def clean_widgets(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required? This SilentInstall class does not extend or inherit any class, so where is this requirement coming from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Script Interpreter requires a parent class. At the moment this is only the installer window and via this function, the script interpreter make changes on the Window.
Either there had to be a lot of changes in the script interpreter (like raising signals instead of calling the installer window as parent) or the GUI functions have to be available, so the program does not crash.
This is also the reason why there are some changes to GUI accesses like
continue_button.hide()
into functions
continue_button_hide()
Otherwise there would be a lot of GUI dependencies in the silent installer.
lutris/installer/silient_install.py
Outdated
pass | ||
|
||
# required by interpreter | ||
def add_spinner(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required? This SilentInstall class does not extend or inherit any class, so where is this requirement coming from?
lutris/installer/silient_install.py
Outdated
pass | ||
|
||
# required by interpreter | ||
def set_cancle_butten_sensitive(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required? This SilentInstall class does not extend or inherit any class, so where is this requirement coming from?
lutris/installer/silient_install.py
Outdated
pass | ||
|
||
# required by interpreter | ||
def continue_button_hide(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required? This SilentInstall class does not extend or inherit any class, so where is this requirement coming from?
lutris/installer/silient_install.py
Outdated
pass | ||
|
||
def attach_logger(self, command): | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this function even exist?
If the actions are silent then there shouldn't be any input menus or other user interaction required as that kinda defeats the purpose of being silent, right? |
I invoke the install process, like the installwindow. The GUI functions (addSpinner etc.) are required, because of the direct GUI accesses. |
lutris/installer/commands.py
Outdated
@@ -216,7 +216,7 @@ def insert_disc(self, data): | |||
"<i>%s</i>") % requires | |||
) | |||
if self.runner == "wine": | |||
GLib.idle_add(self.parent.eject_button.show) | |||
self.parent.eject_button_show() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you remove that,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved it into the installer window.
https://github.com/lutris/lutris/pull/3029/files#diff-09064015f83e9cec3fca291ce9ae5954R538-R539
Otherwise the silent installer needs an eject_button with all the GUI dependencies.
This way I only need to provide an empty function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is extremely sloppy. Contains a bunch of typos. Makes unexpected changes to the code. Adds options that weren't planned in the initial ticket.
Fix all of it.
Input menu values have to be passed from the command line. The unattended installer must check that all values have been provided before launching the install and quit if one is not provided/invalid. Also, I don't think the remove command line flag should be added. |
2050119
to
6a3f481
Compare
Deleted remove command line option. The only thing which bothers me, is that installers who don't need any files are installed with |
This comment was marked as spam.
This comment was marked as spam.
I'd love to see this feature added to Lutris. Thank you for the patches, @tarTG! It would greatly help me to automate some of the game installation for the gaming computers I maintain for our kids and their friends. Any chance of signing the Contributor License Agreement to finish this off? |
game_slug=game_slug, | ||
installer_file=installer_file, | ||
revision=revision, | ||
binary_path=options.lookup_value("bin_path").get_string().split(":"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're check (above) for install_path
and input_menu
but for bin_path
no if statement ... is it safe ?
return 0 | ||
|
||
if action == "uninstall": | ||
if not db_game or not db_game["id"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
field/key id
exist necessarly ?
|
||
# Check if given files match the number of needed files in the skript. Also test if the files available | ||
if "files" in self.script["script"]: | ||
req_files = list(filter(lambda file: "N/A" in file[next(iter(file))], self.script["script"]["files"])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
list-comprehension is (a bit) more readable:
req_files = [file for self.script["script"]["files"] if "N/A" in file[next(iter(file))]]
Fixes #2907
Currently it works like
Silent Install
lutris --install (game slug / url) --bin_path path_to_binary1; path_to_binary2 [--install_path path_to_install_folder]
If install folder is not given, the default one is used.
Silent Remove
lutris --remove id/game_slug
Silent Uninstall
lutris --uninstall id/game_slug
Missing Runners are installed without asking
Disks are searched in the standard search paths
I don't know how to handle input menus for this case. So the program prints an error and stops.
Any suggestions?