gmsg 0.1.0__py3-none-any.whl → 0.1.1__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.
gmsg/gmsg.py CHANGED
@@ -4,6 +4,10 @@ from google import genai
4
4
  from pathlib import Path
5
5
  from .api_key import get_or_set_api_key
6
6
 
7
+ GREEN = "\033[92m"
8
+ RED = "\033[91m"
9
+ RESET = "\033[0m"
10
+
7
11
 
8
12
  def is_git_repo() -> bool:
9
13
  path = Path(Path.cwd())
@@ -41,14 +45,17 @@ def generate_commit_message(diff: str) -> str:
41
45
  msg = client.models.generate_content(model="gemini-2.0-flash",
42
46
  contents=query)
43
47
 
44
- print(msg.text)
48
+ print(f"{GREEN}{msg.text}{RESET}")
45
49
  # generated_msg = "feat: Add poetry.lock and pyproject.toml files."
46
50
  # print(generated_msg)
47
51
  if continue_with_this_prompt(msg.text):
48
52
  break
49
53
  except genai.errors.ClientError as error:
50
54
  if error.code == 400:
51
- print(dict(error="Gemini API key not valid, check ~/.gmsg"))
55
+ print(
56
+ dict(
57
+ error=f"{RED}Gemini API key not valid, check ~/.gmsg{RESET}"
58
+ ))
52
59
  else:
53
60
  print(error)
54
61
  sys.exit(1)
@@ -59,7 +66,7 @@ def continue_with_this_prompt(commit_msg: str) -> bool:
59
66
  if action in ("", "y", "Y"):
60
67
  print(f"Running: `git commit -m {commit_msg}`")
61
68
  print(
62
- f"Message commited to git, to confirm you can run git commit --amend."
69
+ f"{GREEN}Message commited to git, to confirm you can run git commit --amend.{RESET}"
63
70
  )
64
71
  commit_message_to_git(commit_msg)
65
72
  return True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: gmsg
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Generates git commit messages for you using AI.
5
5
  License: MIT
6
6
  Author: shiyan99s@gmail.com
@@ -0,0 +1,7 @@
1
+ gmsg/__init__.py,sha256=9B4ZkbOBiBYYqv3Kh-mdlNn-yDPvkpXOqrm52Ng8CTk,23
2
+ gmsg/api_key.py,sha256=92X--Gmwki2QxBSpMwo5xTl6I1g6GMw8FbCwVx8ojME,454
3
+ gmsg/gmsg.py,sha256=hflPSahpCDgaCsFE33udZSkZ4hgB43UkCZZ9tcigTd4,3172
4
+ gmsg-0.1.1.dist-info/METADATA,sha256=PWwm7v5MgB32x9ZCOXXw2ko39yK7Xk2uhYQyI4PK65w,458
5
+ gmsg-0.1.1.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
6
+ gmsg-0.1.1.dist-info/entry_points.txt,sha256=LqLzIXT9IVenl_xEptCn4LqWHm34ypTaVMhoW5tFBSg,39
7
+ gmsg-0.1.1.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- gmsg/__init__.py,sha256=9B4ZkbOBiBYYqv3Kh-mdlNn-yDPvkpXOqrm52Ng8CTk,23
2
- gmsg/api_key.py,sha256=92X--Gmwki2QxBSpMwo5xTl6I1g6GMw8FbCwVx8ojME,454
3
- gmsg/gmsg.py,sha256=NmQd55li6D5g8vR2hY1gxKXarm0XPSG9jyPO63RvS5g,3016
4
- gmsg-0.1.0.dist-info/METADATA,sha256=GusjYVbsPUYN-LV7Mn7lg30VvidTTJjFpmUdjfZCS94,458
5
- gmsg-0.1.0.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
6
- gmsg-0.1.0.dist-info/entry_points.txt,sha256=LqLzIXT9IVenl_xEptCn4LqWHm34ypTaVMhoW5tFBSg,39
7
- gmsg-0.1.0.dist-info/RECORD,,
File without changes