mirror of
https://github.com/matrix-org/matrix-spec
synced 2025-12-20 16:38:37 +01:00
25 lines
503 B
Python
25 lines
503 B
Python
|
|
"""Contains all the units for the spec."""
|
||
|
|
from . import AccessKeyStore
|
||
|
|
import os
|
||
|
|
|
||
|
|
def _load_examples():
|
||
|
|
path = "../event-schemas/examples"
|
||
|
|
examples = {}
|
||
|
|
for filename in os.listdir(path):
|
||
|
|
with open(filename, "r") as f:
|
||
|
|
print filename
|
||
|
|
return examples
|
||
|
|
|
||
|
|
|
||
|
|
UNIT_DICT = {
|
||
|
|
"event-examples": _load_examples
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
def load():
|
||
|
|
store = AccessKeyStore()
|
||
|
|
for unit_key in UNIT_DICT:
|
||
|
|
unit = UNIT_DICT[unit_key]()
|
||
|
|
store.add(unit_key, unit)
|
||
|
|
return store
|