8000 Rename InlineJavascriptReq to InlineJavascriptRequirement · illusional/python-cwlgen@0acca24 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0acca24

Browse files
committed
Rename InlineJavascriptReq to InlineJavascriptRequirement
1 parent 050e05f commit 0acca24

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

cwlgen/requirements.py

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def parse_dict(cls, d):
2828

2929
c = d["class"]
3030
requirements = [
31-
InlineJavascriptReq, SchemaDefRequirement, SoftwareRequirement, InitialWorkDirRequirement,
31+
InlineJavascriptRequirement, SchemaDefRequirement, SoftwareRequirement, InitialWorkDirRequirement,
3232
SubworkflowFeatureRequirement, ScatterFeatureRequirement, MultipleInputFeatureRequirement,
3333
StepInputExpressionRequirement, DockerRequirement, EnvVarRequirement, ShellCommandRequirement,
3434
ResourceRequirement
@@ -41,7 +41,7 @@ def parse_dict(cls, d):
4141
return None
4242

4343

44-
class InlineJavascriptReq(Requirement):
44+
class InlineJavascriptRequirement(Requirement):
4545
"""
4646
Indicates that the workflow platform must support inline Javascript expressions.
4747
If this requirement is not present, the workflow platform must not perform expression interpolatation.
@@ -102,7 +102,7 @@ class InputRecordField(Serializable):
102102
"""
103103
Documentation: https://www.commonwl.org/v1.0/Workflow.html#InputRecordField
104104
"""
105-
def __init__(self, name, input_type, doc=None, input_binding=None, label=None):
105+
def __init__(self, name, type, doc=None, input_binding=None, label=None):
106106
"""
107107
:param name:
108108
:param input_type:
@@ -114,7 +114,7 @@ def __init__(self, name, input_type, doc=None, input_binding=None, label=None):
114114
:param label:
115115
"""
116116
self.name = name
117-
self.type = parse_type(input_type, requires_type=True)
117+
self.type = parse_type(type, requires_type=True)
118118
self.doc = doc
119119
self.inputBinding = input_binding
120120
self.label = label
@@ -124,8 +124,16 @@ def get_dict(self):
124124
d["type"] = get_type_dict(self.type)
125125
return d
126126

127+
# def parse_dict(cls, d):
128+
# d["input_type"] = "string"
129+
# ret = super(SchemaDefRequirement.InputRecordSchema.InputRecordField, cls).parse_dict(d)
130+
# ret.type =
131+
132+
133+
# ignore_fields_on_parse = "type"
127134
parse_types = {
128-
"fields": [InputRecordField]
135+
"fields": [InputRecordField],
136+
"inputBinding": [CommandLineBinding]
129137
}
130138

131139
class InputEnumSchema(Serializable):
@@ -183,11 +191,22 @@ def parse_dict(cls, d):
183191
return None
184192
return cls.parse_dict_generic(cls, d)
185193

194+
parse_types = {
195+
# Defined below because we need to have declared the class before we can use it
196+
}
197+
186198
parse_types = {
187-
"fields": [InputRecordSchema, InputEnumSchema, InputArraySchema]
199+
"types": [InputRecordSchema, InputEnumSchema, InputArraySchema],
188200
}
189201

190202

203+
# declare this here, because inside the InputArraySchema we haven't fully defined the schemas
204+
SchemaDefRequirement.InputArraySchema.parse_types = {
205+
"items": [SchemaDefRequirement.InputRecordSchema, SchemaDefRequirement.InputEnumSchema,
206+
SchemaDefRequirement.InputArraySchema, str]
207+
}
208+
209+
191210
class SoftwareRequirement(Requirement):
192211
"""
193212
A list of software packages that should be configured in the environment of the defined process.
@@ -214,7 +233,7 @@ def __init__(self, package, version=None, specs=None):
214233
self.specs = specs
215234

216235
parse_types = {
217-
"package": [SoftwarePackage]
236+
"packages": [SoftwarePackage]
218237
}
219238

220239

0 commit comments

Comments
 (0)
0