JAG: logging class and string util methods extracted to independent modules

This allows py-scripts and py-json modules to access this logic independent of the lanforge_api.py module.

Signed-off-by: Jed Reynolds <jed@bitratchet.com>
This commit is contained in:
Jed Reynolds
2021-11-03 12:53:29 -07:00
parent 861e9b127c
commit 25d40a7a6a
3 changed files with 271 additions and 232 deletions

View File

@@ -0,0 +1,20 @@
def iss(text: str) -> bool:
"""
:param text: string to test
:return: true if text is at lease one non-whitespace character
"""
if text is None:
return False
if (len(text) == 0) or (text.strip() == ""):
return False
return True
def nott(text: str) -> bool:
"""
:param text:
:return: opposite of is
"""
return not iss(text=text)