vss-tools 0.5.0.dev0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vspec/__init__.py +996 -0
- vspec/loggingconfig.py +22 -0
- vspec/model/__init__.py +7 -0
- vspec/model/constants.py +307 -0
- vspec/model/exceptions.py +29 -0
- vspec/model/vsstree.py +602 -0
- vspec/py.typed +0 -0
- vspec/utils/__init__.py +23 -0
- vspec/utils/idgen_utils.py +97 -0
- vspec/utils/stringstyle.py +25 -0
- vspec/utils/vss2id_val.py +165 -0
- vspec/vspec2vss_config.py +53 -0
- vspec/vspec2x.py +191 -0
- vspec/vss2x.py +38 -0
- vspec/vssexporters/__init__.py +7 -0
- vspec/vssexporters/vss2binary.py +147 -0
- vspec/vssexporters/vss2csv.py +82 -0
- vspec/vssexporters/vss2ddsidl.py +295 -0
- vspec/vssexporters/vss2franca.py +98 -0
- vspec/vssexporters/vss2graphql.py +143 -0
- vspec/vssexporters/vss2id.py +172 -0
- vspec/vssexporters/vss2json.py +116 -0
- vspec/vssexporters/vss2jsonschema.py +159 -0
- vspec/vssexporters/vss2protobuf.py +171 -0
- vspec/vssexporters/vss2yaml.py +122 -0
- vss_tools-0.5.0.dev0.data/scripts/vspec2csv.py +29 -0
- vss_tools-0.5.0.dev0.data/scripts/vspec2ddsidl.py +29 -0
- vss_tools-0.5.0.dev0.data/scripts/vspec2franca.py +29 -0
- vss_tools-0.5.0.dev0.data/scripts/vspec2graphql.py +29 -0
- vss_tools-0.5.0.dev0.data/scripts/vspec2id.py +28 -0
- vss_tools-0.5.0.dev0.data/scripts/vspec2json.py +29 -0
- vss_tools-0.5.0.dev0.data/scripts/vspec2jsonschema.py +29 -0
- vss_tools-0.5.0.dev0.data/scripts/vspec2protobuf.py +29 -0
- vss_tools-0.5.0.dev0.data/scripts/vspec2yaml.py +29 -0
- vss_tools-0.5.0.dev0.dist-info/LICENSE +373 -0
- vss_tools-0.5.0.dev0.dist-info/METADATA +65 -0
- vss_tools-0.5.0.dev0.dist-info/RECORD +39 -0
- vss_tools-0.5.0.dev0.dist-info/WHEEL +5 -0
- vss_tools-0.5.0.dev0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
# Copyright (c) 2021 Contributors to COVESA
|
|
4
|
+
#
|
|
5
|
+
# This program and the accompanying materials are made available under the
|
|
6
|
+
# terms of the Mozilla Public License 2.0 which is available at
|
|
7
|
+
# https://www.mozilla.org/en-US/MPL/2.0/
|
|
8
|
+
#
|
|
9
|
+
# SPDX-License-Identifier: MPL-2.0
|
|
10
|
+
|
|
11
|
+
# Convert vspec file to proto
|
|
12
|
+
#
|
|
13
|
+
|
|
14
|
+
import argparse
|
|
15
|
+
import logging
|
|
16
|
+
import os
|
|
17
|
+
import sys
|
|
18
|
+
from pathlib import Path
|
|
19
|
+
from typing import Set
|
|
20
|
+
from typing import Optional
|
|
21
|
+
|
|
22
|
+
from anytree import PreOrderIter # type: ignore[import]
|
|
23
|
+
from vspec.model.vsstree import VSSNode
|
|
24
|
+
from vspec.vss2x import Vss2X
|
|
25
|
+
from vspec.vspec2vss_config import Vspec2VssConfig
|
|
26
|
+
|
|
27
|
+
# Add path to main py vspec parser
|
|
28
|
+
myDir = os.path.dirname(os.path.realpath(__file__))
|
|
29
|
+
sys.path.append(os.path.join(myDir, ".."))
|
|
30
|
+
|
|
31
|
+
PATH_DELIMITER = "."
|
|
32
|
+
DIR_DELIMITER = "/"
|
|
33
|
+
|
|
34
|
+
mapped = {
|
|
35
|
+
"uint16": "uint32",
|
|
36
|
+
"uint8": "uint32",
|
|
37
|
+
"int8": "int32",
|
|
38
|
+
"int16": "int32",
|
|
39
|
+
"boolean": "bool"
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class ProtoExporter(object):
|
|
44
|
+
def __init__(self, out_dir: Path):
|
|
45
|
+
self.out_files: Set[Path] = set()
|
|
46
|
+
self.out_dir = out_dir
|
|
47
|
+
|
|
48
|
+
def setup_file(self, fp: Path, package_name: str):
|
|
49
|
+
with open(fp, 'w') as proto_file:
|
|
50
|
+
logging.info(f"Initializing {fp}, package {package_name}")
|
|
51
|
+
proto_file.write("syntax = \"proto3\";\n\n")
|
|
52
|
+
# set up the proto's package
|
|
53
|
+
proto_file.write(f"package {package_name};\n\n")
|
|
54
|
+
self.out_files.add(fp)
|
|
55
|
+
|
|
56
|
+
def traverse_data_type_tree(self, tree: VSSNode):
|
|
57
|
+
"""
|
|
58
|
+
All structs in a branch are written to a single .proto file.
|
|
59
|
+
The file's base name is same as the branch's name
|
|
60
|
+
The fully qualified path of the type becomes the package.
|
|
61
|
+
|
|
62
|
+
Example A.B.C.MyType becomes:
|
|
63
|
+
"package A.B.C;
|
|
64
|
+
message MyType{}"
|
|
65
|
+
|
|
66
|
+
The files are organized by package.
|
|
67
|
+
With the above example, the file generated is
|
|
68
|
+
A/B/C/C.proto
|
|
69
|
+
"""
|
|
70
|
+
|
|
71
|
+
tree_node: VSSNode
|
|
72
|
+
|
|
73
|
+
for tree_node in filter(lambda n: n.is_struct(), PreOrderIter(tree)):
|
|
74
|
+
type_qn = tree_node.qualified_name(PATH_DELIMITER).split(PATH_DELIMITER)
|
|
75
|
+
curr_branch_qn = type_qn[:-1]
|
|
76
|
+
# create dir if necessary
|
|
77
|
+
dp = self.out_dir / Path(DIR_DELIMITER.join(curr_branch_qn))
|
|
78
|
+
dp.mkdir(parents=True, exist_ok=True)
|
|
79
|
+
|
|
80
|
+
curr_branch = type_qn[-2]
|
|
81
|
+
fp = dp / Path(f'{curr_branch}.proto')
|
|
82
|
+
is_first_write = fp not in self.out_files
|
|
83
|
+
if is_first_write:
|
|
84
|
+
self.setup_file(fp, '.'.join(curr_branch_qn))
|
|
85
|
+
with open(fp, 'a') as proto_file:
|
|
86
|
+
# import of other proto types in other branches
|
|
87
|
+
imports = []
|
|
88
|
+
for c_node in filter(lambda c: c.is_property() and not c.has_datatype(), tree_node.children):
|
|
89
|
+
child_branch_path = c_node.get_datatype().split(PATH_DELIMITER)[:-1]
|
|
90
|
+
child_branch_path_str = DIR_DELIMITER.join(child_branch_path)
|
|
91
|
+
if child_branch_path_str != DIR_DELIMITER.join(curr_branch_qn):
|
|
92
|
+
child_basename = child_branch_path[-1]
|
|
93
|
+
imports.append(f"{child_branch_path_str}/{child_basename}.proto")
|
|
94
|
+
|
|
95
|
+
# unique sorted list
|
|
96
|
+
imports = list(set(imports))
|
|
97
|
+
imports.sort()
|
|
98
|
+
for importstmt in imports:
|
|
99
|
+
proto_file.write(f"import \"{importstmt}\";\n")
|
|
100
|
+
proto_file.write("\n")
|
|
101
|
+
|
|
102
|
+
proto_file.write(f"message {type_qn[-1]} {{" + "\n")
|
|
103
|
+
print_message_body(tree_node.children, proto_file)
|
|
104
|
+
proto_file.write("}\n\n")
|
|
105
|
+
logging.info(f"Wrote {type_qn[-1]} to {fp}")
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def traverse_signal_tree(tree: VSSNode, proto_file):
|
|
109
|
+
proto_file.write("syntax = \"proto3\";\n\n")
|
|
110
|
+
tree_node: VSSNode
|
|
111
|
+
|
|
112
|
+
# get all the import statements for dependent types (structs)
|
|
113
|
+
imports = []
|
|
114
|
+
for c_node in filter(lambda c: c.is_signal() and not c.has_datatype(), PreOrderIter(tree)):
|
|
115
|
+
child_path = c_node.get_datatype().split(PATH_DELIMITER)[:-1]
|
|
116
|
+
child_basename = child_path[-1]
|
|
117
|
+
imports.append(f"{DIR_DELIMITER.join(child_path)}/{child_basename}.proto")
|
|
118
|
+
|
|
119
|
+
# unique sorted list
|
|
120
|
+
imports = list(set(imports))
|
|
121
|
+
imports.sort()
|
|
122
|
+
# write import statements to file
|
|
123
|
+
for importstmt in imports:
|
|
124
|
+
proto_file.write(f"import \"{importstmt}\";\n")
|
|
125
|
+
proto_file.write("\n")
|
|
126
|
+
|
|
127
|
+
# write proto messages to file
|
|
128
|
+
for tree_node in filter(lambda n: n.is_branch(), PreOrderIter(tree)):
|
|
129
|
+
proto_file.write(f"message {tree_node.qualified_name('')} {{" + "\n")
|
|
130
|
+
print_message_body(tree_node.children, proto_file)
|
|
131
|
+
proto_file.write("}\n\n")
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
def print_message_body(nodes, proto_file):
|
|
135
|
+
for i, node in enumerate(nodes, 1):
|
|
136
|
+
data_type = node.qualified_name("")
|
|
137
|
+
if not (node.is_branch() or node.is_struct()):
|
|
138
|
+
dt_val = node.get_datatype()
|
|
139
|
+
data_type = mapped.get(dt_val.strip("[]"), dt_val.strip("[]"))
|
|
140
|
+
data_type = ("repeated " if dt_val.endswith("[]") else "") + data_type
|
|
141
|
+
proto_file.write(f" {data_type} {node.name} = {i};" + "\n")
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
class Vss2Protobuf(Vss2X):
|
|
145
|
+
|
|
146
|
+
def __init__(self, vspec2vss_config: Vspec2VssConfig):
|
|
147
|
+
vspec2vss_config.no_expand_option_supported = False
|
|
148
|
+
vspec2vss_config.uuid_supported = False
|
|
149
|
+
|
|
150
|
+
def add_arguments(self, parser: argparse.ArgumentParser) -> None:
|
|
151
|
+
parser.add_argument('--json-all-extended-attributes', action='store_true',
|
|
152
|
+
help="Generate all extended attributes found in the model "
|
|
153
|
+
"(default is generating only those given by the -e/--extended-attributes parameter).")
|
|
154
|
+
parser.add_argument('--json-pretty', action='store_true',
|
|
155
|
+
help=" Pretty print JSON output.")
|
|
156
|
+
|
|
157
|
+
def generate(self, config: argparse.Namespace, signal_root: VSSNode, vspec2vss_config: Vspec2VssConfig,
|
|
158
|
+
data_type_root: Optional[VSSNode] = None) -> None:
|
|
159
|
+
logging.info("Generating protobuf output...")
|
|
160
|
+
if data_type_root is not None:
|
|
161
|
+
if config.types_output_file is not None:
|
|
162
|
+
fp = Path(config.types_output_file)
|
|
163
|
+
exporter_path = Path(os.path.dirname(fp))
|
|
164
|
+
else:
|
|
165
|
+
exporter_path = Path(Path.cwd())
|
|
166
|
+
logging.debug(f"Will use {exporter_path} for type exports")
|
|
167
|
+
exporter = ProtoExporter(exporter_path)
|
|
168
|
+
exporter.traverse_data_type_tree(data_type_root)
|
|
169
|
+
|
|
170
|
+
with open(config.output_file, 'w') as f:
|
|
171
|
+
traverse_signal_tree(signal_root, f)
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
# Copyright (c) 2016 Contributors to COVESA
|
|
4
|
+
#
|
|
5
|
+
# This program and the accompanying materials are made available under the
|
|
6
|
+
# terms of the Mozilla Public License 2.0 which is available at
|
|
7
|
+
# https://www.mozilla.org/en-US/MPL/2.0/
|
|
8
|
+
#
|
|
9
|
+
# SPDX-License-Identifier: MPL-2.0
|
|
10
|
+
|
|
11
|
+
#
|
|
12
|
+
# Convert all vspec input files to a single flat YAML file.
|
|
13
|
+
#
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import argparse
|
|
17
|
+
from vspec.model.vsstree import VSSNode
|
|
18
|
+
import yaml
|
|
19
|
+
import logging
|
|
20
|
+
from typing import Dict, Any
|
|
21
|
+
from typing import Optional
|
|
22
|
+
from vspec.vss2x import Vss2X
|
|
23
|
+
from vspec.vspec2vss_config import Vspec2VssConfig
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def export_node(yaml_dict, node, config, print_uuid):
|
|
27
|
+
|
|
28
|
+
node_path = node.qualified_name()
|
|
29
|
+
|
|
30
|
+
yaml_dict[node_path] = {}
|
|
31
|
+
|
|
32
|
+
yaml_dict[node_path]["type"] = str(node.type.value)
|
|
33
|
+
|
|
34
|
+
if node.is_signal() or node.is_property():
|
|
35
|
+
yaml_dict[node_path]["datatype"] = node.get_datatype()
|
|
36
|
+
|
|
37
|
+
# many optional attributes are initilized to "" in vsstree.py
|
|
38
|
+
if node.min != "":
|
|
39
|
+
yaml_dict[node_path]["min"] = node.min
|
|
40
|
+
if node.max != "":
|
|
41
|
+
yaml_dict[node_path]["max"] = node.max
|
|
42
|
+
if node.allowed != "":
|
|
43
|
+
yaml_dict[node_path]["allowed"] = node.allowed
|
|
44
|
+
if node.default != "":
|
|
45
|
+
yaml_dict[node_path]["default"] = node.default
|
|
46
|
+
if node.deprecation != "":
|
|
47
|
+
yaml_dict[node_path]["deprecation"] = node.deprecation
|
|
48
|
+
|
|
49
|
+
# in case of unit or aggregate, the attribute will be missing
|
|
50
|
+
try:
|
|
51
|
+
yaml_dict[node_path]["unit"] = str(node.unit.value)
|
|
52
|
+
except AttributeError:
|
|
53
|
+
pass
|
|
54
|
+
try:
|
|
55
|
+
yaml_dict[node_path]["aggregate"] = node.aggregate
|
|
56
|
+
except AttributeError:
|
|
57
|
+
pass
|
|
58
|
+
|
|
59
|
+
yaml_dict[node_path]["description"] = node.description
|
|
60
|
+
|
|
61
|
+
if node.comment != "":
|
|
62
|
+
yaml_dict[node_path]["comment"] = node.comment
|
|
63
|
+
|
|
64
|
+
if print_uuid:
|
|
65
|
+
yaml_dict[node_path]["uuid"] = node.uuid
|
|
66
|
+
|
|
67
|
+
for k, v in node.extended_attributes.items():
|
|
68
|
+
if not config.yaml_all_extended_attributes and k not in VSSNode.whitelisted_extended_attributes:
|
|
69
|
+
continue
|
|
70
|
+
yaml_dict[node_path][k] = v
|
|
71
|
+
|
|
72
|
+
# Include instance information if we run tool in "no-expand" mode
|
|
73
|
+
if config.no_expand and node.instances is not None:
|
|
74
|
+
yaml_dict[node_path]["instances"] = node.instances
|
|
75
|
+
|
|
76
|
+
for child in node.children:
|
|
77
|
+
export_node(yaml_dict, child, config, print_uuid)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def export_yaml(file_name, content_dict):
|
|
81
|
+
with open(file_name, 'w') as f:
|
|
82
|
+
yaml.dump(content_dict, f, default_flow_style=False, Dumper=NoAliasDumper,
|
|
83
|
+
sort_keys=True, width=1024, indent=2, encoding='utf-8', allow_unicode=True)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
# create dumper to remove aliases from output and to add nice new line after each object for a better readability
|
|
87
|
+
class NoAliasDumper(yaml.SafeDumper):
|
|
88
|
+
def ignore_aliases(self, data):
|
|
89
|
+
return True
|
|
90
|
+
|
|
91
|
+
def write_line_break(self, data=None):
|
|
92
|
+
super().write_line_break(data)
|
|
93
|
+
if len(self.indents) == 1:
|
|
94
|
+
super().write_line_break()
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class Vss2Yaml(Vss2X):
|
|
98
|
+
|
|
99
|
+
def add_arguments(self, parser: argparse.ArgumentParser) -> None:
|
|
100
|
+
parser.add_argument('--yaml-all-extended-attributes', action='store_true',
|
|
101
|
+
help=("Generate all extended attributes found in the model "
|
|
102
|
+
"(default is generating only those given by the "
|
|
103
|
+
"-e/--extended-attributes parameter)."))
|
|
104
|
+
|
|
105
|
+
def generate(self, config: argparse.Namespace, signal_root: VSSNode, vspec2vss_config: Vspec2VssConfig,
|
|
106
|
+
data_type_root: Optional[VSSNode] = None) -> None:
|
|
107
|
+
|
|
108
|
+
logging.info("Generating YAML output...")
|
|
109
|
+
|
|
110
|
+
signals_yaml_dict: Dict[str, Any] = {}
|
|
111
|
+
export_node(signals_yaml_dict, signal_root, config, vspec2vss_config.generate_uuid)
|
|
112
|
+
|
|
113
|
+
if data_type_root is not None:
|
|
114
|
+
data_types_yaml_dict: Dict[str, Any] = {}
|
|
115
|
+
export_node(data_types_yaml_dict, data_type_root, config, vspec2vss_config.generate_uuid)
|
|
116
|
+
if config.types_output_file is None:
|
|
117
|
+
logging.info("Adding custom data types to signal dictionary")
|
|
118
|
+
signals_yaml_dict["ComplexDataTypes"] = data_types_yaml_dict
|
|
119
|
+
else:
|
|
120
|
+
export_yaml(config.types_output_file, data_types_yaml_dict)
|
|
121
|
+
|
|
122
|
+
export_yaml(config.output_file, signals_yaml_dict)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!python
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2016 Contributors to COVESA
|
|
4
|
+
#
|
|
5
|
+
# This program and the accompanying materials are made available under the
|
|
6
|
+
# terms of the Mozilla Public License 2.0 which is available at
|
|
7
|
+
# https://www.mozilla.org/en-US/MPL/2.0/
|
|
8
|
+
#
|
|
9
|
+
# SPDX-License-Identifier: MPL-2.0
|
|
10
|
+
|
|
11
|
+
#
|
|
12
|
+
# Convert vspec2csv wrapper for vspec2x
|
|
13
|
+
#
|
|
14
|
+
|
|
15
|
+
import sys
|
|
16
|
+
from vspec.vspec2x import Vspec2X
|
|
17
|
+
from vspec.vspec2vss_config import Vspec2VssConfig
|
|
18
|
+
from vspec.vssexporters.vss2csv import Vss2Csv
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def main(args):
|
|
22
|
+
vspec2vss_config = Vspec2VssConfig()
|
|
23
|
+
vss2csv = Vss2Csv()
|
|
24
|
+
vspec2x = Vspec2X(vss2csv, vspec2vss_config)
|
|
25
|
+
vspec2x.main(args)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
if __name__ == "__main__":
|
|
29
|
+
main(sys.argv[1:])
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!python
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2022 Contributors to COVESA
|
|
4
|
+
#
|
|
5
|
+
# This program and the accompanying materials are made available under the
|
|
6
|
+
# terms of the Mozilla Public License 2.0 which is available at
|
|
7
|
+
# https://www.mozilla.org/en-US/MPL/2.0/
|
|
8
|
+
#
|
|
9
|
+
# SPDX-License-Identifier: MPL-2.0
|
|
10
|
+
|
|
11
|
+
#
|
|
12
|
+
# Convert vspec2idl wrapper for vspec2x
|
|
13
|
+
#
|
|
14
|
+
|
|
15
|
+
import sys
|
|
16
|
+
from vspec.vspec2x import Vspec2X
|
|
17
|
+
from vspec.vspec2vss_config import Vspec2VssConfig
|
|
18
|
+
from vspec.vssexporters.vss2ddsidl import Vss2DdsIdl
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def main(args):
|
|
22
|
+
vspec2vss_config = Vspec2VssConfig()
|
|
23
|
+
vss2json = Vss2DdsIdl(vspec2vss_config)
|
|
24
|
+
vspec2x = Vspec2X(vss2json, vspec2vss_config)
|
|
25
|
+
vspec2x.main(args)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
if __name__ == "__main__":
|
|
29
|
+
main(sys.argv[1:])
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!python
|
|
2
|
+
|
|
3
|
+
# Copyright (c) 2016 Contributors to COVESA
|
|
4
|
+
#
|
|
5
|
+
# This program and the accompanying materials are made available under the
|
|
6
|
+
# terms of the Mozilla Public License 2.0 which is available at
|
|
7
|
+
# https://www.mozilla.org/en-US/MPL/2.0/
|
|
8
|
+
#
|
|
9
|
+
# SPDX-License-Identifier: MPL-2.0
|
|
10
|
+
|
|
11
|
+
#
|
|
12
|
+
# Convert vspec file to FrancaIDL spec.
|
|
13
|
+
#
|
|
14
|
+
|
|
15
|
+
import sys
|
|
16
|
+
from vspec.vspec2x import Vspec2X
|
|
17
|
+
from vspec.vspec2vss_config import Vspec2VssConfig
|
|
18
|
+
from vspec.vssexporters.vss2franca import Vss2Franca
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def main(args):
|
|
22
|
+
vspec2vss_config = Vspec2VssConfig()
|
|
23
|
+
vss2franca = Vss2Franca(vspec2vss_config)
|
|
24
|
+
vspec2x = Vspec2X(vss2franca, vspec2vss_config)
|
|
25
|
+
vspec2x.main(args)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
if __name__ == "__main__":
|
|
29
|
+
main(sys.argv[1:])
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!python
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2022 Contributors to COVESA
|
|
4
|
+
#
|
|
5
|
+
# This program and the accompanying materials are made available under the
|
|
6
|
+
# terms of the Mozilla Public License 2.0 which is available at
|
|
7
|
+
# https://www.mozilla.org/en-US/MPL/2.0/
|
|
8
|
+
#
|
|
9
|
+
# SPDX-License-Identifier: MPL-2.0
|
|
10
|
+
|
|
11
|
+
#
|
|
12
|
+
# Convert vspec2grahql wrapper for vspec2x
|
|
13
|
+
#
|
|
14
|
+
|
|
15
|
+
import sys
|
|
16
|
+
from vspec.vspec2x import Vspec2X
|
|
17
|
+
from vspec.vspec2vss_config import Vspec2VssConfig
|
|
18
|
+
from vspec.vssexporters.vss2graphql import Vss2Graphql
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def main(args):
|
|
22
|
+
vspec2vss_config = Vspec2VssConfig()
|
|
23
|
+
vss2graphql = Vss2Graphql(vspec2vss_config)
|
|
24
|
+
vspec2x = Vspec2X(vss2graphql, vspec2vss_config)
|
|
25
|
+
vspec2x.main(args)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
if __name__ == "__main__":
|
|
29
|
+
main(sys.argv[1:])
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!python
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2023 Contributors to COVESA
|
|
4
|
+
#
|
|
5
|
+
# This program and the accompanying materials are made available under the
|
|
6
|
+
# terms of the Mozilla Public License 2.0 which is available at
|
|
7
|
+
# https://www.mozilla.org/en-US/MPL/2.0/
|
|
8
|
+
#
|
|
9
|
+
# SPDX-License-Identifier: MPL-2.0
|
|
10
|
+
#
|
|
11
|
+
# Initialize static IDs.
|
|
12
|
+
#
|
|
13
|
+
|
|
14
|
+
import sys
|
|
15
|
+
from vspec.vspec2x import Vspec2X
|
|
16
|
+
from vspec.vspec2vss_config import Vspec2VssConfig
|
|
17
|
+
from vspec.vssexporters.vss2id import Vss2Id
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def main(arguments):
|
|
21
|
+
vspec2vss_config = Vspec2VssConfig()
|
|
22
|
+
vss2json = Vss2Id()
|
|
23
|
+
vspec2x = Vspec2X(vss2json, vspec2vss_config)
|
|
24
|
+
vspec2x.main(arguments)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
if __name__ == "__main__":
|
|
28
|
+
main(sys.argv[1:])
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!python
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2023 Contributors to COVESA
|
|
4
|
+
#
|
|
5
|
+
# This program and the accompanying materials are made available under the
|
|
6
|
+
# terms of the Mozilla Public License 2.0 which is available at
|
|
7
|
+
# https://www.mozilla.org/en-US/MPL/2.0/
|
|
8
|
+
#
|
|
9
|
+
# SPDX-License-Identifier: MPL-2.0
|
|
10
|
+
|
|
11
|
+
#
|
|
12
|
+
# Convert vspec2json wrapper for vspec2x
|
|
13
|
+
#
|
|
14
|
+
|
|
15
|
+
import sys
|
|
16
|
+
from vspec.vspec2x import Vspec2X
|
|
17
|
+
from vspec.vspec2vss_config import Vspec2VssConfig
|
|
18
|
+
from vspec.vssexporters.vss2json import Vss2Json
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def main(args):
|
|
22
|
+
vspec2vss_config = Vspec2VssConfig()
|
|
23
|
+
vss2json = Vss2Json()
|
|
24
|
+
vspec2x = Vspec2X(vss2json, vspec2vss_config)
|
|
25
|
+
vspec2x.main(args)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
if __name__ == "__main__":
|
|
29
|
+
main(sys.argv[1:])
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!python
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2023 Contributors to COVESA
|
|
4
|
+
#
|
|
5
|
+
# This program and the accompanying materials are made available under the
|
|
6
|
+
# terms of the Mozilla Public License 2.0 which is available at
|
|
7
|
+
# https://www.mozilla.org/en-US/MPL/2.0/
|
|
8
|
+
#
|
|
9
|
+
# SPDX-License-Identifier: MPL-2.0
|
|
10
|
+
|
|
11
|
+
#
|
|
12
|
+
# Convert vspec2jsonschema wrapper for vspec2x
|
|
13
|
+
#
|
|
14
|
+
|
|
15
|
+
import sys
|
|
16
|
+
from vspec.vspec2x import Vspec2X
|
|
17
|
+
from vspec.vspec2vss_config import Vspec2VssConfig
|
|
18
|
+
from vspec.vssexporters.vss2jsonschema import Vss2JsonSchema
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def main(args):
|
|
22
|
+
vspec2vss_config = Vspec2VssConfig()
|
|
23
|
+
vss2jsonschema = Vss2JsonSchema()
|
|
24
|
+
vspec2x = Vspec2X(vss2jsonschema, vspec2vss_config)
|
|
25
|
+
vspec2x.main(args)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
if __name__ == "__main__":
|
|
29
|
+
main(sys.argv[1:])
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!python
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2021 Contributors to COVESA
|
|
4
|
+
#
|
|
5
|
+
# This program and the accompanying materials are made available under the
|
|
6
|
+
# terms of the Mozilla Public License 2.0 which is available at
|
|
7
|
+
# https://www.mozilla.org/en-US/MPL/2.0/
|
|
8
|
+
#
|
|
9
|
+
# SPDX-License-Identifier: MPL-2.0
|
|
10
|
+
|
|
11
|
+
#
|
|
12
|
+
# Convert vspec2protobuf wrapper for vspec2x
|
|
13
|
+
#
|
|
14
|
+
|
|
15
|
+
import sys
|
|
16
|
+
from vspec.vspec2x import Vspec2X
|
|
17
|
+
from vspec.vspec2vss_config import Vspec2VssConfig
|
|
18
|
+
from vspec.vssexporters.vss2protobuf import Vss2Protobuf
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def main(args):
|
|
22
|
+
vspec2vss_config = Vspec2VssConfig()
|
|
23
|
+
vss2protobuf = Vss2Protobuf(vspec2vss_config)
|
|
24
|
+
vspec2x = Vspec2X(vss2protobuf, vspec2vss_config)
|
|
25
|
+
vspec2x.main(args)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
if __name__ == "__main__":
|
|
29
|
+
main(sys.argv[1:])
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!python
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2021 Contributors to COVESA
|
|
4
|
+
#
|
|
5
|
+
# This program and the accompanying materials are made available under the
|
|
6
|
+
# terms of the Mozilla Public License 2.0 which is available at
|
|
7
|
+
# https://www.mozilla.org/en-US/MPL/2.0/
|
|
8
|
+
#
|
|
9
|
+
# SPDX-License-Identifier: MPL-2.0
|
|
10
|
+
|
|
11
|
+
#
|
|
12
|
+
# Convert vspec2yaml wrapper for vspec2x
|
|
13
|
+
#
|
|
14
|
+
|
|
15
|
+
import sys
|
|
16
|
+
from vspec.vspec2x import Vspec2X
|
|
17
|
+
from vspec.vspec2vss_config import Vspec2VssConfig
|
|
18
|
+
from vspec.vssexporters.vss2yaml import Vss2Yaml
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def main(args):
|
|
22
|
+
vspec2vss_config = Vspec2VssConfig()
|
|
23
|
+
vss2yaml = Vss2Yaml()
|
|
24
|
+
vspec2x = Vspec2X(vss2yaml, vspec2vss_config)
|
|
25
|
+
vspec2x.main(args)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
if __name__ == "__main__":
|
|
29
|
+
main(sys.argv[1:])
|