py_gen: move ID classes into their own modules
diff --git a/py_gen/codegen.py b/py_gen/codegen.py
index 2c4a135..de3fdba 100644
--- a/py_gen/codegen.py
+++ b/py_gen/codegen.py
@@ -40,8 +40,10 @@
roots = {
'of_header': 'message',
'of_action': 'action',
+ 'of_action_id': 'action_id',
'of_oxm': 'oxm',
'of_instruction': 'instruction',
+ 'of_instruction_id': 'instruction_id',
'of_meter_band': 'meter_band',
}
@@ -74,6 +76,11 @@
ofclasses=modules_by_version[version]['action'],
version=version)
+def generate_action_id(out, name, version):
+ util.render_template(out, 'module.py',
+ ofclasses=modules_by_version[version]['action_id'],
+ version=version)
+
def generate_oxm(out, name, version):
util.render_template(out, 'module.py',
ofclasses=modules_by_version[version]['oxm'],
@@ -94,6 +101,11 @@
ofclasses=modules_by_version[version]['instruction'],
version=version)
+def generate_instruction_id(out, name, version):
+ util.render_template(out, 'module.py',
+ ofclasses=modules_by_version[version]['instruction_id'],
+ version=version)
+
def generate_message(out, name, version):
util.render_template(out, 'module.py',
ofclasses=modules_by_version[version]['message'],
diff --git a/py_gen/templates/module.py b/py_gen/templates/module.py
index 252bf0d..30c45ad 100644
--- a/py_gen/templates/module.py
+++ b/py_gen/templates/module.py
@@ -43,6 +43,8 @@
import oxm
:: #endif
:: if version >= OFVersions.VERSION_1_3:
+import action_id
+import instruction_id
import meter_band
:: #endif
import util
diff --git a/py_gen/templates/util.py b/py_gen/templates/util.py
index 8ad246a..ed2698a 100644
--- a/py_gen/templates/util.py
+++ b/py_gen/templates/util.py
@@ -41,6 +41,8 @@
import oxm
:: #endif
:: if version >= OFVersions.VERSION_1_3:
+import action_id
+import instruction_id
import meter_band
:: #endif