File tree Expand file tree Collapse file tree 1 file changed +25
-22
lines changed Expand file tree Collapse file tree 1 file changed +25
-22
lines changed Original file line number Diff line number Diff line change 18
18
19
19
_logger = logging .getLogger ("salad" )
20
20
21
+ salad_files = ('metaschema.yml' ,
22
+ 'salad.md' ,
23
+ 'field_name.yml' ,
24
+ 'import_include.md' ,
25
+ 'link_res.yml' ,
26
+ 'ident_res.yml' ,
27
+ 'vocab_res.yml' ,
28
+ 'vocab_res.yml' ,
29
+ 'field_name_schema.yml' ,
30
+ 'field_name_src.yml' ,
31
+ 'field_name_proc.yml' ,
32
+ 'ident_res_schema.yml' ,
33
+ 'ident_res_src.yml' ,
34
+ 'ident_res_proc.yml' ,
35
+ 'link_res_schema.yml' ,
36
+ 'link_res_src.yml' ,
37
+ 'link_res_proc.yml' ,
38
+ 'vocab_res_schema.yml' ,
39
+ 'vocab_res_src.yml' ,
40
+ 'vocab_res_proc.yml' )
41
+
21
42
def get_metaschema ():
22
43
loader = ref_resolver .Loader ({
23
44
"Any" : "https://w3id.org/cwl/salad#Any" ,
@@ -105,28 +126,10 @@ def get_metaschema():
105
126
"xsd" : "http://www.w3.org/2001/XMLSchema#"
106
127
})
107
128
108
- for f in ('metaschema.yml' ,
109
- 'salad.md' ,
110
- 'field_name.yml' ,
111
- 'import_include.md' ,
112
- 'link_res.yml' ,
113
- 'ident_res.yml' ,
114
- 'vocab_res.yml' ,
115
- 'vocab_res.yml' ,
116
- 'field_name_schema.yml' ,
117
- 'field_name_src.yml' ,
118
- 'field_name_proc.yml' ,
119
- 'ident_res_schema.yml' ,
120
- 'ident_res_src.yml' ,
121
- 'ident_res_proc.yml' ,
122
- 'link_res_schema.yml' ,
123
- 'link_res_src.yml' ,
124
- 'link_res_proc.yml' ,
125
- 'vocab_res_schema.yml' ,
126
- 'vocab_res_src.yml' ,
127
- 'vocab_res_proc.yml' ):
128
- with resource_stream (__name__ , 'metaschema/' + f ) as rs :
129
- loader .cache ["https://w3id.org/cwl/" + f ] = rs .read ()
129
+ for f in salad_files :
130
+ rs = resource_stream (__name__ , 'metaschema/' + f ):
131
+ loader .cache ["https://w3id.org/cwl/" + f ] = rs .read ()
132
+ rs .close ()
130
133
131
134
j = yaml .load (loader .cache ["https://w3id.org/cwl/metaschema.yml" ])
132
135
j , _ = loader .resolve_all (j , "https://w3id.org/cwl/salad#" )
You can’t perform that action at this time.
0 commit comments