pmb.helpers.locale: Use frozenset for primary_layouts (MR 2525)

This shouldn't change at runtime, so avoid any potential issues with it
being a mutable class variable by making it immutable.
This commit is contained in:
Newbyte 2025-01-08 00:30:15 +01:00 committed by Oliver Smith
parent 678ce1db52
commit 38b333372d
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -14,36 +14,38 @@ Locale and layout information is taken from:
class XkbLayout:
primary_layouts = [
"at",
"au",
"br",
"ca",
"ch",
"de",
"dk",
"ee",
"es",
"fi",
"fo",
"fr",
"gb",
"ie",
"is",
"it",
"latam",
"lt",
"mt",
"nz",
"pl",
"pt",
"ro",
"se",
"sk",
"tr",
"us",
"vn",
]
primary_layouts = frozenset(
[
"at",
"au",
"br",
"ca",
"ch",
"de",
"dk",
"ee",
"es",
"fi",
"fo",
"fr",
"gb",
"ie",
"is",
"it",
"latam",
"lt",
"mt",
"nz",
"pl",
"pt",
"ro",
"se",
"sk",
"tr",
"us",
"vn",
]
)
def __init__(self, layout: str = "us", variant: str = ""):
self.layout = layout