mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-11-05 03:54:04 +08:00
Fix live network label typing and generated catalog lint policy
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"protected_inventory_sha256": "9d151431a0be404408b71c151c752d46b9abecc9031c428e5e10edf1bfd59319", "schema_version": 1}
|
||||
{"protected_inventory_sha256": "ca816095734ed05a1df904518ae8fba5c046d54795aeb5d2d5994ad81cdbf2c5", "schema_version": 1}
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user