umu-commander 1.6.0__tar.gz → 1.6.1__tar.gz
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-1.6.0 → umu_commander-1.6.1}/.idea/workspace.xml +106 -93
- {umu_commander-1.6.0 → umu_commander-1.6.1}/PKG-INFO +1 -1
- umu_commander-1.6.1/src/umu_commander/__init__.py +1 -0
- {umu_commander-1.6.0 → umu_commander-1.6.1}/src/umu_commander/__main__.py +35 -17
- {umu_commander-1.6.0 → umu_commander-1.6.1}/src/umu_commander/umu_config.py +17 -14
- {umu_commander-1.6.0 → umu_commander-1.6.1}/src/umu_commander/util.py +28 -8
- umu_commander-1.6.0/.idea/shelf/Uncommitted_changes_before_rebase_[Changes]/shelved.patch +0 -229
- umu_commander-1.6.0/.idea/shelf/Uncommitted_changes_before_rebase_[Changes]1/shelved.patch +0 -12
- umu_commander-1.6.0/.idea/shelf/Uncommitted_changes_before_rebase__Changes_.xml +0 -4
- umu_commander-1.6.0/.idea/shelf/Uncommitted_changes_before_rebase__Changes_1.xml +0 -4
- umu_commander-1.6.0/src/umu_commander/__init__.py +0 -1
- {umu_commander-1.6.0 → umu_commander-1.6.1}/.gitignore +0 -0
- {umu_commander-1.6.0 → umu_commander-1.6.1}/.idea/.gitignore +0 -0
- {umu_commander-1.6.0 → umu_commander-1.6.1}/.idea/inspectionProfiles/Project_Default.xml +0 -0
- {umu_commander-1.6.0 → umu_commander-1.6.1}/.idea/inspectionProfiles/profiles_settings.xml +0 -0
- {umu_commander-1.6.0 → umu_commander-1.6.1}/.idea/jsonSchemas.xml +0 -0
- {umu_commander-1.6.0 → umu_commander-1.6.1}/.idea/misc.xml +0 -0
- {umu_commander-1.6.0 → umu_commander-1.6.1}/.idea/modules.xml +0 -0
- {umu_commander-1.6.0 → umu_commander-1.6.1}/.idea/umu-commander.iml +0 -0
- {umu_commander-1.6.0 → umu_commander-1.6.1}/.idea/vcs.xml +0 -0
- {umu_commander-1.6.0 → umu_commander-1.6.1}/LICENSE.txt +0 -0
- {umu_commander-1.6.0 → umu_commander-1.6.1}/README.md +0 -0
- {umu_commander-1.6.0 → umu_commander-1.6.1}/example_config.toml +0 -0
- {umu_commander-1.6.0 → umu_commander-1.6.1}/pyproject.toml +0 -0
- {umu_commander-1.6.0 → umu_commander-1.6.1}/src/umu_commander/classes.py +0 -0
- {umu_commander-1.6.0 → umu_commander-1.6.1}/src/umu_commander/configuration.py +0 -0
- {umu_commander-1.6.0 → umu_commander-1.6.1}/src/umu_commander/database.py +0 -0
- {umu_commander-1.6.0 → umu_commander-1.6.1}/src/umu_commander/proton.py +0 -0
- {umu_commander-1.6.0 → umu_commander-1.6.1}/src/umu_commander/tracking.py +0 -0
- {umu_commander-1.6.0 → umu_commander-1.6.1}/tests/__init__.py +0 -0
- {umu_commander-1.6.0 → umu_commander-1.6.1}/tests/test_config.py +0 -0
- {umu_commander-1.6.0 → umu_commander-1.6.1}/tests/test_db.py +0 -0
- {umu_commander-1.6.0 → umu_commander-1.6.1}/tests/test_manual.py +0 -0
- {umu_commander-1.6.0 → umu_commander-1.6.1}/tests/test_proton.py +0 -0
- {umu_commander-1.6.0 → umu_commander-1.6.1}/tests/test_tracking.py +0 -0
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
<option name="autoReloadType" value="SELECTIVE" />
|
|
5
5
|
</component>
|
|
6
6
|
<component name="ChangeListManager">
|
|
7
|
-
<list default="true" id="043620f1-711f-4c27-a2e2-15fa501e8ce0" name="Changes" comment="1.6.
|
|
7
|
+
<list default="true" id="043620f1-711f-4c27-a2e2-15fa501e8ce0" name="Changes" comment="1.6.1">
|
|
8
|
+
<change beforePath="$PROJECT_DIR$/src/umu_commander/__main__.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/umu_commander/__main__.py" afterDir="false" />
|
|
9
|
+
</list>
|
|
8
10
|
<option name="SHOW_DIALOG" value="false" />
|
|
9
11
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
10
12
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
@@ -50,52 +52,52 @@
|
|
|
50
52
|
<option name="hideEmptyMiddlePackages" value="true" />
|
|
51
53
|
<option name="showLibraryContents" value="true" />
|
|
52
54
|
</component>
|
|
53
|
-
<component name="PropertiesComponent"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
55
|
+
<component name="PropertiesComponent"><![CDATA[{
|
|
56
|
+
"keyToString": {
|
|
57
|
+
"Python tests.Python tests for test_config.Config.executor": "Run",
|
|
58
|
+
"Python tests.Python tests for test_config.Config.test_missing_config.executor": "Run",
|
|
59
|
+
"Python tests.Python tests for test_db.DB.executor": "Run",
|
|
60
|
+
"Python tests.Python tests for test_db.Database.executor": "Run",
|
|
61
|
+
"Python tests.Python tests for test_db.Database.test_addition_removal.executor": "Run",
|
|
62
|
+
"Python tests.Python tests for test_db.Database.test_missing_db.executor": "Run",
|
|
63
|
+
"Python tests.Python tests for test_proton.Tracking.executor": "Run",
|
|
64
|
+
"Python tests.Python tests for test_proton.Tracking.test_collect_proton_versions.executor": "Run",
|
|
65
|
+
"Python tests.Python tests for test_tracking.Tracking.executor": "Run",
|
|
66
|
+
"Python tests.Python tests for test_tracking.Tracking.test_track.executor": "Run",
|
|
67
|
+
"Python tests.Python tests for test_tracking.Tracking.test_track_untrack.executor": "Run",
|
|
68
|
+
"Python tests.Python tests for test_tracking.TrackingTest.executor": "Run",
|
|
69
|
+
"Python tests.Python tests for test_tracking.TrackingTest.test_track.executor": "Run",
|
|
70
|
+
"Python tests.Python tests for tests.test_db.DB.executor": "Run",
|
|
71
|
+
"Python tests.Python tests for tests.test_db.DBTest.executor": "Run",
|
|
72
|
+
"Python tests.Python tests for tests.test_db.DBTest.test_addition_removal.executor": "Run",
|
|
73
|
+
"Python tests.Python tests for tests.test_db.DBTest.test_malformed_db.executor": "Run",
|
|
74
|
+
"Python tests.Python tests for tests.test_db.DBTest.test_missing_db.executor": "Run",
|
|
75
|
+
"Python tests.Python tests for tests.test_tracking.Tracking.executor": "Run",
|
|
76
|
+
"Python tests.Python tests for tests.test_tracking.TrackingTest.executor": "Debug",
|
|
77
|
+
"Python tests.Python tests for tests.test_tracking.TrackingTest.test_track.executor": "Run",
|
|
78
|
+
"Python tests.Python tests in tests.executor": "Run",
|
|
79
|
+
"Python tests.Run tests.executor": "Run",
|
|
80
|
+
"Python.Build.executor": "Run",
|
|
81
|
+
"Python.Module.executor": "Run",
|
|
82
|
+
"Python.create.executor": "Run",
|
|
83
|
+
"Python.delete.executor": "Run",
|
|
84
|
+
"Python.manage.executor": "Run",
|
|
85
|
+
"Python.run.executor": "Run",
|
|
86
|
+
"Python.track.executor": "Run",
|
|
87
|
+
"Python.umu-commander.executor": "Run",
|
|
88
|
+
"Python.untrack.executor": "Run",
|
|
89
|
+
"Python.users.executor": "Run",
|
|
90
|
+
"RunOnceActivity.ShowReadmeOnStart": "true",
|
|
91
|
+
"RunOnceActivity.git.unshallow": "true",
|
|
92
|
+
"Shell Script.Build.executor": "Run",
|
|
93
|
+
"Shell Script.Cleanup builds.executor": "Run",
|
|
94
|
+
"Shell Script.Upload.executor": "Run",
|
|
95
|
+
"git-widget-placeholder": "master",
|
|
96
|
+
"last_opened_file_path": "/home/hiroshi/Code/Python/umu-commander/src/umu_commander",
|
|
97
|
+
"run.code.analysis.last.selected.profile": "aDefault",
|
|
98
|
+
"settings.editor.selected.configurable": "com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable"
|
|
97
99
|
}
|
|
98
|
-
}
|
|
100
|
+
}]]></component>
|
|
99
101
|
<component name="RecentsManager">
|
|
100
102
|
<key name="CopyFile.RECENT_KEYS">
|
|
101
103
|
<recent name="$PROJECT_DIR$/src/umu_commander" />
|
|
@@ -411,46 +413,6 @@
|
|
|
411
413
|
<option name="presentableId" value="Default" />
|
|
412
414
|
<updated>1751043400140</updated>
|
|
413
415
|
</task>
|
|
414
|
-
<task id="LOCAL-00042" summary="Preparations for building">
|
|
415
|
-
<option name="closed" value="true" />
|
|
416
|
-
<created>1753344771423</created>
|
|
417
|
-
<option name="number" value="00042" />
|
|
418
|
-
<option name="presentableId" value="LOCAL-00042" />
|
|
419
|
-
<option name="project" value="LOCAL" />
|
|
420
|
-
<updated>1753344771423</updated>
|
|
421
|
-
</task>
|
|
422
|
-
<task id="LOCAL-00043" summary="Preparations for building">
|
|
423
|
-
<option name="closed" value="true" />
|
|
424
|
-
<created>1753346217252</created>
|
|
425
|
-
<option name="number" value="00043" />
|
|
426
|
-
<option name="presentableId" value="LOCAL-00043" />
|
|
427
|
-
<option name="project" value="LOCAL" />
|
|
428
|
-
<updated>1753346217253</updated>
|
|
429
|
-
</task>
|
|
430
|
-
<task id="LOCAL-00044" summary="Preparations for building">
|
|
431
|
-
<option name="closed" value="true" />
|
|
432
|
-
<created>1753347983462</created>
|
|
433
|
-
<option name="number" value="00044" />
|
|
434
|
-
<option name="presentableId" value="LOCAL-00044" />
|
|
435
|
-
<option name="project" value="LOCAL" />
|
|
436
|
-
<updated>1753347983462</updated>
|
|
437
|
-
</task>
|
|
438
|
-
<task id="LOCAL-00045" summary="Break off configuration">
|
|
439
|
-
<option name="closed" value="true" />
|
|
440
|
-
<created>1754002639114</created>
|
|
441
|
-
<option name="number" value="00045" />
|
|
442
|
-
<option name="presentableId" value="LOCAL-00045" />
|
|
443
|
-
<option name="project" value="LOCAL" />
|
|
444
|
-
<updated>1754002639114</updated>
|
|
445
|
-
</task>
|
|
446
|
-
<task id="LOCAL-00046" summary="Rework DB">
|
|
447
|
-
<option name="closed" value="true" />
|
|
448
|
-
<created>1754002669820</created>
|
|
449
|
-
<option name="number" value="00046" />
|
|
450
|
-
<option name="presentableId" value="LOCAL-00046" />
|
|
451
|
-
<option name="project" value="LOCAL" />
|
|
452
|
-
<updated>1754002669820</updated>
|
|
453
|
-
</task>
|
|
454
416
|
<task id="LOCAL-00047" summary="Create convenience classes">
|
|
455
417
|
<option name="closed" value="true" />
|
|
456
418
|
<created>1754002693811</created>
|
|
@@ -803,7 +765,47 @@
|
|
|
803
765
|
<option name="project" value="LOCAL" />
|
|
804
766
|
<updated>1754730732601</updated>
|
|
805
767
|
</task>
|
|
806
|
-
<
|
|
768
|
+
<task id="LOCAL-00091" summary="Handle exiting more gracefully dispatch refactor minor wording & formatting tweaks">
|
|
769
|
+
<option name="closed" value="true" />
|
|
770
|
+
<created>1754753478994</created>
|
|
771
|
+
<option name="number" value="00091" />
|
|
772
|
+
<option name="presentableId" value="LOCAL-00091" />
|
|
773
|
+
<option name="project" value="LOCAL" />
|
|
774
|
+
<updated>1754753478994</updated>
|
|
775
|
+
</task>
|
|
776
|
+
<task id="LOCAL-00092" summary="Add default values">
|
|
777
|
+
<option name="closed" value="true" />
|
|
778
|
+
<created>1757363605608</created>
|
|
779
|
+
<option name="number" value="00092" />
|
|
780
|
+
<option name="presentableId" value="LOCAL-00092" />
|
|
781
|
+
<option name="project" value="LOCAL" />
|
|
782
|
+
<updated>1757363605609</updated>
|
|
783
|
+
</task>
|
|
784
|
+
<task id="LOCAL-00093" summary="Fix">
|
|
785
|
+
<option name="closed" value="true" />
|
|
786
|
+
<created>1757363932806</created>
|
|
787
|
+
<option name="number" value="00093" />
|
|
788
|
+
<option name="presentableId" value="LOCAL-00093" />
|
|
789
|
+
<option name="project" value="LOCAL" />
|
|
790
|
+
<updated>1757363932806</updated>
|
|
791
|
+
</task>
|
|
792
|
+
<task id="LOCAL-00094" summary="Formatting">
|
|
793
|
+
<option name="closed" value="true" />
|
|
794
|
+
<created>1757363955353</created>
|
|
795
|
+
<option name="number" value="00094" />
|
|
796
|
+
<option name="presentableId" value="LOCAL-00094" />
|
|
797
|
+
<option name="project" value="LOCAL" />
|
|
798
|
+
<updated>1757363955353</updated>
|
|
799
|
+
</task>
|
|
800
|
+
<task id="LOCAL-00095" summary="1.6.1">
|
|
801
|
+
<option name="closed" value="true" />
|
|
802
|
+
<created>1757363962261</created>
|
|
803
|
+
<option name="number" value="00095" />
|
|
804
|
+
<option name="presentableId" value="LOCAL-00095" />
|
|
805
|
+
<option name="project" value="LOCAL" />
|
|
806
|
+
<updated>1757363962261</updated>
|
|
807
|
+
</task>
|
|
808
|
+
<option name="localTasksCounter" value="96" />
|
|
807
809
|
<servers />
|
|
808
810
|
</component>
|
|
809
811
|
<component name="Vcs.Log.Tabs.Properties">
|
|
@@ -830,10 +832,6 @@
|
|
|
830
832
|
</option>
|
|
831
833
|
</component>
|
|
832
834
|
<component name="VcsManagerConfiguration">
|
|
833
|
-
<MESSAGE value="Check for umu-config existence" />
|
|
834
|
-
<MESSAGE value="formatting" />
|
|
835
|
-
<MESSAGE value="Misc fixes in configuration module" />
|
|
836
|
-
<MESSAGE value="Fix import error" />
|
|
837
835
|
<MESSAGE value="Misc fixes in configuration module" />
|
|
838
836
|
<MESSAGE value="Fix import error" />
|
|
839
837
|
<MESSAGE value="Change DB structure" />
|
|
@@ -844,7 +842,6 @@
|
|
|
844
842
|
<MESSAGE value="Reformat main flow" />
|
|
845
843
|
<MESSAGE value="Update tests" />
|
|
846
844
|
<MESSAGE value="Add dynamic versioning" />
|
|
847
|
-
<MESSAGE value="Formatting" />
|
|
848
845
|
<MESSAGE value="Add dynamic versioning & 1.5.6" />
|
|
849
846
|
<MESSAGE value="Add dynamic versioning" />
|
|
850
847
|
<MESSAGE value="Implement dynamic versioning" />
|
|
@@ -855,6 +852,22 @@
|
|
|
855
852
|
<MESSAGE value="1.5.7" />
|
|
856
853
|
<MESSAGE value="Remove use "Always use latest UMU-Proton"" />
|
|
857
854
|
<MESSAGE value="1.6.0" />
|
|
858
|
-
<
|
|
855
|
+
<MESSAGE value="Handle exiting more gracefully dispatch refactor minor wording & formatting tweaks" />
|
|
856
|
+
<MESSAGE value="Add default values" />
|
|
857
|
+
<MESSAGE value="Fix" />
|
|
858
|
+
<MESSAGE value="Formatting" />
|
|
859
|
+
<MESSAGE value="1.6.1" />
|
|
860
|
+
<option name="LAST_COMMIT_MESSAGE" value="1.6.1" />
|
|
861
|
+
</component>
|
|
862
|
+
<component name="XDebuggerManager">
|
|
863
|
+
<breakpoint-manager>
|
|
864
|
+
<breakpoints>
|
|
865
|
+
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
|
866
|
+
<url>file://$PROJECT_DIR$/src/umu_commander/util.py</url>
|
|
867
|
+
<line>96</line>
|
|
868
|
+
<option name="timeStamp" value="2" />
|
|
869
|
+
</line-breakpoint>
|
|
870
|
+
</breakpoints>
|
|
871
|
+
</breakpoint-manager>
|
|
859
872
|
</component>
|
|
860
873
|
</project>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: umu-commander
|
|
3
|
-
Version: 1.6.
|
|
3
|
+
Version: 1.6.1
|
|
4
4
|
Summary: umu-commander is an interactive CLI tool to help you manage umu.
|
|
5
5
|
Project-URL: Homepage, https://github.com/Mpaxlamitsounas/umu-commander
|
|
6
6
|
Project-URL: Issues, https://github.com/Mpaxlamitsounas/umu-commander/issues
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VERSION = "v1.6.1"
|
|
@@ -10,34 +10,43 @@ from umu_commander.classes import ExitCode
|
|
|
10
10
|
from umu_commander.configuration import CONFIG_DIR, CONFIG_NAME
|
|
11
11
|
from umu_commander.util import print_help
|
|
12
12
|
|
|
13
|
+
# TODO: Add related projects shoutout
|
|
14
|
+
# https://github.com/Faugus/faugus-launcher
|
|
15
|
+
# https://github.com/SeongGino/Nero-umu
|
|
16
|
+
# https://github.com/korewaChino/umu-wrapper
|
|
17
|
+
|
|
18
|
+
# TODO: https://inquirerpy.readthedocs.io/en/latest/
|
|
19
|
+
|
|
13
20
|
|
|
14
21
|
def main() -> ExitCode:
|
|
15
22
|
try:
|
|
16
23
|
config.load()
|
|
24
|
+
|
|
17
25
|
except (JSONDecodeError, KeyError):
|
|
18
26
|
config_path: str = os.path.join(CONFIG_DIR, CONFIG_NAME)
|
|
19
|
-
|
|
27
|
+
config_path_old: str = os.path.join(CONFIG_DIR, CONFIG_NAME + ".old")
|
|
20
28
|
|
|
21
29
|
print(f"Config file at {config_path} could not be read.")
|
|
22
30
|
|
|
23
|
-
if not os.path.exists(
|
|
24
|
-
print(f"Config file renamed to {
|
|
25
|
-
os.rename(config_path,
|
|
31
|
+
if not os.path.exists(config_path_old):
|
|
32
|
+
print(f"Config file renamed to {config_path_old}.")
|
|
33
|
+
os.rename(config_path, config_path_old)
|
|
26
34
|
|
|
27
35
|
except FileNotFoundError:
|
|
28
36
|
config.dump()
|
|
29
37
|
|
|
30
38
|
try:
|
|
31
39
|
db.load()
|
|
40
|
+
|
|
32
41
|
except JSONDecodeError:
|
|
33
42
|
db_path: str = os.path.join(config.DB_DIR, config.DB_NAME)
|
|
34
|
-
|
|
43
|
+
db_path_old: str = os.path.join(config.DB_DIR, config.DB_NAME + ".old")
|
|
35
44
|
|
|
36
45
|
print(f"Tracking file at {db_path} could not be read.")
|
|
37
46
|
|
|
38
|
-
if not os.path.exists(
|
|
39
|
-
print(f"DB file renamed to {
|
|
40
|
-
os.rename(db_path,
|
|
47
|
+
if not os.path.exists(db_path_old):
|
|
48
|
+
print(f"DB file renamed to {db_path_old}.")
|
|
49
|
+
os.rename(db_path, db_path_old)
|
|
41
50
|
|
|
42
51
|
except FileNotFoundError:
|
|
43
52
|
pass
|
|
@@ -51,20 +60,29 @@ def main() -> ExitCode:
|
|
|
51
60
|
"run": umu_config.run,
|
|
52
61
|
}
|
|
53
62
|
|
|
54
|
-
|
|
63
|
+
try:
|
|
64
|
+
dispatch[sys.argv[1]]()
|
|
65
|
+
|
|
66
|
+
except IndexError:
|
|
55
67
|
print_help()
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
68
|
+
return_val = ExitCode.SUCCESS
|
|
69
|
+
|
|
70
|
+
except KeyError:
|
|
71
|
+
print("Unrecognised verb.")
|
|
59
72
|
print_help()
|
|
60
|
-
|
|
73
|
+
return_val = ExitCode.INVALID_SELECTION
|
|
74
|
+
|
|
75
|
+
except ValueError:
|
|
76
|
+
return_val = ExitCode.INVALID_SELECTION
|
|
61
77
|
|
|
62
|
-
|
|
78
|
+
else:
|
|
79
|
+
return_val = ExitCode.SUCCESS
|
|
63
80
|
|
|
64
|
-
|
|
65
|
-
|
|
81
|
+
finally:
|
|
82
|
+
tracking.untrack_unlinked()
|
|
83
|
+
db.dump()
|
|
66
84
|
|
|
67
|
-
return
|
|
85
|
+
return return_val.value
|
|
68
86
|
|
|
69
87
|
|
|
70
88
|
if __name__ == "__main__":
|
|
@@ -7,12 +7,9 @@ import tomli_w
|
|
|
7
7
|
|
|
8
8
|
import umu_commander.configuration as config
|
|
9
9
|
from umu_commander import tracking
|
|
10
|
-
from umu_commander.classes import DLLOverride, ProtonVer
|
|
10
|
+
from umu_commander.classes import DLLOverride, ProtonVer, Value
|
|
11
11
|
from umu_commander.proton import collect_proton_versions, refresh_proton_versions
|
|
12
|
-
from umu_commander.util import
|
|
13
|
-
get_selection,
|
|
14
|
-
strings_to_values,
|
|
15
|
-
)
|
|
12
|
+
from umu_commander.util import get_selection, string_to_value, strings_to_values
|
|
16
13
|
|
|
17
14
|
|
|
18
15
|
def create():
|
|
@@ -21,12 +18,12 @@ def create():
|
|
|
21
18
|
params: dict[str, Any] = {"umu": {}, "env": {}}
|
|
22
19
|
|
|
23
20
|
# Prefix selection
|
|
21
|
+
prefix_default: Value = string_to_value("Current directory")
|
|
24
22
|
selection: str = get_selection(
|
|
25
23
|
"Select wine prefix:",
|
|
26
|
-
strings_to_values(
|
|
27
|
-
[*os.listdir(config.DEFAULT_PREFIX_DIR), "Current directory"]
|
|
28
|
-
),
|
|
24
|
+
[*strings_to_values(os.listdir(config.DEFAULT_PREFIX_DIR)), prefix_default],
|
|
29
25
|
None,
|
|
26
|
+
default_element=prefix_default,
|
|
30
27
|
).value
|
|
31
28
|
|
|
32
29
|
if selection == "Current directory":
|
|
@@ -57,20 +54,24 @@ def create():
|
|
|
57
54
|
idx = "Y"
|
|
58
55
|
print(f"{idx}) {override.label}")
|
|
59
56
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
57
|
+
index: str = input("? ")
|
|
58
|
+
if index == "":
|
|
59
|
+
break
|
|
60
|
+
|
|
61
|
+
if index.isdecimal():
|
|
62
|
+
index: int = int(index)
|
|
63
|
+
else:
|
|
64
64
|
continue
|
|
65
65
|
|
|
66
|
+
# reset
|
|
66
67
|
if index == 0:
|
|
67
68
|
selected = set()
|
|
68
69
|
continue
|
|
69
70
|
|
|
71
|
+
# done
|
|
70
72
|
if index == 1:
|
|
71
73
|
break
|
|
72
74
|
|
|
73
|
-
index: int = int(index)
|
|
74
75
|
if index - 1 < len(possible_overrides):
|
|
75
76
|
selected.add(index)
|
|
76
77
|
|
|
@@ -83,10 +84,12 @@ def create():
|
|
|
83
84
|
].override_str
|
|
84
85
|
|
|
85
86
|
# Set language locale
|
|
87
|
+
lang_default: Value = string_to_value("Default")
|
|
86
88
|
match get_selection(
|
|
87
89
|
"Select locale:",
|
|
88
|
-
strings_to_values([
|
|
90
|
+
strings_to_values([lang_default, "Japanese"]),
|
|
89
91
|
None,
|
|
92
|
+
default_element=lang_default,
|
|
90
93
|
).value:
|
|
91
94
|
case "Default":
|
|
92
95
|
pass
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
from umu_commander import VERSION
|
|
2
|
-
from umu_commander.classes import Element,
|
|
2
|
+
from umu_commander.classes import Element, Group, Value
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def string_to_value(value: str) -> Value:
|
|
6
|
+
return Value(value)
|
|
3
7
|
|
|
4
8
|
|
|
5
9
|
def strings_to_values(values: list[str]) -> list[Value]:
|
|
6
|
-
return [
|
|
10
|
+
return [string_to_value(value) for value in values]
|
|
7
11
|
|
|
8
12
|
|
|
9
13
|
def _selection_set_valid(
|
|
@@ -56,10 +60,11 @@ def get_selection(
|
|
|
56
60
|
prompt: str,
|
|
57
61
|
selection_elements: list[Element] | None,
|
|
58
62
|
selection_groups: list[Group] | None,
|
|
63
|
+
default_element: Element = None,
|
|
59
64
|
) -> Element:
|
|
60
65
|
if not _selection_set_valid(selection_elements, selection_groups):
|
|
61
66
|
print("Nothing to select from.")
|
|
62
|
-
|
|
67
|
+
raise ValueError
|
|
63
68
|
|
|
64
69
|
if selection_groups is None:
|
|
65
70
|
selection_groups = []
|
|
@@ -82,15 +87,30 @@ def get_selection(
|
|
|
82
87
|
|
|
83
88
|
enum_start_idx += len(group.elements)
|
|
84
89
|
|
|
85
|
-
|
|
90
|
+
selection: str = input("? ")
|
|
86
91
|
print("")
|
|
87
|
-
if
|
|
88
|
-
|
|
89
|
-
|
|
92
|
+
if selection == "":
|
|
93
|
+
if default_element is not None:
|
|
94
|
+
return default_element
|
|
95
|
+
|
|
96
|
+
# If only 1 choice
|
|
97
|
+
if len(selection_groups) == 0 and len(selection_elements) == 1:
|
|
98
|
+
return selection_elements[0]
|
|
99
|
+
|
|
100
|
+
# len(selection_groups) == 1 and len(selection_groups[0].elements) == 1
|
|
101
|
+
groups_with_one_element: list[Group] = [
|
|
102
|
+
group for group in selection_groups if len(group.elements) == 1
|
|
103
|
+
]
|
|
104
|
+
if len(groups_with_one_element) == 1:
|
|
105
|
+
return groups_with_one_element[0].elements[0]
|
|
106
|
+
|
|
107
|
+
elif selection.isdecimal():
|
|
108
|
+
selection: int = int(selection) - 1
|
|
109
|
+
if enum_start_idx - 1 > selection >= 0:
|
|
90
110
|
break
|
|
91
111
|
|
|
92
112
|
return _translate_index_to_selection(
|
|
93
|
-
|
|
113
|
+
selection, selection_elements, selection_groups
|
|
94
114
|
)
|
|
95
115
|
|
|
96
116
|
|
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
Index: tests/test_db.py
|
|
2
|
-
IDEA additional info:
|
|
3
|
-
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
|
|
4
|
-
<+>import unittest\nfrom json import JSONDecodeError\n\nimport umu_commander.configuration as config\nfrom tests import *\nfrom umu_commander.database import Database as db\n\n\nclass Database(unittest.TestCase):\n def setUp(self):\n config.DB_DIR = TESTING_DIR\n setup()\n\n def tearDown(self):\n teardown()\n\n def test_missing_db(self):\n db.load()\n self.assertEqual(db.get(), {})\n\n def test_malformed_db(self):\n with open(os.path.join(config.DB_DIR, config.DB_NAME), \"tw\") as db_file:\n db_file.write(\"{\")\n\n with self.assertRaises(JSONDecodeError):\n db.load()\n\n def test_addition_removal(self):\n db.load()\n db.get(PROTON_DIR_1, PROTON_BIG).append(USER_DIR)\n\n self.assertIn(PROTON_BIG, db.get(PROTON_DIR_1))\n self.assertIn(USER_DIR, db.get(PROTON_DIR_1, PROTON_BIG))\n\n db.get(PROTON_DIR_1, PROTON_BIG).remove(USER_DIR)\n\n self.assertIn(PROTON_BIG, db.get(PROTON_DIR_1))\n self.assertNotIn(USER_DIR, db.get(PROTON_DIR_1, PROTON_BIG))\n\n del db.get(PROTON_DIR_1)[PROTON_BIG]\n self.assertNotIn(PROTON_BIG, db.get(PROTON_DIR_1))\n
|
|
5
|
-
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
|
6
|
-
<+>UTF-8
|
|
7
|
-
===================================================================
|
|
8
|
-
diff --git a/tests/test_db.py b/tests/test_db.py
|
|
9
|
-
--- a/tests/test_db.py (revision 2c990ed1cab5a20498dc2cfe9bd4e331f60cb3af)
|
|
10
|
-
+++ b/tests/test_db.py (date 1754467945899)
|
|
11
|
-
@@ -2,8 +2,8 @@
|
|
12
|
-
from json import JSONDecodeError
|
|
13
|
-
|
|
14
|
-
import umu_commander.configuration as config
|
|
15
|
-
+import umu_commander.database as db
|
|
16
|
-
from tests import *
|
|
17
|
-
-from umu_commander.database import Database as db
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class Database(unittest.TestCase):
|
|
21
|
-
Index: tests/test_config.py
|
|
22
|
-
IDEA additional info:
|
|
23
|
-
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
|
|
24
|
-
<+>import os.path\nimport unittest\n\nimport umu_commander.configuration as config\nfrom tests import *\nfrom umu_commander import configuration\n\n\nclass Config(unittest.TestCase):\n def setUp(self):\n configuration._CONFIG_DIR = TESTING_DIR\n configuration.DB_DIR = TESTING_DIR\n setup()\n\n def tearDown(self):\n teardown()\n\n def test_missing_config(self):\n config.load()\n self.assertTrue(\n os.path.exists(os.path.join(TESTING_DIR, configuration._CONFIG_NAME))\n )\n config.load()\n
|
|
25
|
-
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
|
26
|
-
<+>UTF-8
|
|
27
|
-
===================================================================
|
|
28
|
-
diff --git a/tests/test_config.py b/tests/test_config.py
|
|
29
|
-
--- a/tests/test_config.py (revision 2c990ed1cab5a20498dc2cfe9bd4e331f60cb3af)
|
|
30
|
-
+++ b/tests/test_config.py (date 1754467762383)
|
|
31
|
-
@@ -8,7 +8,7 @@
|
|
32
|
-
|
|
33
|
-
class Config(unittest.TestCase):
|
|
34
|
-
def setUp(self):
|
|
35
|
-
- configuration._CONFIG_DIR = TESTING_DIR
|
|
36
|
-
+ configuration.CONFIG_DIR = TESTING_DIR
|
|
37
|
-
configuration.DB_DIR = TESTING_DIR
|
|
38
|
-
setup()
|
|
39
|
-
|
|
40
|
-
@@ -18,6 +18,6 @@
|
|
41
|
-
def test_missing_config(self):
|
|
42
|
-
config.load()
|
|
43
|
-
self.assertTrue(
|
|
44
|
-
- os.path.exists(os.path.join(TESTING_DIR, configuration._CONFIG_NAME))
|
|
45
|
-
+ os.path.exists(os.path.join(TESTING_DIR, configuration.CONFIG_NAME))
|
|
46
|
-
)
|
|
47
|
-
config.load()
|
|
48
|
-
Index: src/umu_commander/database.py
|
|
49
|
-
IDEA additional info:
|
|
50
|
-
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
|
|
51
|
-
<+>import json\nimport os\nfrom collections import defaultdict\n\nimport umu_commander.configuration as config\n\n\nclass Database:\n _db: defaultdict[str, defaultdict[str, list[str]]]\n\n @staticmethod\n def load():\n if not os.path.exists(config.DB_DIR):\n os.mkdir(config.DB_DIR)\n\n try:\n with open(os.path.join(config.DB_DIR, config.DB_NAME), \"rt\") as db_file:\n Database._db = defaultdict(lambda: defaultdict(list))\n Database._db.update(json.load(db_file))\n\n except FileNotFoundError:\n Database._db = defaultdict(lambda: defaultdict(list))\n\n @staticmethod\n def dump():\n with open(os.path.join(config.DB_DIR, config.DB_NAME), \"wt\") as db_file:\n # noinspection PyTypeChecker\n json.dump(Database._db, db_file, indent=\"\\t\")\n\n @staticmethod\n def get(\n proton_dir: str = None, proton_ver: str = None\n ) -> dict[str, dict[str, list[str]]] | dict[str, list[str]] | list[str]:\n if proton_dir is None and proton_ver is None:\n return Database._db\n\n if proton_ver is None:\n return Database._db[proton_dir]\n\n if proton_ver not in Database._db[proton_dir]:\n Database._db[proton_dir][proton_ver] = []\n\n return Database._db[proton_dir][proton_ver]\n
|
|
52
|
-
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
|
53
|
-
<+>UTF-8
|
|
54
|
-
===================================================================
|
|
55
|
-
diff --git a/src/umu_commander/database.py b/src/umu_commander/database.py
|
|
56
|
-
--- a/src/umu_commander/database.py (revision 2c990ed1cab5a20498dc2cfe9bd4e331f60cb3af)
|
|
57
|
-
+++ b/src/umu_commander/database.py (date 1754467762394)
|
|
58
|
-
@@ -4,40 +4,46 @@
|
|
59
|
-
|
|
60
|
-
import umu_commander.configuration as config
|
|
61
|
-
|
|
62
|
-
+_db: defaultdict[str, defaultdict[str, list[str]]] = defaultdict(
|
|
63
|
-
+ lambda: defaultdict(list)
|
|
64
|
-
+)
|
|
65
|
-
|
|
66
|
-
-class Database:
|
|
67
|
-
- _db: defaultdict[str, defaultdict[str, list[str]]]
|
|
68
|
-
|
|
69
|
-
- @staticmethod
|
|
70
|
-
- def load():
|
|
71
|
-
- if not os.path.exists(config.DB_DIR):
|
|
72
|
-
- os.mkdir(config.DB_DIR)
|
|
73
|
-
+def load():
|
|
74
|
-
+ global _db
|
|
75
|
-
+
|
|
76
|
-
+ if not os.path.exists(config.DB_DIR):
|
|
77
|
-
+ os.mkdir(config.DB_DIR)
|
|
78
|
-
|
|
79
|
-
- try:
|
|
80
|
-
- with open(os.path.join(config.DB_DIR, config.DB_NAME), "rt") as db_file:
|
|
81
|
-
- Database._db = defaultdict(lambda: defaultdict(list))
|
|
82
|
-
- Database._db.update(json.load(db_file))
|
|
83
|
-
+ db_path: str = os.path.join(config.DB_DIR, config.DB_NAME)
|
|
84
|
-
+ if not os.path.exists(db_path):
|
|
85
|
-
+ return
|
|
86
|
-
|
|
87
|
-
- except FileNotFoundError:
|
|
88
|
-
- Database._db = defaultdict(lambda: defaultdict(list))
|
|
89
|
-
+ with open(os.path.join(db_path), "rt") as db_file:
|
|
90
|
-
+ _db.update(json.load(db_file))
|
|
91
|
-
|
|
92
|
-
- @staticmethod
|
|
93
|
-
- def dump():
|
|
94
|
-
- with open(os.path.join(config.DB_DIR, config.DB_NAME), "wt") as db_file:
|
|
95
|
-
- # noinspection PyTypeChecker
|
|
96
|
-
- json.dump(Database._db, db_file, indent="\t")
|
|
97
|
-
+
|
|
98
|
-
+def dump():
|
|
99
|
-
+ if not os.path.exists(config.DB_DIR):
|
|
100
|
-
+ os.mkdir(config.DB_DIR)
|
|
101
|
-
+
|
|
102
|
-
+ with open(os.path.join(config.DB_DIR, config.DB_NAME), "wt") as db_file:
|
|
103
|
-
+ # noinspection PyTypeChecker
|
|
104
|
-
+ json.dump(_db, db_file, indent="\t")
|
|
105
|
-
|
|
106
|
-
- @staticmethod
|
|
107
|
-
- def get(
|
|
108
|
-
- proton_dir: str = None, proton_ver: str = None
|
|
109
|
-
- ) -> dict[str, dict[str, list[str]]] | dict[str, list[str]] | list[str]:
|
|
110
|
-
- if proton_dir is None and proton_ver is None:
|
|
111
|
-
- return Database._db
|
|
112
|
-
+
|
|
113
|
-
+def get(
|
|
114
|
-
+ proton_dir: str = None, proton_ver: str = None
|
|
115
|
-
+) -> dict[str, dict[str, list[str]]] | dict[str, list[str]] | list[str]:
|
|
116
|
-
+ global _db
|
|
117
|
-
+
|
|
118
|
-
+ if proton_dir is None and proton_ver is None:
|
|
119
|
-
+ return _db
|
|
120
|
-
|
|
121
|
-
- if proton_ver is None:
|
|
122
|
-
- return Database._db[proton_dir]
|
|
123
|
-
+ if proton_ver is None:
|
|
124
|
-
+ return _db[proton_dir]
|
|
125
|
-
|
|
126
|
-
- if proton_ver not in Database._db[proton_dir]:
|
|
127
|
-
- Database._db[proton_dir][proton_ver] = []
|
|
128
|
-
+ if proton_ver not in _db[proton_dir]:
|
|
129
|
-
+ _db[proton_dir][proton_ver] = []
|
|
130
|
-
|
|
131
|
-
- return Database._db[proton_dir][proton_ver]
|
|
132
|
-
+ return _db[proton_dir][proton_ver]
|
|
133
|
-
Index: tests/test_tracking.py
|
|
134
|
-
IDEA additional info:
|
|
135
|
-
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
|
|
136
|
-
<+>import unittest\n\nimport umu_commander.configuration as config\nfrom tests import *\nfrom umu_commander import tracking\nfrom umu_commander.classes import ProtonVer\nfrom umu_commander.database import Database as db\n\n\nclass Tracking(unittest.TestCase):\n def setUp(self):\n config.DB_DIR = TESTING_DIR\n setup()\n db.load()\n\n def tearDown(self):\n teardown()\n\n def test_track_untrack(self):\n os.chdir(USER_DIR)\n\n tracking.track(ProtonVer(PROTON_DIR_1, PROTON_BIG), refresh_versions=False)\n self.assertIn(PROTON_BIG, db.get(PROTON_DIR_1))\n self.assertIn(USER_DIR, db.get(PROTON_DIR_1, PROTON_BIG))\n\n tracking.untrack(quiet=True)\n self.assertIn(PROTON_BIG, db.get(PROTON_DIR_1))\n self.assertNotIn(USER_DIR, db.get(PROTON_DIR_1, PROTON_BIG))\n\n def test_track_auto_untrack(self):\n os.chdir(USER_DIR)\n\n tracking.track(ProtonVer(PROTON_DIR_1, PROTON_BIG), refresh_versions=False)\n self.assertIn(PROTON_BIG, db.get(PROTON_DIR_1))\n self.assertIn(USER_DIR, db.get(PROTON_DIR_1, PROTON_BIG))\n\n os.rmdir(USER_DIR)\n tracking.untrack_unlinked()\n self.assertIn(PROTON_BIG, db.get(PROTON_DIR_1))\n self.assertNotIn(\n USER_DIR,\n db.get(PROTON_DIR_1, PROTON_BIG),\n \"Auto untrack did not untrack removed directory.\",\n )\n
|
|
137
|
-
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
|
138
|
-
<+>UTF-8
|
|
139
|
-
===================================================================
|
|
140
|
-
diff --git a/tests/test_tracking.py b/tests/test_tracking.py
|
|
141
|
-
--- a/tests/test_tracking.py (revision 2c990ed1cab5a20498dc2cfe9bd4e331f60cb3af)
|
|
142
|
-
+++ b/tests/test_tracking.py (date 1754467945864)
|
|
143
|
-
@@ -1,10 +1,10 @@
|
|
144
|
-
import unittest
|
|
145
|
-
|
|
146
|
-
import umu_commander.configuration as config
|
|
147
|
-
+import umu_commander.database as db
|
|
148
|
-
from tests import *
|
|
149
|
-
from umu_commander import tracking
|
|
150
|
-
from umu_commander.classes import ProtonVer
|
|
151
|
-
-from umu_commander.database import Database as db
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
class Tracking(unittest.TestCase):
|
|
155
|
-
Index: src/umu_commander/proton.py
|
|
156
|
-
IDEA additional info:
|
|
157
|
-
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
|
|
158
|
-
<+>import os\nimport re\nimport subprocess\n\nimport umu_commander.configuration as config\nfrom umu_commander.classes import ProtonDir, ProtonVer\nfrom umu_commander.database import Database as db\n\n\ndef _natural_sort_proton_ver_key(p: ProtonVer, _nsre=re.compile(r\"(\\d+)\")):\n s: str = p.version_num\n return [int(text) if text.isdigit() else text for text in _nsre.split(s)]\n\n\ndef refresh_proton_versions():\n print(\"Updating umu Proton.\")\n umu_update_process = subprocess.run(\n [\"umu-run\", '\"\"'],\n env={\"PROTONPATH\": \"UMU-Latest\", \"UMU_LOG\": \"debug\"},\n capture_output=True,\n text=True,\n )\n\n for line in umu_update_process.stderr.split(\"\\n\"):\n if \"PROTONPATH\" in line and \"/\" in line:\n try:\n left: int = line.rfind(\"/\") + 1\n print(f\"Using {line[left:len(line) - 1]}.\")\n except ValueError:\n print(\"Could not fetch latest UMU-Proton.\")\n\n break\n\n\ndef _sort_proton_versions(versions: list[ProtonVer]) -> list[ProtonVer]:\n return sorted(versions, key=_natural_sort_proton_ver_key, reverse=True)\n\n\ndef collect_proton_versions(\n sort: bool = False, user_count: bool = False\n) -> list[ProtonDir]:\n def get_user_count(proton_dir: str, proton_ver) -> str:\n return (\n \"(\" + str(len(db.get(proton_dir, proton_ver))) + \")\"\n if proton_ver in db.get(proton_dir)\n else \"(-)\"\n )\n\n proton_dirs: list[ProtonDir] = []\n for proton_dir in config.PROTON_PATHS:\n versions: list[ProtonVer] = [\n ProtonVer(\n proton_dir,\n version,\n get_user_count(proton_dir, version) if user_count else \"\",\n )\n for version in os.listdir(proton_dir)\n if os.path.isdir(os.path.join(proton_dir, version))\n ]\n\n if sort:\n versions = sorted(versions, key=_natural_sort_proton_ver_key, reverse=True)\n\n proton_dirs.append(\n ProtonDir(proton_dir, f\"Proton versions in {proton_dir}:\", versions)\n )\n\n return proton_dirs\n\n\ndef get_latest_umu_proton():\n umu_proton_versions: list[ProtonVer] = [\n ProtonVer(config.UMU_PROTON_PATH, version)\n for version in os.listdir(config.UMU_PROTON_PATH)\n if \"UMU\" in version\n and os.path.isdir(os.path.join(config.UMU_PROTON_PATH, version))\n ]\n umu_proton_versions = sorted(\n umu_proton_versions, key=_natural_sort_proton_ver_key, reverse=True\n )\n\n return umu_proton_versions[0].version_num\n
|
|
159
|
-
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
|
160
|
-
<+>UTF-8
|
|
161
|
-
===================================================================
|
|
162
|
-
diff --git a/src/umu_commander/proton.py b/src/umu_commander/proton.py
|
|
163
|
-
--- a/src/umu_commander/proton.py (revision 2c990ed1cab5a20498dc2cfe9bd4e331f60cb3af)
|
|
164
|
-
+++ b/src/umu_commander/proton.py (date 1754467945890)
|
|
165
|
-
@@ -3,8 +3,8 @@
|
|
166
|
-
import subprocess
|
|
167
|
-
|
|
168
|
-
import umu_commander.configuration as config
|
|
169
|
-
+import umu_commander.database as db
|
|
170
|
-
from umu_commander.classes import ProtonDir, ProtonVer
|
|
171
|
-
-from umu_commander.database import Database as db
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
def _natural_sort_proton_ver_key(p: ProtonVer, _nsre=re.compile(r"(\d+)")):
|
|
175
|
-
Index: src/umu_commander/tracking.py
|
|
176
|
-
IDEA additional info:
|
|
177
|
-
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
|
|
178
|
-
<+>import os\nimport shutil\n\nfrom umu_commander.classes import ProtonDir, ProtonVer\nfrom umu_commander.database import Database as db\nfrom umu_commander.proton import (\n collect_proton_versions,\n get_latest_umu_proton,\n refresh_proton_versions,\n)\nfrom umu_commander.util import (\n get_selection,\n)\n\n\ndef untrack(quiet: bool = False):\n current_dir: str = os.getcwd()\n for proton_dir in db.get().keys():\n for proton_ver in db.get(proton_dir):\n if current_dir in db.get(proton_dir, proton_ver):\n db.get(proton_dir, proton_ver).remove(current_dir)\n\n if not quiet:\n print(\"Directory removed from all user lists.\")\n\n\ndef track(\n proton_ver: ProtonVer = None, refresh_versions: bool = True, quiet: bool = False\n):\n if refresh_versions:\n refresh_proton_versions()\n\n if proton_ver is None:\n proton_ver: ProtonVer = get_selection(\n \"Select Proton version to add directory as user:\",\n None,\n collect_proton_versions(sort=True),\n ).as_proton_ver()\n\n untrack(quiet=True)\n current_directory: str = os.getcwd()\n db.get(proton_ver.dir, proton_ver.version_num).append(current_directory)\n\n if not quiet:\n print(\n f\"Directory {current_directory} added to Proton version's {proton_ver.version_num} in {proton_ver.dir} user list.\"\n )\n\n\ndef users():\n proton_dirs: list[ProtonDir] = collect_proton_versions(sort=True, user_count=True)\n\n proton_ver: ProtonVer = get_selection(\n \"Select Proton version to view user list:\", None, proton_dirs\n ).as_proton_ver()\n\n if proton_ver.dir in db.get() and proton_ver.version_num in db.get(proton_ver.dir):\n version_users: list[str] = db.get(proton_ver.dir, proton_ver.version_num)\n if len(version_users) > 0:\n print(f\"Directories using {proton_ver.version_num} of {proton_ver.dir}:\")\n print(*version_users, sep=\"\\n\")\n else:\n print(\"No directories currently use this version.\")\n else:\n print(\"This version hasn't been used by umu before.\")\n\n\ndef delete():\n for proton_dir in db.get().keys():\n for proton_ver, version_users in db.get(proton_dir).copy().items():\n if proton_ver == get_latest_umu_proton():\n continue\n\n if len(version_users) == 0:\n selection: str = input(\n f\"{proton_ver} in {proton_dir} has no using directories, delete? (Y/N) ? \"\n )\n if selection.lower() == \"y\":\n try:\n shutil.rmtree(os.path.join(proton_dir, proton_ver))\n except FileNotFoundError:\n pass\n del db.get(proton_dir)[proton_ver]\n\n\ndef untrack_unlinked():\n for proton_dir in db.get().keys():\n for proton_ver, version_users in db.get()[proton_dir].items():\n for user in version_users:\n if not os.path.exists(user):\n db.get(proton_dir, proton_ver).remove(user)\n
|
|
179
|
-
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
|
180
|
-
<+>UTF-8
|
|
181
|
-
===================================================================
|
|
182
|
-
diff --git a/src/umu_commander/tracking.py b/src/umu_commander/tracking.py
|
|
183
|
-
--- a/src/umu_commander/tracking.py (revision 2c990ed1cab5a20498dc2cfe9bd4e331f60cb3af)
|
|
184
|
-
+++ b/src/umu_commander/tracking.py (date 1754467945881)
|
|
185
|
-
@@ -1,8 +1,8 @@
|
|
186
|
-
import os
|
|
187
|
-
import shutil
|
|
188
|
-
|
|
189
|
-
+import umu_commander.database as db
|
|
190
|
-
from umu_commander.classes import ProtonDir, ProtonVer
|
|
191
|
-
-from umu_commander.database import Database as db
|
|
192
|
-
from umu_commander.proton import (
|
|
193
|
-
collect_proton_versions,
|
|
194
|
-
get_latest_umu_proton,
|
|
195
|
-
Index: src/umu_commander/main.py
|
|
196
|
-
IDEA additional info:
|
|
197
|
-
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
|
|
198
|
-
<+>#!/usr/bin/python3\nimport os\nimport sys\nfrom json import JSONDecodeError\n\nimport umu_commander.configuration as config\nfrom umu_commander import tracking, umu_config\nfrom umu_commander.classes import ExitCode\nfrom umu_commander.configuration import _CONFIG_DIR, _CONFIG_NAME\nfrom umu_commander.database import Database as db\n\n\ndef print_help():\n print(\n \"umu-commander is an interactive CLI tool to help you manage Proton versions used by umu, as well as create enhanced launch configs.\",\n \"\",\n \"For details, explanations, and more, see the README.md file, or visit https://github.com/Mpaxlamitsounas/umu-commander.\",\n sep=\"\\n\",\n )\n\n\ndef main() -> ExitCode:\n try:\n config.load()\n except (JSONDecodeError, KeyError):\n config_path: str = os.path.join(_CONFIG_DIR, _CONFIG_NAME)\n print(f\"Config file at {config_path} could not be read.\")\n os.rename(config_path, os.path.join(_CONFIG_DIR, _CONFIG_NAME + \".old\"))\n\n try:\n db.load()\n except JSONDecodeError:\n db_path: str = os.path.join(config.DB_DIR, config.DB_NAME)\n print(f\"Tracking file at {db_path} could not be read.\")\n os.rename(db_path, os.path.join(config.DB_DIR, config.DB_NAME + \".old\"))\n\n if len(sys.argv) == 1:\n print_help()\n return ExitCode.SUCCESS.value\n\n verb: str = sys.argv[1]\n match verb:\n case \"track\":\n tracking.track()\n case \"untrack\":\n tracking.untrack()\n case \"users\":\n tracking.users()\n case \"delete\":\n tracking.delete()\n case \"create\":\n umu_config.create()\n case \"run\":\n umu_config.run()\n case _:\n print(\"Invalid verb.\")\n print_help()\n return ExitCode.INVALID_SELECTION.value\n\n tracking.untrack_unlinked()\n db.dump()\n config.dump()\n\n return ExitCode.SUCCESS.value\n\n\nif __name__ == \"__main__\":\n exit(main())\n
|
|
199
|
-
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
|
200
|
-
<+>UTF-8
|
|
201
|
-
===================================================================
|
|
202
|
-
diff --git a/src/umu_commander/main.py b/src/umu_commander/main.py
|
|
203
|
-
--- a/src/umu_commander/main.py (revision 2c990ed1cab5a20498dc2cfe9bd4e331f60cb3af)
|
|
204
|
-
+++ b/src/umu_commander/main.py (date 1754467945908)
|
|
205
|
-
@@ -4,10 +4,10 @@
|
|
206
|
-
from json import JSONDecodeError
|
|
207
|
-
|
|
208
|
-
import umu_commander.configuration as config
|
|
209
|
-
+import umu_commander.database as db
|
|
210
|
-
from umu_commander import tracking, umu_config
|
|
211
|
-
from umu_commander.classes import ExitCode
|
|
212
|
-
-from umu_commander.configuration import _CONFIG_DIR, _CONFIG_NAME
|
|
213
|
-
-from umu_commander.database import Database as db
|
|
214
|
-
+from umu_commander.configuration import CONFIG_DIR, CONFIG_NAME
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
def print_help():
|
|
218
|
-
@@ -23,9 +23,9 @@
|
|
219
|
-
try:
|
|
220
|
-
config.load()
|
|
221
|
-
except (JSONDecodeError, KeyError):
|
|
222
|
-
- config_path: str = os.path.join(_CONFIG_DIR, _CONFIG_NAME)
|
|
223
|
-
+ config_path: str = os.path.join(CONFIG_DIR, CONFIG_NAME)
|
|
224
|
-
print(f"Config file at {config_path} could not be read.")
|
|
225
|
-
- os.rename(config_path, os.path.join(_CONFIG_DIR, _CONFIG_NAME + ".old"))
|
|
226
|
-
+ os.rename(config_path, os.path.join(CONFIG_DIR, CONFIG_NAME + ".old"))
|
|
227
|
-
|
|
228
|
-
try:
|
|
229
|
-
db.load()
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
Index: src/umu_commander/__init__.py
|
|
2
|
-
IDEA additional info:
|
|
3
|
-
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
|
|
4
|
-
<+>VERSION = \"v1.5.6\"\n
|
|
5
|
-
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
|
6
|
-
<+>UTF-8
|
|
7
|
-
===================================================================
|
|
8
|
-
diff --git a/src/umu_commander/__init__.py b/src/umu_commander/__init__.py
|
|
9
|
-
--- a/src/umu_commander/__init__.py (revision ebc968e623b6ee38499de12ff2a04c4bf2311db2)
|
|
10
|
-
+++ b/src/umu_commander/__init__.py (date 1754484120387)
|
|
11
|
-
@@ -1,1 +1,0 @@
|
|
12
|
-
-VERSION = "v1.5.6"
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<changelist name="Uncommitted_changes_before_rebase_[Changes]" date="1754468467307" recycled="true" deleted="true">
|
|
2
|
-
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_rebase_[Changes]/shelved.patch" />
|
|
3
|
-
<option name="DESCRIPTION" value="Uncommitted changes before rebase [Changes]" />
|
|
4
|
-
</changelist>
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<changelist name="Uncommitted_changes_before_rebase_[Changes]1" date="1754484165593" recycled="true" deleted="true">
|
|
2
|
-
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_rebase_[Changes]1/shelved.patch" />
|
|
3
|
-
<option name="DESCRIPTION" value="Uncommitted changes before rebase [Changes]" />
|
|
4
|
-
</changelist>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
VERSION = "v1.6.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|