Skip to content

Commit

Permalink
#82 extract name checks into _is_invalid_name function
Browse files Browse the repository at this point in the history
  • Loading branch information
jlhumber committed Oct 19, 2024
1 parent d500afb commit b7e51db
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion fudgeo/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,20 @@ def escape_name(name: str) -> str:
"""
Escape Name
"""
if name.upper() in KEYWORDS or not NAME_MATCHER(name):
if _is_invalid_name(name):
name = f'"{name}"'
return name
# End escape_name function


def _is_invalid_name(name: str) -> bool:
"""
Is invalid name
"""
return name.upper() in KEYWORDS or not NAME_MATCHER(name)
# End _is_invalid_name function


def now() -> str:
"""
Formatted Now
Expand Down

0 comments on commit b7e51db

Please sign in to comment.