Commit ecd11bb0 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Sort content of generated RPC code

This is similar to commit f5ce7613

. A stable sort order makes changes
between versions easier to find.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 105f0d47
...@@ -125,7 +125,7 @@ def _WriteBaseClass(sw, clsname, calls): ...@@ -125,7 +125,7 @@ def _WriteBaseClass(sw, clsname, calls):
raise ValueError("Procedure %s has only %d elements, expected %d" % raise ValueError("Procedure %s has only %d elements, expected %d" %
(v[0], len(v), _RPC_DEF_LEN)) (v[0], len(v), _RPC_DEF_LEN))
for (name, kind, _, timeout, args, _, _, desc) in calls: for (name, kind, _, timeout, args, _, _, desc) in sorted(calls):
funcargs = ["self"] funcargs = ["self"]
if kind == _SINGLE: if kind == _SINGLE:
...@@ -201,7 +201,7 @@ def main(): ...@@ -201,7 +201,7 @@ def main():
raise Exception("Found duplicate RPC definitions for '%s'" % raise Exception("Found duplicate RPC definitions for '%s'" %
utils.CommaJoin(sorted(dups))) utils.CommaJoin(sorted(dups)))
for (clsname, calls) in module.CALLS.items(): for (clsname, calls) in sorted(module.CALLS.items()):
_WriteBaseClass(sw, clsname, calls.values()) _WriteBaseClass(sw, clsname, calls.values())
print buf.getvalue() print buf.getvalue()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment