Index: mojo/public/tools/bindings/generators/python_templates/module.py.tmpl |
diff --git a/mojo/public/tools/bindings/generators/python_templates/module.py.tmpl b/mojo/public/tools/bindings/generators/python_templates/module.py.tmpl |
index 531c4e15c6a055442227c6307e065eecd0aa8426..f76d255839551a57aa1fa9477a8a05b1f921abd5 100644 |
--- a/mojo/public/tools/bindings/generators/python_templates/module.py.tmpl |
+++ b/mojo/public/tools/bindings/generators/python_templates/module.py.tmpl |
@@ -1,6 +1,8 @@ |
# Copyright 2014 The Chromium Authors. All rights reserved. |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
+ |
+import mojo.bindings.reflection as _reflection |
{% if imports %} |
{% for import in imports %} |
@@ -14,3 +16,13 @@ import {{import.python_module}} |
{{constant|name}} = {{constant.value|expression_to_text}} |
{% endfor %} |
{% endif %} |
+{% for enum in module.enums %} |
+ |
+class {{enum.name}}(object): |
+ __metaclass__ = _reflection.MojoEnumType |
+ VALUES = [ |
+{% for field in enum.fields %} |
+ ('{{field.name}}', {{field.computed_value}}), |
+{% endfor %} |
+ ] |
+{% endfor %} |