kitecmd 0.7__tar.gz → 0.9__tar.gz

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.
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kitecmd
3
- Version: 0.7
4
- Summary: A CLI tool with update checking and other tools.
3
+ Version: 0.9
4
+ Summary: A CLI tool with update checking and other tools like kitecmd-IR.
5
5
  Author: coltonsr77
6
- Requires-Python: >=3.8
6
+ Requires-Python: >=3.9
7
7
  Requires-Dist: requests
8
8
  Dynamic: author
9
9
  Dynamic: requires-dist
kitecmd-0.9/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # kitecmd
2
+
3
+ A simple Python CLI utility published on PyPI that has kitecmd-IR (use command kitecmd install-IR to get it)
4
+
5
+ ## Install
6
+ ```bash
7
+ pip install kitecmd
@@ -0,0 +1 @@
1
+ __version__ = "0.9"
@@ -3,6 +3,7 @@ import requests
3
3
  import sys
4
4
  import platform
5
5
  import os
6
+ import subprocess
6
7
  from importlib.metadata import version, PackageNotFoundError
7
8
 
8
9
 
@@ -12,7 +13,6 @@ def main():
12
13
  description="Kite Command Utility"
13
14
  )
14
15
 
15
- # Global version flag
16
16
  parser.add_argument(
17
17
  "--version", "-v",
18
18
  action="store_true",
@@ -21,37 +21,36 @@ def main():
21
21
 
22
22
  subparsers = parser.add_subparsers(dest="command", help="Available commands")
23
23
 
24
- # === test command ===
24
+ # test command
25
25
  test_parser = subparsers.add_parser("test", help="Run a test message")
26
26
  test_parser.add_argument("--msg", "-m", default="This is a test.", help="Custom test message")
27
27
  test_parser.add_argument("--verbose", "-V", action="store_true", help="Show detailed system info")
28
28
 
29
- # === checkupdate command ===
30
- subparsers.add_parser("checkupdate", help="Check if a new version is available on PyPI")
29
+ # checkupdate command
30
+ subparsers.add_parser("checkupdate", help="Check for updates and optionally install the latest version")
31
31
 
32
- # === version command ===
32
+ # install-ir command
33
+ subparsers.add_parser("install-IR", help="Install the kitecmd-IR package from PyPI")
34
+
35
+ # version command
33
36
  subparsers.add_parser("version", help="Show the current version of kitecmd")
34
37
 
35
38
  args = parser.parse_args()
36
39
 
37
- # --- Command logic ---
38
40
  if args.version or args.command == "version":
39
41
  show_version("kitecmd")
40
-
41
42
  elif args.command == "test":
42
43
  run_test(args)
43
-
44
44
  elif args.command == "checkupdate":
45
45
  check_for_update("kitecmd")
46
-
46
+ elif args.command == "install-IR":
47
+ install_kitecmd_IR()
47
48
  else:
48
49
  parser.print_help()
49
50
 
50
51
 
51
52
  def run_test(args):
52
- """Handle the 'test' command logic."""
53
53
  print(args.msg)
54
-
55
54
  if args.verbose:
56
55
  print("\n--- Verbose Info ---")
57
56
  print(f"kitecmd version: {get_package_version('kitecmd')}")
@@ -63,7 +62,6 @@ def run_test(args):
63
62
 
64
63
 
65
64
  def get_package_version(package_name):
66
- """Safely get the package version."""
67
65
  try:
68
66
  return version(package_name)
69
67
  except PackageNotFoundError:
@@ -71,14 +69,11 @@ def get_package_version(package_name):
71
69
 
72
70
 
73
71
  def show_version(package_name):
74
- """Print the installed version."""
75
72
  print(f"kitecmd version {get_package_version(package_name)}")
76
73
 
77
74
 
78
75
  def check_for_update(package_name):
79
- """Check PyPI for the latest version of this package."""
80
76
  current_version = get_package_version(package_name)
81
-
82
77
  try:
83
78
  resp = requests.get(f"https://pypi.org/pypi/{package_name}/json", timeout=5)
84
79
  resp.raise_for_status()
@@ -88,9 +83,27 @@ def check_for_update(package_name):
88
83
  sys.exit(1)
89
84
 
90
85
  if current_version == latest_version:
91
- print(f"You are using the latest version ({current_version})")
86
+ print(f"You are using the latest version ({current_version}).")
92
87
  else:
93
- print("A new version is available!")
88
+ print("A new version is available.")
94
89
  print(f"Installed: {current_version}")
95
90
  print(f"Latest: {latest_version}")
96
- print(f"To update, run: pip install --upgrade {package_name}")
91
+ answer = input("Do you want to update to the latest version? (y/n): ").strip().lower()
92
+ if answer == "y":
93
+ try:
94
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "--upgrade", package_name])
95
+ print(f"\nSuccessfully updated {package_name} to version {latest_version}.")
96
+ except subprocess.CalledProcessError:
97
+ print("Failed to update kitecmd. Try running as administrator or with elevated permissions.")
98
+ else:
99
+ print("Update cancelled.")
100
+
101
+
102
+ def install_kitecmd_IR():
103
+ """Install the kitecmd-IR package from PyPI."""
104
+ print("Installing kitecmd-IR...")
105
+ try:
106
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "kitecmd-IR"])
107
+ print("\nSuccessfully installed kitecmd-IR.")
108
+ except subprocess.CalledProcessError:
109
+ print("Failed to install kitecmd-IR. Try running as administrator or check your internet connection.")
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kitecmd
3
- Version: 0.7
4
- Summary: A CLI tool with update checking and other tools.
3
+ Version: 0.9
4
+ Summary: A CLI tool with update checking and other tools like kitecmd-IR.
5
5
  Author: coltonsr77
6
- Requires-Python: >=3.8
6
+ Requires-Python: >=3.9
7
7
  Requires-Dist: requests
8
8
  Dynamic: author
9
9
  Dynamic: requires-dist
@@ -2,9 +2,9 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="kitecmd",
5
- version="0.7",
5
+ version="0.9",
6
6
  author="coltonsr77",
7
- description="A CLI tool with update checking and other tools.",
7
+ description="A CLI tool with update checking and other tools like kitecmd-IR.",
8
8
  packages=find_packages(include=["kitecmd", "kitecmd.*"]),
9
9
  install_requires=["requests"],
10
10
  entry_points={
@@ -13,5 +13,5 @@ setup(
13
13
  ],
14
14
  },
15
15
  include_package_data=True,
16
- python_requires=">=3.8",
16
+ python_requires=">=3.9",
17
17
  )
kitecmd-0.7/README.md DELETED
@@ -1,7 +0,0 @@
1
- # kitecmd
2
-
3
- A simple example Python CLI utility published on PyPI.
4
-
5
- ## Install
6
- ```bash
7
- pip install kitecmd
@@ -1 +0,0 @@
1
- __version__ = "0.7"
File without changes
File without changes
File without changes