Make the Python generator use non-hardcoded namespaces.
- Make the Python generator use program->get_namespace("py")
instead of program->get_py_module()
- Eliminate the explicit "py_module" in t_program.
- Deprecate the py_module token.
- Update example .thrift files and syntax files.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665615 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/thrifty.yy b/compiler/cpp/src/thrifty.yy
index 81c7360..53c6d81 100644
--- a/compiler/cpp/src/thrifty.yy
+++ b/compiler/cpp/src/thrifty.yy
@@ -277,11 +277,13 @@
g_program->set_php_namespace($2);
}
}
+/* TODO(dreiss): Get rid of this once everyone is using the new hotness. */
| tok_py_module tok_identifier
{
+ pwarning(1, "'py_module' is deprecated. Use 'namespace py' instead");
pdebug("Header -> tok_py_module tok_identifier");
if (g_parse_mode == PROGRAM) {
- g_program->set_py_module($2);
+ g_program->set_namespace("py", $2);
}
}
| tok_perl_package tok_identifier