aap-utils 0.2.10__py3-none-any.whl → 0.2.11__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
aap_utils/cli.py CHANGED
@@ -23,17 +23,8 @@ def validate_image_name(image_name):
23
23
  return bool(re.fullmatch(r'[a-z0-9_]+', image_name))
24
24
 
25
25
  def validate_tags(tags):
26
- """Validate tags: lowercase, alphanumeric with underscores, and no spaces."""
27
- tag_list = {tag.strip().lower() for tag in tags.split() if tag.strip()} # Use set to remove duplicates
28
-
29
- if not tag_list:
30
- return None # No valid tags
31
-
32
- for tag in tag_list:
33
- if not re.fullmatch(r'[a-z0-9_]+', tag):
34
- return None # Found an invalid tag
35
-
36
- return list(tag_list) # Convert back to list before returning
26
+ """Validate tag format: lowercase, only alphanumeric and underscores."""
27
+ return bool(re.fullmatch(r'[a-z0-9_]+', tags))
37
28
 
38
29
  def get_username():
39
30
  """Retrieve the username from the environment variable KERNEL_AP_USER or use 'unname'."""
@@ -63,11 +54,11 @@ def publish_env():
63
54
  print("Invalid image name. Use only lowercase letters, numbers, or underscores (_).")
64
55
 
65
56
  while True:
66
- tags = input("Enter tags (separated by space): ").strip()
57
+ tags = input("Enter tag (only 1 tag accepted): ").strip()
67
58
  formatted_tags = validate_tags(tags)
68
59
  if formatted_tags:
69
60
  break
70
- print("Invalid tags. Each tag must be lowercase, contain only letters, numbers, or underscores (_), and have no spaces.")
61
+ print("Invalid tag. Each tag must be lowercase, contain only letters, numbers, or underscores (_), and have no spaces.")
71
62
 
72
63
  data = {
73
64
  "username": username,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aap_utils
3
- Version: 0.2.10
3
+ Version: 0.2.11
4
4
  Summary: A Python library for registering an IP address for AAP
5
5
  Author: Minh Dang
6
6
  Author-email: danghoangminh86@gmail.com
@@ -0,0 +1,8 @@
1
+ aap_utils/__init__.py,sha256=g6G3i3a5ANDJWqFX2oPsLpP93aTaoTj0gkMQzeqQIJw,172
2
+ aap_utils/cli.py,sha256=kf18Sy1vqvHME3wnlARf4yZY7m5C1Z4DT_cTOfI9xU4,3578
3
+ aap_utils/register.py,sha256=J9tukByU1mcy4SoaJOoGY8jjzL9JMuNTZGtCBSwwon0,3823
4
+ aap_utils-0.2.11.dist-info/METADATA,sha256=Vlx2LkSOhJ_3nlIuiRlulegeD23rtH2UU2pwfRIMw5Q,347
5
+ aap_utils-0.2.11.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
6
+ aap_utils-0.2.11.dist-info/entry_points.txt,sha256=K-h2toLoqFxAg4Bx2r7FWggKgYnAX9zp9s4Ms4r-d6s,49
7
+ aap_utils-0.2.11.dist-info/top_level.txt,sha256=Qt5xmL8_0_jhMl9uA3lg-xnvs4nCEyVj1tBE4vnp36M,10
8
+ aap_utils-0.2.11.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- aap_utils/__init__.py,sha256=g6G3i3a5ANDJWqFX2oPsLpP93aTaoTj0gkMQzeqQIJw,172
2
- aap_utils/cli.py,sha256=4Tou854Q00oZMzopGlAe4CtTOGzgPAAR2dRZCA31Wb0,3899
3
- aap_utils/register.py,sha256=J9tukByU1mcy4SoaJOoGY8jjzL9JMuNTZGtCBSwwon0,3823
4
- aap_utils-0.2.10.dist-info/METADATA,sha256=11U8OVCwdVYg_rGOfCstZVUdGZiMDIWctENkcwL7tWc,347
5
- aap_utils-0.2.10.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
6
- aap_utils-0.2.10.dist-info/entry_points.txt,sha256=K-h2toLoqFxAg4Bx2r7FWggKgYnAX9zp9s4Ms4r-d6s,49
7
- aap_utils-0.2.10.dist-info/top_level.txt,sha256=Qt5xmL8_0_jhMl9uA3lg-xnvs4nCEyVj1tBE4vnp36M,10
8
- aap_utils-0.2.10.dist-info/RECORD,,