@@ -295,33 +295,37 @@ def writeEnums():
295
295
# the structure:
296
296
# "type": [string absolute/relative URI],
297
297
# "capture_base": hash, # Ignore
298
+ # ALSO, it is assumed that language variant objects all have the "default"
299
+ # and consistent primary language as first entry.
300
+
301
+ oca_overlays = oca_obj ["bundle" ]["overlays" ];
298
302
299
303
# Contains {schema.name,.description,.language} in array
300
304
# Optional?
301
- oca_metas = oca_obj [ "bundle" ][ "overlays" ] ["meta" ][0 ];
305
+ oca_metas = oca_overlays ["meta" ][0 ];
302
306
303
307
# oca_attributes contains slot.name and slot.datatype
304
308
oca_attributes = oca_obj ["bundle" ]["capture_base" ]["attributes" ];
305
309
306
310
# Contains slot.name and slot.pattern
307
- oca_formats = oca_obj [ "bundle" ][ "overlays" ] ["format" ]["attribute_formats" ];
311
+ oca_formats = oca_overlays ["format" ]["attribute_formats" ];
308
312
309
313
# Contains {slot.title,.language} in array
310
- oca_labels = oca_obj [ "bundle" ][ "overlays" ] ["label" ][0 ]["attribute_labels" ];
314
+ oca_labels = oca_overlays ["label" ][0 ]["attribute_labels" ];
311
315
312
316
# Contains {slot.name,.description,.language} in array
313
317
# Optional?
314
- oca_informations = oca_obj [ "bundle" ][ "overlays" ] ["information" ][0 ]["attribute_information" ];
318
+ oca_informations = oca_overlays ["information" ][0 ]["attribute_information" ];
315
319
316
320
# Contains {"d": "M", "i": "M", "passed": "M"} # "M" ?
317
- oca_conformance = oca_obj [ "bundle" ][ "overlays" ] ["conformance" ]["attribute_conformance" ];
321
+ oca_conformance = oca_overlays ["conformance" ]["attribute_conformance" ];
318
322
319
323
# Contains [enumeration name]:[code,...]
320
- oca_entry_codes = oca_obj [ "bundle" ][ "overlays" ] ["entry_code" ]["attribute_entry_codes" ];
324
+ oca_entry_codes = oca_overlays ["entry_code" ]["attribute_entry_codes" ];
321
325
322
326
# Contains array of {enumeration.language,.attribute_entries} where
323
327
# attribute_entries is dictionary of [enumeration name]: {code, label}
324
- oca_entry_labels = oca_obj [ "bundle" ][ "overlays" ] ["entry" ][0 ]["attribute_entries" ];
328
+ oca_entry_labels = oca_overlays ["entry" ][0 ]["attribute_entries" ];
325
329
326
330
SCHEMA = writeSchemaCore ();
327
331
writeSlots ();
0 commit comments