INNER CODE UNIT · Python
ReferenceStorageImpl
Zverik/every_door · tools/json_to_sqlite.py:43
class ReferenceStorageImpl:
"""
Global map of preset and field references. Stored on reading fields/presets,
used in reading translations to duplicate them for those.
"""
def __init__(self):
self.presets_name: ReferenceStorage = {}
self.fields_label: ReferenceStorage = {}
self.fields_placeholder: ReferenceStorage = {}
self.fields_strings: ReferenceStorage = {}
@staticmethod
def _get_reference(value: Optional[str]) -> Optional[str]:
if value and len(value) >= 3 and value[0] == '{':
return value[1:-1].strip()
return None