Skip to content
This repository has been archived by the owner on Jan 7, 2019. It is now read-only.

Commit

Permalink
[system_design] use common check for names in elements of strongly ty…
Browse files Browse the repository at this point in the history
…ped enums.
  • Loading branch information
georgi-g committed Feb 15, 2015
1 parent b91583f commit da3f72a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions tools/system_design/xmlparser/type.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ def __init__(self, node, stronglyTyped):
if not re.match("^[0-9A-Z_]*$", self.name):
raise ParserException("Attribute name of element in enum has to be `UPPER_UNDERSCORE_STYLE` (found: '%s')" % (self.name))
else:
if not all(part.istitle() for part in self.name.split(' ')):
raise ParserException("Attribute name of element in enum has to be `Capitalized Spaced Style` (found: '%s')" % (self.name))
utils.check_name(self.name)

self.string = node.get('string')
if self.string is None:
Expand Down
2 changes: 1 addition & 1 deletion tools/system_design/xmlparser/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def check_name(name):
"""
if not re.match("^([A-Z]?[a-z0-9]* )*([A-Z]?[a-z0-9]*)$", name):
raise ParserException("Error in name '%s'. Check Spelling or Case. Allowed are only Names matching '^([A-Z]?[a-z0-9]* )*([A-Z]?[a-z0-9]*)$' " % name)
raise ParserException("Error in name '%s'. Check spelling or case. Names must be 'som How spaced Style' matching '^([A-Z]?[a-z0-9]* )*([A-Z]?[a-z0-9]*)$' " % name)

This comment has been minimized.

Copy link
@salkinium

salkinium Feb 15, 2015

Member

"som How spaced Style"?


class SortedDictionary(dict):
"""
Expand Down

0 comments on commit da3f72a

Please sign in to comment.