update comments

This commit is contained in:
hari-dhanushkodi
2026-03-09 12:23:55 -04:00
parent ddd8666ff7
commit d45a6deba2
2 changed files with 11 additions and 0 deletions
+9
View File
@@ -943,6 +943,11 @@ def deploy(
def _normalize_image_name(value: str | None) -> str:
"""Sanitize a deployment/directory name into a valid Docker repository name.
Docker repository names must be lowercase and may only contain
[a-z0-9._-]. Invalid characters are replaced with hyphens.
"""
if not value:
return "app"
slug = re.sub(r"[^a-z0-9._-]+", "-", value.lower()).strip("-.")
@@ -950,6 +955,10 @@ def _normalize_image_name(value: str | None) -> str:
def _normalize_image_tag(value: str) -> str:
"""Validate and return a Docker image tag.
Tags may only contain [A-Za-z0-9_.-]. Defaults to "latest" when empty.
"""
if not value:
value = "latest"
if not re.fullmatch(r"[A-Za-z0-9_.-]+", value):
+2
View File
@@ -16,6 +16,7 @@ class Progress:
self.message = message
self._base_message = message
self._show_elapsed = elapsed
# use this to make sure we don't kill thread when we set msg to ""
self._stop = threading.Event()
self.spinner_generator = self.spinning_cursor()
@@ -52,6 +53,7 @@ class Progress:
sys.stdout.write(next(self.spinner_generator) + " " + message)
sys.stdout.flush()
time.sleep(self.delay)
# clear the spinner and message
sys.stdout.write(
"\b" * (len(message) + 2)
+ " " * (len(message) + 2)