Commit 10227e1b authored by Idriss Neumann's avatar Idriss Neumann
Browse files

Improve is_not_empty function

parent 20c71eb3
Pipeline #3664 canceled with stages
in 3 minutes and 59 seconds
......@@ -23,7 +23,7 @@ github-internal-mirror:
cmd-api-x86:
stage: publish
script:
- setsid ./ci/docker-deliver.sh "cmd-api" "2.9" "x86"
- setsid ./ci/docker-deliver.sh "cmd-api" "2.10" "x86"
only:
refs:
- /^(master.*)$/
......@@ -38,7 +38,7 @@ cmd-api-x86:
cmd-api-arm:
stage: publish
script:
- setsid ./ci/docker-deliver.sh "cmd-api" "2.9" "arm"
- setsid ./ci/docker-deliver.sh "cmd-api" "2.10" "arm"
only:
refs:
- /^(master.*)$/
......
......@@ -23,8 +23,12 @@ def is_forbidden (var):
return any(char in var for char in forbidden_chars)
def is_not_empty (var):
empty_chars = ["", "null", "nil", "false", "False", "FALSE"]
return var is not None and not any(c == var for c in empty_chars)
if (isinstance(var, bool)):
return var
elif (isinstance(var, int)):
return False
empty_chars = ["", "null", "nil", "false", "none"]
return var is not None and not any(c == var.lower() for c in empty_chars)
def is_empty (var):
return not is_not_empty(var)
......
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