Skip to content

Commit a89f2ce

Browse files
committed
Merge
2 parents 7eb1e7d + d26e1bd commit a89f2ce

File tree

6 files changed

+21
-4
lines changed

6 files changed

+21
-4
lines changed

gremlin/util.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,3 +1060,19 @@ def latest_gremlin_version() -> Optional[str]:
10601060
return json_data.get("version", None)
10611061
except Exception:
10621062
return None
1063+
1064+
1065+
def get_code_version() -> str:
1066+
"""Returns the version contained in the code's version.json file.
1067+
1068+
Returns:
1069+
String representation of the code's version.
1070+
"""
1071+
version_file = resource_path("version.json")
1072+
if not file_exists_and_is_accessible(version_file):
1073+
return "0.0.0"
1074+
1075+
try:
1076+
return json.load(open(version_file))["version"]
1077+
except json.decoder.JSONDecodeError:
1078+
return "0.0.0"

joystick_gremlin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def register_config_options() -> None:
130130
)
131131
cfg.register(
132132
"global", "internal", "last-known-version",
133-
PropertyType.String, "0.0.0",
133+
PropertyType.String, gremlin.util.get_code_version(),
134134
"Last known version of Gremlin.", {}
135135
)
136136
cfg.register(

joystick_gremlin.spec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ datas = [
1515
("gfx", "gfx"),
1616
("qml", "qml"),
1717
("device_db.json", "."),
18+
("version.json", ".")
1819
]
1920
datas.extend(action_plugins_files)
2021
binaries = [

qml/DialogAbout.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Window {
2727
}
2828

2929
DisplayLabel {
30-
text: "Release 14"
30+
text: "Release 14.1"
3131
font.pointSize: 14
3232
}
3333

test/action_interaction/test_macro.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ def test_hat_toggle(jgbot: JoystickGremlinBot, profile_dir: Path) -> None:
130130
expected_value += 0.1
131131
assert EventSpec(
132132
InputType.JoystickAxis, OUT_AXIS_1, 0.1) == jgbot.next_event()
133-
assert jgbot.axis(OUT_AXIS_1) == pytest.approx(expected_value, abs=0.01)
134133

134+
assert jgbot.axis(OUT_AXIS_1) == pytest.approx(expected_value, abs=0.01)
135135
assert jgbot.event_count() == 0
136136
jgbot.set_hat_direction(IN_HAT_1, HatDirection.South)
137137
jgbot.set_hat_direction(IN_HAT_1, HatDirection.Center)

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "14.0.0"
2+
"version": "14.1.0"
33
}

0 commit comments

Comments
 (0)