tyrope / DVSaveSwitcher

Derail Valley Savegame Switcher
https://www.nexusmods.com/derailvalley/mods/127/
MIT License
1 stars 0 forks source link

Linux/Mac compatability, process list #4

Closed LottieVixen closed 2 years ago

LottieVixen commented 2 years ago

Describe the bug Won't work on linux or mac due to process_exists calling tasklist which doesn't exist on either systems

To Reproduce Steps to reproduce the behavior: run python DVSaveSwitcher.py

Expected behavior get the process list another way on linux or bypass the check and just warn the user that the game should be closed.

Copy-paste

lottie@roci ~/g/DVSaveSwitcher (master)> python DVSaveSwitcher.py
---------------------------------------------
-- Derail Valley Savegame Switcher v1.0.6  --
-- (c)2020-2021 Dimitri "Tyrope" Molenaars --
--     See LICENSE for more information    --
---------------------------------------------
Loading configuration...
Config file found.
Savegame location: /home/lottie/steam/steam/steamapps/common/Derail\ Valley/DerailValley_Data/SaveGameData
Configuration complete.
Traceback (most recent call last):
  File "/home/lottie/git/DVSaveSwitcher/DVSaveSwitcher.py", line 225, in <module>
    while process_exists('derailValley.exe'):
  File "/home/lottie/git/DVSaveSwitcher/DVSaveSwitcher.py", line 197, in process_exists
    output = subprocess.check_output(call).decode(errors="ignore")
  File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.9/subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'TASKLIST'

Desktop (please complete the following information):

tyrope commented 2 years ago

image

tyrope commented 2 years ago

Whilst the game doesn't officially support Max and Linux, and I can't test due to not having those platforms, support and development for those platforms will be up to the community; "Patches welcome", as they say.