From 5197fe45682d5c128fddb815d9c5cb3d00f1867e Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Sat, 31 Oct 2026 08:51:50 -0500 Subject: [PATCH] Fix live network label typing and generated catalog lint policy --- openpilot/system/ui/widgets/network.py | 2 +- prebuilt.json | 2 +- scripts/lint/check_added_large_files.py | 8 ++++++++ scripts/lint/tests/test_large_file_policy.py | 18 ++++++++++++++++++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/openpilot/system/ui/widgets/network.py b/openpilot/system/ui/widgets/network.py index 729bfeeeb7..ce74107a03 100644 --- a/openpilot/system/ui/widgets/network.py +++ b/openpilot/system/ui/widgets/network.py @@ -72,7 +72,7 @@ class NetworkUI(Widget): self._current_panel: PanelType = PanelType.WIFI self._wifi_panel = self._child(WifiManagerUI(wifi_manager)) self._advanced_panel = self._child(AdvancedNetworkSettings(wifi_manager)) - self._nav_button = self._child(NavButton(lambda: tr("Advanced"))) + self._nav_button = self._child(NavButton(tr("Advanced"))) self._nav_button.set_click_callback(self._cycle_panel) self._action_guard: Callable[[], bool] | None = None diff --git a/prebuilt.json b/prebuilt.json index b6772aa43e..b5c2643df5 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "9d151431a0be404408b71c151c752d46b9abecc9031c428e5e10edf1bfd59319", "schema_version": 1} +{"protected_inventory_sha256": "ca816095734ed05a1df904518ae8fba5c046d54795aeb5d2d5994ad81cdbf2c5", "schema_version": 1} diff --git a/scripts/lint/check_added_large_files.py b/scripts/lint/check_added_large_files.py index a15e7a65d5..7a532e8567 100755 --- a/scripts/lint/check_added_large_files.py +++ b/scripts/lint/check_added_large_files.py @@ -6,6 +6,14 @@ import subprocess LARGE_TEXT_FILES = frozenset(( + 'openpilot/selfdrive/ui/translations/app.pot', + 'openpilot/selfdrive/ui/translations/app_de.po', + 'openpilot/selfdrive/ui/translations/app_es.po', + 'openpilot/selfdrive/ui/translations/app_fr.po', + 'openpilot/selfdrive/ui/translations/app_ja.po', + 'openpilot/selfdrive/ui/translations/app_ko.po', + 'openpilot/selfdrive/ui/translations/app_vi.po', + 'openpilot/starpilot/ui/translation_messages.json', # shortcut: these existing modules bypass 120 KiB; split when their responsibilities warrant it. 'openpilot/selfdrive/selfdrived/selfdrived.py', 'openpilot/starpilot/galaxy/server.py', diff --git a/scripts/lint/tests/test_large_file_policy.py b/scripts/lint/tests/test_large_file_policy.py index 6c1539bfde..f4d11fa6d7 100644 --- a/scripts/lint/tests/test_large_file_policy.py +++ b/scripts/lint/tests/test_large_file_policy.py @@ -31,6 +31,24 @@ class LargeFilePolicyTest(unittest.TestCase): self.assertEqual(self.check('openpilot/cereal/gen/cpp/arbitrary.h', 200000), 1) self.assertEqual(self.check('openpilot/starpilot/lateral/tests/fixtures/arbitrary.json', 200000), 1) + def test_generated_translation_catalogs_keep_exact_paths_and_hard_guards(self): + for name in ( + 'openpilot/selfdrive/ui/translations/app.pot', + 'openpilot/selfdrive/ui/translations/app_de.po', + 'openpilot/selfdrive/ui/translations/app_es.po', + 'openpilot/selfdrive/ui/translations/app_fr.po', + 'openpilot/selfdrive/ui/translations/app_ja.po', + 'openpilot/selfdrive/ui/translations/app_ko.po', + 'openpilot/selfdrive/ui/translations/app_vi.po', + 'openpilot/starpilot/ui/translation_messages.json', + ): + self.assertEqual(self.check(name, 1000000), 0) + self.assertEqual(self.check(name, 100 * 1024 * 1024 + 1), 1) + self.assertEqual(self.check(name, 1000000, pointer=True), 1) + for name in ('openpilot/selfdrive/ui/translations/arbitrary.po', + 'openpilot/starpilot/ui/arbitrary.json'): + self.assertEqual(self.check(name, 200000), 1) + def test_binary_classification_does_not_bypass_hard_guards(self): self.assertEqual(self.check('native.so', 500000, binary=True), 0) self.assertEqual(self.check('native.so', 100 * 1024 * 1024 + 1, binary=True), 1)