umu-commander 1.5.5__py3-none-any.whl → 1.5.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of umu-commander might be problematic. Click here for more details.

umu_commander/__init__.py CHANGED
@@ -0,0 +1 @@
1
+ VERSION = "v1.5.6"
@@ -0,0 +1,71 @@
1
+ import os
2
+ import sys
3
+ from collections.abc import Callable
4
+ from json import JSONDecodeError
5
+
6
+ from umu_commander import configuration as config
7
+ from umu_commander import database as db
8
+ from umu_commander import tracking, umu_config
9
+ from umu_commander.classes import ExitCode
10
+ from umu_commander.configuration import CONFIG_DIR, CONFIG_NAME
11
+ from umu_commander.util import print_help
12
+
13
+
14
+ def main() -> ExitCode:
15
+ try:
16
+ config.load()
17
+ except (JSONDecodeError, KeyError):
18
+ config_path: str = os.path.join(CONFIG_DIR, CONFIG_NAME)
19
+ old_config_path: str = os.path.join(CONFIG_DIR, CONFIG_NAME + ".old")
20
+
21
+ print(f"Config file at {config_path} could not be read.")
22
+
23
+ if not os.path.exists(old_config_path):
24
+ print(f"Config file renamed to {old_config_path}.")
25
+ os.rename(config_path, old_config_path)
26
+
27
+ except FileNotFoundError:
28
+ config.dump()
29
+
30
+ try:
31
+ db.load()
32
+ except JSONDecodeError:
33
+ db_path: str = os.path.join(config.DB_DIR, config.DB_NAME)
34
+ old_db_path: str = os.path.join(config.DB_DIR, config.DB_NAME + ".old")
35
+
36
+ print(f"Tracking file at {db_path} could not be read.")
37
+
38
+ if not os.path.exists(old_db_path):
39
+ print(f"DB file renamed to {old_db_path}.")
40
+ os.rename(db_path, old_db_path)
41
+
42
+ except FileNotFoundError:
43
+ pass
44
+
45
+ dispatch: dict[str, Callable] = {
46
+ "track": tracking.track,
47
+ "untrack": tracking.untrack,
48
+ "users": tracking.users,
49
+ "delete": tracking.delete,
50
+ "create": umu_config.create,
51
+ "run": umu_config.run,
52
+ }
53
+
54
+ if len(sys.argv) == 1:
55
+ print_help()
56
+ return ExitCode.SUCCESS.value
57
+ elif sys.argv[1] not in dispatch:
58
+ print("Invalid verb.")
59
+ print_help()
60
+ return ExitCode.INVALID_SELECTION.value
61
+
62
+ dispatch[sys.argv[1]]()
63
+
64
+ tracking.untrack_unlinked()
65
+ db.dump()
66
+
67
+ return ExitCode.SUCCESS.value
68
+
69
+
70
+ if __name__ == "__main__":
71
+ exit(main())
umu_commander/classes.py CHANGED
@@ -77,5 +77,5 @@ class ProtonDir(Group):
77
77
 
78
78
  class ExitCode(Enum):
79
79
  SUCCESS = 0
80
- READING_ERROR = 1
80
+ DECODING_ERROR = 1
81
81
  INVALID_SELECTION = 2
@@ -29,11 +29,7 @@ DLL_OVERRIDES_OPTIONS: tuple[DLLOverride, ...] = (
29
29
 
30
30
 
31
31
  def load():
32
- config_path: str = os.path.join(CONFIG_DIR, CONFIG_NAME)
33
- if not os.path.exists(config_path):
34
- return
35
-
36
- with open(config_path, "rb") as conf_file:
32
+ with open(os.path.join(CONFIG_DIR, CONFIG_NAME), "rb") as conf_file:
37
33
  toml_conf = tomllib.load(conf_file)
38
34
  if "DLL_OVERRIDES_OPTIONS" in toml_conf:
39
35
  toml_conf["DLL_OVERRIDES_OPTIONS"] = tuple(
umu_commander/database.py CHANGED
@@ -15,11 +15,9 @@ def load():
15
15
  if not os.path.exists(config.DB_DIR):
16
16
  os.mkdir(config.DB_DIR)
17
17
 
18
- db_path: str = os.path.join(config.DB_DIR, config.DB_NAME)
19
- if not os.path.exists(db_path):
20
- return
21
-
22
- with open(os.path.join(db_path), "rt") as db_file:
18
+ with open(
19
+ os.path.join(os.path.join(config.DB_DIR, config.DB_NAME)), "rt"
20
+ ) as db_file:
23
21
  _db.update(json.load(db_file))
24
22
 
25
23
 
umu_commander/proton.py CHANGED
@@ -25,9 +25,9 @@ def refresh_proton_versions():
25
25
  if "PROTONPATH" in line and "/" in line:
26
26
  try:
27
27
  left: int = line.rfind("/") + 1
28
- print(f":Latest umu Proton: {line[left:len(line) - 1]}.")
28
+ print(f":Latest UMU-Proton: {line[left:len(line) - 1]}.")
29
29
  except ValueError:
30
- print("Could not fetch latest umu Proton.")
30
+ print("Could not fetch latest UMU-Proton.")
31
31
 
32
32
  break
33
33
 
umu_commander/tracking.py CHANGED
@@ -57,10 +57,15 @@ def users():
57
57
  if proton_ver.dir in db.get() and proton_ver.version_num in db.get(proton_ver.dir):
58
58
  version_users: list[str] = db.get(proton_ver.dir, proton_ver.version_num)
59
59
  if len(version_users) > 0:
60
- print(f"Directories tracked by {proton_ver.version_num} of {proton_ver.dir}:")
61
- print(*version_users, sep="\n")
60
+ print(
61
+ f"Directories tracked by {proton_ver.version_num} of {proton_ver.dir}:",
62
+ *version_users,
63
+ sep="\n\t",
64
+ )
65
+
62
66
  else:
63
67
  print("This version is tracking no directories.")
68
+
64
69
  else:
65
70
  print("This version hasn't been used by umu before.")
66
71
 
@@ -141,4 +141,3 @@ def run():
141
141
  args=["umu-run", "--config", config.UMU_CONFIG_NAME],
142
142
  env=os.environ,
143
143
  )
144
-
umu_commander/util.py CHANGED
@@ -1,3 +1,4 @@
1
+ from umu_commander import VERSION
1
2
  from umu_commander.classes import Element, ExitCode, Group, Value
2
3
 
3
4
 
@@ -91,3 +92,13 @@ def get_selection(
91
92
  return _translate_index_to_selection(
92
93
  selection_index, selection_elements, selection_groups
93
94
  )
95
+
96
+
97
+ def print_help():
98
+ print(
99
+ f"umu-commander {VERSION}",
100
+ "Interactive CLI tool to augment umu-launcher as well as help you manage its Proton versions.",
101
+ "",
102
+ "For details, usage, and more, see the README.md file, or visit https://github.com/Mpaxlamitsounas/umu-commander.",
103
+ sep="\n",
104
+ )
@@ -0,0 +1,61 @@
1
+ Metadata-Version: 2.4
2
+ Name: umu-commander
3
+ Version: 1.5.6
4
+ Summary: umu-commander is an interactive CLI tool to help you manage umu.
5
+ Project-URL: Homepage, https://github.com/Mpaxlamitsounas/umu-commander
6
+ Project-URL: Issues, https://github.com/Mpaxlamitsounas/umu-commander/issues
7
+ Author-email: Mpaxlamitsounas <worldstudy123@gmail.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE.txt
10
+ Keywords: umu,umu-launcher
11
+ Classifier: Operating System :: POSIX :: Linux
12
+ Classifier: Programming Language :: Python :: 3
13
+ Requires-Python: >=3.12
14
+ Requires-Dist: tomli-w
15
+ Description-Content-Type: text/markdown
16
+
17
+ ## umu-commander
18
+ ### umu-commander is an interactive CLI tool to augment umu-launcher as well as help you manage its Proton versions.
19
+
20
+ Proton versions can track and untrack directories, with the intention of safely removing them once no game depends on one.
21
+
22
+ Vanilla umu config files currently (06/2025) do not support setting environmental variables. This tool adds such functionality with an extra TOML table within said configs, see `example_config.toml` for an example.
23
+
24
+ ### Config
25
+ The configuration file lives at `~/.config/umu-commander.toml`, which cannot be changed as of now. You can generate one by running the app by itself.
26
+
27
+ The config schema is as follows:
28
+
29
+ | Name | Description |
30
+ |:--------------------------|:-------------------------------------------------------------------|
31
+ | `PROTON_PATHS` | List of directories umu-commander will search for Proton versions. |
32
+ | `UMU_PROTON_PATH` | Directory where umu-launcher downloads its UMU-Proton versions. |
33
+ | `DB_NAME` | Tracking DB filename. |
34
+ | `DB_DIR` | Directory where the Tracking DB is stored. |
35
+ | `UMU_CONFIG_NAME` | Name of the umu config created using umu-commander create. |
36
+ | `DEFAULT_PREFIX_DIR` | Directory where umu-commander will search for WINE prefixes. |
37
+ | `[DLL_OVERRIDES_OPTIONS]` | TOML table where all possible DLL overrides are listed. |
38
+
39
+ To add an extra DLL override option, add a line below the table in the form "`Label`" = "`WINE override string`". Use the winhttp example as a template.
40
+
41
+ ### Verbs
42
+ umu-commander needs one of the following verbs specified after the executable name:
43
+
44
+ | Name | Description |
45
+ |:--------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
46
+ | track | Tracks current directory with the selected Proton version.<br/>Also removes it from any other tracking lists. |
47
+ | untrack | Removes the current directory from all tracking lists. |
48
+ | users | Lists which directories the selected Proton version is tracking. |
49
+ | delete | Interactively deletes Proton versions that are currently tracking nothing.<br/>Will not remove the latest UMU-Proton and Proton versions that haven't been used for tracking before.<br/>umu-commander will never delete anything without invoking this verb and confirming. |
50
+ | create | Creates an augmented umu config in the current directory.<br/>These configs are compatible with vanilla umu-launcher, although the DLL override functionality won't work. |
51
+ | run | Runs a program using the umu config in the current directory. |
52
+
53
+ ### Installation/Usage
54
+ Add umu-run to your PATH and then install with pipx by running `pipx install umu-commander`. After that you can use umu-commander by running `umu-commander <verb>`.
55
+
56
+ ### Return codes
57
+ | Number | Name | Description |
58
+ |:-------|:------------------|:----------------------------------------------------------------|
59
+ | 0 | SUCCESS | Program executed as intended. |
60
+ | 1 | DECODING_ERROR | Failed to parse a file. |
61
+ | 2 | INVALID_SELECTION | User selected an invalid verb or there are no valid selections. |
@@ -0,0 +1,14 @@
1
+ umu_commander/__init__.py,sha256=THBINIkksJ2OSZ2kpSzyYakqjPzjkKhk4d1XC_2D0NU,19
2
+ umu_commander/__main__.py,sha256=Zo5NbQ8lYsmNo7oN3ekeJ5VPyiETcbasEYkfBMkFZ-A,1994
3
+ umu_commander/classes.py,sha256=3vEC7Iq3buEUaIIJKO1ze57hs9yQ_-9pnkazHkSfcLk,1655
4
+ umu_commander/configuration.py,sha256=bF_1n_8PQ04GmJZpC1scQ5OBZbsVXPstJ9RGfKE-D5k,2277
5
+ umu_commander/database.py,sha256=mkBX0e6YEv2dWU2hCMaZwhSD02f_XefW0qbErcVHHYo,1183
6
+ umu_commander/proton.py,sha256=g2skvgM4d8mnL9MA3rmYxJOCpODPYyRfIdh4KakNWU8,2553
7
+ umu_commander/tracking.py,sha256=WfWeQWnNNK_q-1rFt0HPFNDD8z7VcTCYKI5A_W8xNIg,3113
8
+ umu_commander/umu_config.py,sha256=gJsK4g33vtBpfvfSJcQBCoM3zzuWQ9kGX5IUSOFw6ow,4191
9
+ umu_commander/util.py,sha256=hTNGK6HN5nHGH5HEA8mUxOM5f2S_IpawHmbhpw2H4ig,3013
10
+ umu_commander-1.5.6.dist-info/METADATA,sha256=9CHWg8ULk_UIP71HtnR5dPfG9E2tNkROP9VfShg-I9Q,5365
11
+ umu_commander-1.5.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
12
+ umu_commander-1.5.6.dist-info/entry_points.txt,sha256=ljyUmDmgCCMm7mQgB1syoWbf_5AiemyrS6YN7eTn9CI,62
13
+ umu_commander-1.5.6.dist-info/licenses/LICENSE.txt,sha256=yipFXBRmVZ2Q44x1q18HccPUAECBQLXAOAr21aS57uY,1071
14
+ umu_commander-1.5.6.dist-info/RECORD,,
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ umu-commander = umu_commander.__main__:main
umu_commander/main.py DELETED
@@ -1,68 +0,0 @@
1
- #!/usr/bin/python3
2
- import os
3
- import sys
4
- from json import JSONDecodeError
5
-
6
- import umu_commander.configuration as config
7
- import umu_commander.database as db
8
- from umu_commander import tracking, umu_config
9
- from umu_commander.classes import ExitCode
10
- from umu_commander.configuration import CONFIG_DIR, CONFIG_NAME
11
-
12
-
13
- def print_help():
14
- print(
15
- "umu-commander is an interactive CLI tool to help you manage Proton versions used by umu, as well as create enhanced launch configs.",
16
- "",
17
- "For details, explanations, and more, see the README.md file, or visit https://github.com/Mpaxlamitsounas/umu-commander.",
18
- sep="\n",
19
- )
20
-
21
-
22
- def main() -> ExitCode:
23
- try:
24
- config.load()
25
- except (JSONDecodeError, KeyError):
26
- config_path: str = os.path.join(CONFIG_DIR, CONFIG_NAME)
27
- print(f"Config file at {config_path} could not be read.")
28
- os.rename(config_path, os.path.join(CONFIG_DIR, CONFIG_NAME + ".old"))
29
-
30
- try:
31
- db.load()
32
- except JSONDecodeError:
33
- db_path: str = os.path.join(config.DB_DIR, config.DB_NAME)
34
- print(f"Tracking file at {db_path} could not be read.")
35
- os.rename(db_path, os.path.join(config.DB_DIR, config.DB_NAME + ".old"))
36
-
37
- if len(sys.argv) == 1:
38
- print_help()
39
- return ExitCode.SUCCESS.value
40
-
41
- verb: str = sys.argv[1]
42
- match verb:
43
- case "track":
44
- tracking.track()
45
- case "untrack":
46
- tracking.untrack()
47
- case "users":
48
- tracking.users()
49
- case "delete":
50
- tracking.delete()
51
- case "create":
52
- umu_config.create()
53
- case "run":
54
- umu_config.run()
55
- case _:
56
- print("Invalid verb.")
57
- print_help()
58
- return ExitCode.INVALID_SELECTION.value
59
-
60
- tracking.untrack_unlinked()
61
- db.dump()
62
- config.dump()
63
-
64
- return ExitCode.SUCCESS.value
65
-
66
-
67
- if __name__ == "__main__":
68
- exit(main())
@@ -1,59 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: umu-commander
3
- Version: 1.5.5
4
- Summary: umu-commander is an interactive CLI tool to help you manage umu.
5
- Project-URL: Homepage, https://github.com/Mpaxlamitsounas/umu-commander
6
- Project-URL: Issues, https://github.com/Mpaxlamitsounas/umu-commander/issues
7
- Author-email: Mpaxlamitsounas <worldstudy123@gmail.com>
8
- License-Expression: MIT
9
- License-File: LICENSE.txt
10
- Keywords: umu,umu-launcher
11
- Classifier: Operating System :: POSIX :: Linux
12
- Classifier: Programming Language :: Python :: 3
13
- Requires-Python: >=3.12
14
- Requires-Dist: tomli-w
15
- Description-Content-Type: text/markdown
16
-
17
- ## umu-commander
18
- ### umu-commander is an interactive CLI tool to help you manage Proton versions used by umu, as well as create enhanced launch configs.
19
-
20
- Proton versions can be tracked and untracked, with the intention of being safely removable once no game depends on a specific one.\
21
- What directories each Proton version is being used by is tracked within `tracking.json` inside your umu Proton directory by default.
22
-
23
- Vanilla umu configuration files currently do not support setting environmental variables, this tool adds such functionality by adding an extra TOML table in the umu config itself. An example config is available under the name `example_config.toml`.
24
-
25
- ### Config
26
- The configuration file lives at `~/.config/umu-commander.toml`. Within it, you can edit the following:
27
- * PROTON_PATHS: List of directories umu-commander will search for Proton versions.
28
- * UMU_PROTON_PATH: Directory where umu itself downloads its umu Proton versions.
29
- * DB_NAME: Tracking DB filename.
30
- * DB_DIR: Directory where the Tracking DB is stored.
31
- * UMU_CONFIG_NAME: Name of the umu config created using umu-commander run.
32
- * DEFAULT_PREFIX_DIR: Directory where WINE prefixes are scanned.
33
- * [DLL_OVERRIDES_OPTIONS]: Category to list possible DLL overrides in "Label" = "Override string" format.
34
-
35
- ### Verbs
36
- umu-commander needs one of the following verbs specified after the executable name:
37
- * track: Adds the current directory to a specified Proton version's list of users.
38
- * If the directory is already in another list, it will be removed from it.
39
- * The create verb will automatically track the current directory.
40
- * This will not update any existing configs.
41
- * untrack: Removes the current directory from all tracking lists.
42
- * users: Lists each Proton version's users.
43
- * delete: Interactively deletes any Proton version in the tracking database with no users.
44
- * This will actually remove the Proton directories, use at your own risk.
45
- * If a Proton version has not been tracked before, it will not be removed, neither will the latest umu Proton.
46
- * umu-commander will not delete anything without invoking this verb and receiving confirmation.
47
- * create: Creates a custom configuration file in the current directory.
48
- * run: Uses the config in the current directory to run the program.
49
- * This is NOT equivalent to `umu-run --config <config_name>`, as vanilla umu configs do not support setting environment variables as of 07/2025.
50
-
51
- ### Installation/Usage
52
- Add umu-run to your PATH and then install with pipx by running `pipx install umu-commander`. After that you can invoke umu-commander by running `umu-commander <verb>`.
53
-
54
- ### Return codes
55
- | Number | Name | Description |
56
- |:-------|:------------------|:----------------------------------------------------------------|
57
- | 0 | SUCCESS | Program executed as intended. |
58
- | 1 | READING_ERROR | Failed to parse a file and could not recover. |
59
- | 2 | INVALID_SELECTION | User selected an invalid verb or there are no valid selections. |
@@ -1,14 +0,0 @@
1
- umu_commander/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- umu_commander/classes.py,sha256=SW8k4TrP4-W4DdaQC_P88wBIgeJ3TIaV7lyt32IfVD8,1654
3
- umu_commander/configuration.py,sha256=VmOmlXQS08OFlptu04P0zLgCsiToJMgKBXx35aRpnfU,2368
4
- umu_commander/database.py,sha256=_8FVW-gctDsR6K2LiHQy6Mr_yR0JTY-taIvqBb9Hr0E,1248
5
- umu_commander/main.py,sha256=-EghV73K7XlV_JXnYgLAc6Qt1svp3vT8s8TUVo6nIXQ,1945
6
- umu_commander/proton.py,sha256=ZJ3y8sjxTIKm5mUH32eXBGxGuJH_2gWXi_EoqJyOxko,2553
7
- umu_commander/tracking.py,sha256=V38nWlOZu0BUyPWssX6i0JoXOkd8NkKAdJ0hPauXlMM,3064
8
- umu_commander/umu_config.py,sha256=ilxWhiT2XhPn9qeJf-i2YWZIhVktPuMkNxpEfdnMF_A,4192
9
- umu_commander/util.py,sha256=e4IqnxT0K2lLsUUgqnK0Z60MJRasvGCzo90ZX-gVBOE,2648
10
- umu_commander-1.5.5.dist-info/METADATA,sha256=H7XhadfLpQZeVa8hUfP66Gm0oeTMsHdRM6oI_B4M_6o,3720
11
- umu_commander-1.5.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
12
- umu_commander-1.5.5.dist-info/entry_points.txt,sha256=7RGP35zAHeEojZ-sv7JIITuMeH_VVNuG2g2_SUrUnbM,58
13
- umu_commander-1.5.5.dist-info/licenses/LICENSE.txt,sha256=yipFXBRmVZ2Q44x1q18HccPUAECBQLXAOAr21aS57uY,1071
14
- umu_commander-1.5.5.dist-info/RECORD,,
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- umu-commander = umu_commander.main:main