Skip to content

Commit

Permalink
Fixes the Java camel-casing of protocol buffer filenames.
Browse files Browse the repository at this point in the history
	Change on 2015/08/13 by kstanger <[email protected]>
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=100571065
  • Loading branch information
kstanger authored and tomball committed Aug 13, 2015
1 parent 54f44ea commit 75bdc15
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/parse_proto.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@


def CamelCase(name):
return ''.join(string.capwords(name, '_').split('_'))
result = []
cap_next = True
for ch in name:
if cap_next and ch.islower():
result.append(ch.upper())
elif ch.isalnum():
result.append(ch)
cap_next = not ch.isalpha()
return ''.join(result)


class ProtoMetadata:
Expand Down

0 comments on commit 75bdc15

Please sign in to comment.