developer-assistant 0.2.1__tar.gz → 0.2.5__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.
Files changed (27) hide show
  1. {developer_assistant-0.2.1/developer_assistant.egg-info → developer_assistant-0.2.5}/PKG-INFO +13 -9
  2. {developer_assistant-0.2.1 → developer_assistant-0.2.5}/PYPI.md +12 -8
  3. {developer_assistant-0.2.1 → developer_assistant-0.2.5}/README.md +12 -10
  4. {developer_assistant-0.2.1 → developer_assistant-0.2.5}/da/default/default-memory.ini +1 -1
  5. developer_assistant-0.2.5/da/default/test-project.ini +5 -0
  6. {developer_assistant-0.2.1 → developer_assistant-0.2.5}/da/interface.py +33 -33
  7. {developer_assistant-0.2.1 → developer_assistant-0.2.5}/da/intro.md +9 -8
  8. {developer_assistant-0.2.1 → developer_assistant-0.2.5}/da/modules/config_manager.py +31 -39
  9. {developer_assistant-0.2.1 → developer_assistant-0.2.5}/da/modules/projects_manager.py +16 -22
  10. {developer_assistant-0.2.1 → developer_assistant-0.2.5}/da/modules/version_logic.py +40 -20
  11. {developer_assistant-0.2.1 → developer_assistant-0.2.5/developer_assistant.egg-info}/PKG-INFO +13 -9
  12. {developer_assistant-0.2.1 → developer_assistant-0.2.5}/pyproject.toml +1 -1
  13. developer_assistant-0.2.1/da/default/test-project.ini +0 -5
  14. {developer_assistant-0.2.1 → developer_assistant-0.2.5}/LICENSE +0 -0
  15. {developer_assistant-0.2.1 → developer_assistant-0.2.5}/da/__init__.py +0 -0
  16. {developer_assistant-0.2.1 → developer_assistant-0.2.5}/da/default/default-changelog.md +0 -0
  17. {developer_assistant-0.2.1 → developer_assistant-0.2.5}/da/modules/__init__.py +0 -0
  18. {developer_assistant-0.2.1 → developer_assistant-0.2.5}/da/modules/opener.py +0 -0
  19. {developer_assistant-0.2.1 → developer_assistant-0.2.5}/da/templates/changelog_template.txt +0 -0
  20. {developer_assistant-0.2.1 → developer_assistant-0.2.5}/da/templates/entry_template.txt +0 -0
  21. {developer_assistant-0.2.1 → developer_assistant-0.2.5}/da/templates/header_template.txt +0 -0
  22. {developer_assistant-0.2.1 → developer_assistant-0.2.5}/developer_assistant.egg-info/SOURCES.txt +0 -0
  23. {developer_assistant-0.2.1 → developer_assistant-0.2.5}/developer_assistant.egg-info/dependency_links.txt +0 -0
  24. {developer_assistant-0.2.1 → developer_assistant-0.2.5}/developer_assistant.egg-info/entry_points.txt +0 -0
  25. {developer_assistant-0.2.1 → developer_assistant-0.2.5}/developer_assistant.egg-info/requires.txt +0 -0
  26. {developer_assistant-0.2.1 → developer_assistant-0.2.5}/developer_assistant.egg-info/top_level.txt +0 -0
  27. {developer_assistant-0.2.1 → developer_assistant-0.2.5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: developer-assistant
3
- Version: 0.2.1
3
+ Version: 0.2.5
4
4
  Summary: A lightweight TUI designed to simplify formatting of Markdown changelogs.
5
5
  License: The MIT License (MIT)
6
6
 
@@ -42,6 +42,10 @@ Dynamic: license-file
42
42
 
43
43
  > **Tip:** Once setup is complete and you start the program, an intro with all the necessary information will be displayed for you in the terminal.
44
44
 
45
+ > **Linux note:**
46
+ > Avoid using `sudo pip install` because it installs into the system Python.
47
+ If you want a system‑wide install, use the uv method or use `pip install --user`
48
+
45
49
  ## Updating DA
46
50
  Two possibilities, depending on how you installed.
47
51
 
@@ -68,11 +72,11 @@ Don't change the folder structure or modify variable names inside `.ini` files.
68
72
 
69
73
  **The user's data (`Templates/`, `Projects/`, `memory.ini`) is stored in standard locations:**
70
74
 
71
- Windows: `C:\Users\...\AppData\Roaming\da-ui\`
75
+ * Windows: `C:\Users\...\AppData\Roaming\da-ui\`
72
76
 
73
- Linux: `~/.config/da-ui/`
77
+ * Linux: `~/.config/da-ui/`
74
78
 
75
- macOS: `~/Library/Application Support/da-ui/`
79
+ * macOS: `~/Library/Application Support/da-ui/`
76
80
 
77
81
  The `da-ui/` folder will be created automatically.
78
82
 
@@ -101,19 +105,19 @@ You can access files/folders and configuration straight from the menus, so you s
101
105
 
102
106
  The `memory.ini` file does exactly what you'd expect, it features:
103
107
 
104
- > Last project
108
+ * Last project
105
109
 
106
- > Pinned projects
110
+ * Pinned projects
107
111
 
108
- > Custom colour
112
+ * Custom colour
109
113
 
110
114
  Last project gets updated automatically, the rest are up to you.
111
115
 
112
116
  - *`Ctrl+C` works everywhere to quickly exit DA.*
113
117
 
114
118
  ### Setting up your first project
115
- For a dummy changelog to experiment with, navigate to `Main menu / Projects`, choose `Test-Project`, then choose option `4.` to start adjusting this projects paths.
119
+ For a dummy changelog to experiment with, navigate to `Main menu / Projects`, choose `test-project`, then choose option `4.` to start adjusting this projects paths.
116
120
 
117
- Now make an optional `Test-Project/` folder with a `CHANGELOG.md` in it anywhere on your system and point the `.ini` file to it.
121
+ Now make an optional `test-project/` folder with a `CHANGELOG.md` in it anywhere on your system and point the `.ini` file to it.
118
122
 
119
123
  Once configured, you can create as many changelog entries as you want by picking that project in the menu.
@@ -11,6 +11,10 @@
11
11
 
12
12
  > **Tip:** Once setup is complete and you start the program, an intro with all the necessary information will be displayed for you in the terminal.
13
13
 
14
+ > **Linux note:**
15
+ > Avoid using `sudo pip install` because it installs into the system Python.
16
+ If you want a system‑wide install, use the uv method or use `pip install --user`
17
+
14
18
  ## Updating DA
15
19
  Two possibilities, depending on how you installed.
16
20
 
@@ -37,11 +41,11 @@ Don't change the folder structure or modify variable names inside `.ini` files.
37
41
 
38
42
  **The user's data (`Templates/`, `Projects/`, `memory.ini`) is stored in standard locations:**
39
43
 
40
- Windows: `C:\Users\...\AppData\Roaming\da-ui\`
44
+ * Windows: `C:\Users\...\AppData\Roaming\da-ui\`
41
45
 
42
- Linux: `~/.config/da-ui/`
46
+ * Linux: `~/.config/da-ui/`
43
47
 
44
- macOS: `~/Library/Application Support/da-ui/`
48
+ * macOS: `~/Library/Application Support/da-ui/`
45
49
 
46
50
  The `da-ui/` folder will be created automatically.
47
51
 
@@ -70,19 +74,19 @@ You can access files/folders and configuration straight from the menus, so you s
70
74
 
71
75
  The `memory.ini` file does exactly what you'd expect, it features:
72
76
 
73
- > Last project
77
+ * Last project
74
78
 
75
- > Pinned projects
79
+ * Pinned projects
76
80
 
77
- > Custom colour
81
+ * Custom colour
78
82
 
79
83
  Last project gets updated automatically, the rest are up to you.
80
84
 
81
85
  - *`Ctrl+C` works everywhere to quickly exit DA.*
82
86
 
83
87
  ### Setting up your first project
84
- For a dummy changelog to experiment with, navigate to `Main menu / Projects`, choose `Test-Project`, then choose option `4.` to start adjusting this projects paths.
88
+ For a dummy changelog to experiment with, navigate to `Main menu / Projects`, choose `test-project`, then choose option `4.` to start adjusting this projects paths.
85
89
 
86
- Now make an optional `Test-Project/` folder with a `CHANGELOG.md` in it anywhere on your system and point the `.ini` file to it.
90
+ Now make an optional `test-project/` folder with a `CHANGELOG.md` in it anywhere on your system and point the `.ini` file to it.
87
91
 
88
92
  Once configured, you can create as many changelog entries as you want by picking that project in the menu.
@@ -17,12 +17,12 @@
17
17
  ## Appearance
18
18
 
19
19
  ### Coloured, easy-to-use menus
20
- ![Changelog Menu](Documents/images/changelog-menu.png)
20
+ ![Changelog Menu](documents/images/changelog-menu.png)
21
21
 
22
22
  ### Beautiful changelog previews
23
23
  Preview your Markdown changelogs directly in the terminal with Rich rendering:
24
24
 
25
- ![Changelog Preview](Documents/images/md-preview.png)
25
+ ![Changelog Preview](documents/images/md-preview.png)
26
26
 
27
27
 
28
28
  ## Introduction
@@ -44,11 +44,11 @@ Don't change the folder structure or modify variable names inside `.ini` files.
44
44
 
45
45
  **The user's data (`Templates/`, `Projects/`, `memory.ini`) is stored in standard locations:**
46
46
 
47
- Windows: `C:\Users\...\AppData\Roaming\da-ui\`
47
+ * Windows: `C:\Users\...\AppData\Roaming\da-ui\`
48
48
 
49
- Linux: `~/.config/da-ui/`
49
+ * Linux: `~/.config/da-ui/`
50
50
 
51
- macOS: `~/Library/Application Support/da-ui/`
51
+ * macOS: `~/Library/Application Support/da-ui/`
52
52
 
53
53
  The `da-ui/` folder will be created automatically.
54
54
 
@@ -77,11 +77,11 @@ You can access files/folders and configuration straight from the menus, so you s
77
77
 
78
78
  The `memory.ini` file does exactly what you'd expect, it features:
79
79
 
80
- > Last project
80
+ * Last project
81
81
 
82
- > Pinned projects
82
+ * Pinned projects
83
83
 
84
- > Custom colour
84
+ * Custom colour
85
85
 
86
86
  Last project gets updated automatically, the rest are up to you.
87
87
 
@@ -89,9 +89,9 @@ Last project gets updated automatically, the rest are up to you.
89
89
 
90
90
 
91
91
  ### Setting up your first project
92
- For a dummy changelog to experiment with, navigate to `Main menu / Projects`, choose `Test-Project`, then choose option `4.` to start adjusting this projects paths.
92
+ For a dummy changelog to experiment with, navigate to `Main menu / Projects`, choose `test-project`, then choose option `4.` to start adjusting this projects paths.
93
93
 
94
- The `Test-Project/` folder is included in the programs root folder for repo clones and is safe to experiment with. If you installed from PyPI just make a `CHANGELOG.md` anywhere and point the `.ini` file to it.
94
+ The `test-project/` folder is included in the programs root folder **for repo clones** and is safe to experiment with. If you installed from PyPI just make a `CHANGELOG.md` anywhere and point the `.ini` file to it.
95
95
 
96
96
  Once configured, you can create as many changelog entries as you want by picking that project in the menu.
97
97
 
@@ -109,10 +109,12 @@ B. **Using pip:** `python -m pip install -U developer-assistant`
109
109
  *Run all terminal commands in the repo folder*
110
110
 
111
111
  A. **Using uv:**
112
+
112
113
  1. `git pull`
113
114
  2. `uv tool install .`
114
115
 
115
116
  B. **Using pip:**
117
+
116
118
  1. `git pull`
117
119
  2. `pip install .`
118
120
 
@@ -1,6 +1,6 @@
1
1
  [ITEMS]
2
2
  last_project =
3
- pinned_project = Test-Project
3
+ pinned_project = test-project
4
4
  pinned_project1 =
5
5
  pinned_project2 =
6
6
 
@@ -0,0 +1,5 @@
1
+ [SETTINGS]
2
+ path = C:\Users\...\Developer-Assistant\test-project
3
+ changelog = C:\Users\...\Developer-Assistant\test-project\CHANGELOG.md
4
+ version = 1.0.0
5
+ cloud =
@@ -16,7 +16,7 @@ from importlib import resources
16
16
 
17
17
  class Interface:
18
18
  def __init__(self, color="light_blue"):
19
- self.version = "0.2.0"
19
+ self.version = "0.2.5"
20
20
  title = f"DA - {self.version}"
21
21
 
22
22
  if platform.system() == "Windows":
@@ -26,13 +26,10 @@ class Interface:
26
26
 
27
27
  self.config = ConfigManager('memory.ini')
28
28
 
29
- first_run = False
29
+ self.first_run = False
30
30
  if not self.config.memory_ini.exists():
31
31
  self.local_init()
32
- self.config = ConfigManager('memory.ini')
33
- first_run = True
34
-
35
- self.projects_manager = ProjectsManager()
32
+ self.first_run = True
36
33
 
37
34
  self.memory = self.config.load_memory()
38
35
  self.color = self.memory.get('color') or color
@@ -41,13 +38,8 @@ class Interface:
41
38
  self.header = (colored(" Developer Assistant ", f"{self.color}"))
42
39
  self.clear_screen = 'cls' if platform.system() == 'Windows' else 'clear'
43
40
  self.user_path = os.environ.get('USERPROFILE') or os.environ.get('HOME', 'User')
44
-
45
- if first_run:
46
- self.intro()
47
-
48
- self.load()
49
41
 
50
- def load(self):
42
+ def run(self):
51
43
  temp_log = Path(__file__).parent / "CHANGELOG.tmp"
52
44
 
53
45
  if os.path.exists(temp_log):
@@ -76,8 +68,18 @@ class Interface:
76
68
  for i in track(range(20)):
77
69
  time.sleep(0.10)
78
70
 
79
- self.menu()
80
-
71
+ state = "intro" if self.first_run else "menu"
72
+
73
+ while state != "exit":
74
+ if state == "intro":
75
+ self.intro()
76
+ state = "menu"
77
+
78
+ elif state == "menu":
79
+ result = self.menu()
80
+ if result == "exit":
81
+ state = "exit"
82
+
81
83
  def menu(self):
82
84
  while True:
83
85
  os.system(self.clear_screen)
@@ -93,8 +95,8 @@ class Interface:
93
95
  os.system(self.clear_screen)
94
96
  print(self.header.center(127, "="))
95
97
  print("Bye!")
96
- time.sleep(2)
97
- raise SystemExit
98
+ time.sleep(1)
99
+ return "exit"
98
100
 
99
101
  elif choice == "1":
100
102
  self.projects()
@@ -104,12 +106,12 @@ class Interface:
104
106
  else:
105
107
  print("")
106
108
  print(colored("Unknown option...", "light_red", attrs=["blink"]))
107
- time.sleep(2)
109
+ time.sleep(1)
108
110
 
109
111
  def projects(self):
110
- config = ConfigManager('memory.ini')
111
- self.memory = config.load_memory()
112
+ projects_manager = ProjectsManager(config=self.config)
112
113
  while True:
114
+ self.memory = self.config.load_memory()
113
115
  os.system(self.clear_screen)
114
116
  print("Main menu / Projects")
115
117
  print(self.header.center(127, "="))
@@ -135,10 +137,10 @@ class Interface:
135
137
  print(colored("\nLast project has not been defined...", "light_red", attrs=["blink"]))
136
138
  time.sleep(2)
137
139
  else:
138
- self.projects_manager.load_project(f"{project}")
140
+ projects_manager.load_project(f"{project}")
139
141
 
140
142
  elif choice == "2":
141
- self.projects_manager.new_project()
143
+ projects_manager.new_project()
142
144
 
143
145
  elif choice.lower() in ("a", "b", "c"):
144
146
  #==If the pinned project is empty, return an error message==
@@ -155,12 +157,12 @@ class Interface:
155
157
  time.sleep(2)
156
158
  else:
157
159
  project = self.memory.get(key)
158
- self.projects_manager.load_project(f"{project}")
160
+ projects_manager.load_project(f"{project}")
159
161
 
160
162
  else:
161
163
  print("")
162
164
  print(colored("Unknown option...", "light_red", attrs=["blink"]))
163
- time.sleep(2)
165
+ time.sleep(1)
164
166
 
165
167
  def settings(self):
166
168
  while True:
@@ -180,10 +182,10 @@ class Interface:
180
182
 
181
183
  if choice.lower() == "e":
182
184
  return
183
- elif choice == "1":
184
- pass
185
- elif choice == "2":
186
- pass
185
+ #elif choice == "1":
186
+ #pass
187
+ #elif choice == "2":
188
+ #pass
187
189
  elif choice == "3":
188
190
  Opener.open(self.config.memory_ini)
189
191
  elif choice == "4":
@@ -193,7 +195,7 @@ class Interface:
193
195
  else:
194
196
  print("")
195
197
  print(colored("Unknown option...", "light_red", attrs=["blink"]))
196
- time.sleep(2)
198
+ time.sleep(1)
197
199
 
198
200
  def local_init(self):
199
201
  default_files = resources.files("da.default")
@@ -213,7 +215,7 @@ class Interface:
213
215
  def intro(self):
214
216
  os.system(self.clear_screen)
215
217
  print(colored("Welcome to the Developer Assistant\n", f"{self.color}", attrs=["bold"]))
216
- print("Here's everything you need to get started:\n")
218
+ print("Here's everything you need to get started...\n")
217
219
 
218
220
  time.sleep(2)
219
221
 
@@ -226,15 +228,13 @@ class Interface:
226
228
 
227
229
  input("\nContinue..." + colored("[Enter]", f"{self.color}"))
228
230
 
229
- self.menu()
230
-
231
231
  def main():
232
232
  try:
233
233
  app = Interface()
234
234
  app.run()
235
235
  except KeyboardInterrupt:
236
- print("\n\n" + colored("Execution interrupted by the user. Exiting...", "magenta", attrs=["bold"]))
237
- time.sleep(2)
236
+ print("\n\n" + colored("Execution interrupted. Exiting...", "magenta", attrs=["bold"]))
237
+ time.sleep(1)
238
238
  sys.exit(0)
239
239
 
240
240
  if __name__ == "__main__":
@@ -3,12 +3,13 @@
3
3
  ## Introduction
4
4
 
5
5
  ### Setting up your first project
6
- For a dummy changelog to experiment with, navigate to `Main menu / Projects`, choose `Test-Project`, then choose option `4.` to start adjusting this projects paths.
6
+ For a dummy changelog to experiment with, navigate to `Main menu / Projects`, choose `test-project`, then choose option `4.` to start adjusting this projects paths.
7
7
 
8
- The `Test-Project/` folder is included in the programs root folder for repo clones and is safe to experiment with. If you installed from an URL just make a `CHANGELOG.md` anywhere and point the `.ini` file to it.
8
+ The `test-project/` folder is included in the programs root folder **for repo clones** and is safe to experiment with. If you installed from PyPI just make a `CHANGELOG.md` anywhere and point the `.ini` file to it.
9
9
 
10
10
  Once configured, you can create as many changelog entries as you want by picking that project in the menu.
11
11
 
12
+ > *Tip:*
12
13
  > *This quick guide is also at the end of the README for future reference*
13
14
 
14
15
  ### Using the program.
@@ -20,11 +21,11 @@ Don't change the folder structure or modify variable names inside `.ini` files.
20
21
 
21
22
  **Your user data (`Templates/`, `Projects/`, `memory.ini`) is stored in standard locations:**
22
23
 
23
- Windows: `C:\Users\...\AppData\Roaming\da-ui\`
24
+ * Windows: `C:\Users\...\AppData\Roaming\da-ui\`
24
25
 
25
- Linux: `~/.config/da-ui/`
26
+ * Linux: `~/.config/da-ui/`
26
27
 
27
- macOS: `~/Library/Application Support/da-ui/`
28
+ * macOS: `~/Library/Application Support/da-ui/`
28
29
 
29
30
  **The `da-ui/` folder has been created automatically. Updates won't overwrite it, only you can default it.
30
31
  You can access its content quickly when going to: `Main menu / Settings`**
@@ -51,11 +52,11 @@ You can access files/folders and configuration straight from the menus, so you s
51
52
 
52
53
  The `memory.ini` file does exactly what you'd expect, it features:
53
54
 
54
- > Last project
55
+ * Last project
55
56
 
56
- > Pinned projects
57
+ * Pinned projects
57
58
 
58
- > Custom colour
59
+ * Custom colour
59
60
 
60
61
  Last project gets updated automatically, the rest are up to you.
61
62
 
@@ -22,42 +22,13 @@ class ConfigManager:
22
22
  self.templates_folder = self.global_dir / "Templates"
23
23
  self.new_project_ini = self.projects_folder / config_file
24
24
 
25
- self.migrate_old_data()
25
+ self.data_check()
26
26
 
27
27
  #==Update last_project in memory.ini==
28
28
  self.update_last_project = Path(config_file).stem
29
29
 
30
- self.config.read(self.memory_ini)
31
-
32
- def migrate_old_data(self):
33
- old_memory = self.internal_dir / "memory.ini"
34
- old_projects = self.internal_dir / "Projects"
35
-
36
- if old_memory.exists() and not self.memory_ini.exists():
37
- shutil.move(str(old_memory), str(self.memory_ini))
38
- print(f"Migrated memory.ini to {self.global_dir}")
39
- time.sleep(2)
40
-
41
- if old_projects.exists() and not self.projects_folder.exists():
42
- shutil.move(str(old_projects), str(self.projects_folder))
43
- print(f"Migrated Projects folder to {self.global_dir}")
44
- time.sleep(2)
45
-
46
- if not self.templates_folder.exists():
47
- default_templates = resources.files("da.templates")
48
- user_templates = self.templates_folder
49
-
50
- user_templates.mkdir(parents=True, exist_ok=True)
51
-
52
- for item in default_templates.iterdir():
53
- dest = user_templates / item.name
54
- if not dest.exists():
55
- shutil.copy(item, dest)
56
-
57
- print(f"Copied default Templates to {self.global_dir}")
58
- time.sleep(2)
59
-
60
30
  def load_memory(self):
31
+ self.config.read(self.memory_ini)
61
32
  prj = self.config['ITEMS']
62
33
  return {
63
34
  'last_project': prj.get('last_project'),
@@ -97,14 +68,7 @@ class ConfigManager:
97
68
  #==Return project ini variables==
98
69
  project_parser = configparser.ConfigParser()
99
70
  project_parser.read(self.new_project_ini)
100
- '''
101
- try:
102
- prj = project_parser['SETTINGS']
103
- except KeyError:
104
- print(f"\nCan't find {self.new_project_ini}")
105
- time.sleep(2)
106
- return
107
- '''
71
+
108
72
  prj = project_parser['SETTINGS']
109
73
  return {
110
74
  'path': prj.get('path'),
@@ -122,5 +86,33 @@ class ConfigManager:
122
86
  project_parser.write(f)
123
87
  return
124
88
 
89
+ def data_check(self):
90
+ old_memory = self.internal_dir / "memory.ini"
91
+ old_projects = self.internal_dir / "Projects"
92
+
93
+ if old_memory.exists() and not self.memory_ini.exists():
94
+ shutil.move(str(old_memory), str(self.memory_ini))
95
+ print(f"Migrated memory.ini to {self.global_dir}")
96
+ time.sleep(2)
97
+
98
+ if old_projects.exists() and not self.projects_folder.exists():
99
+ shutil.move(str(old_projects), str(self.projects_folder))
100
+ print(f"Migrated Projects folder to {self.global_dir}")
101
+ time.sleep(2)
102
+
103
+ if not self.templates_folder.exists():
104
+ default_templates = resources.files("da.templates")
105
+ user_templates = self.templates_folder
106
+
107
+ user_templates.mkdir(parents=True, exist_ok=True)
108
+
109
+ for item in default_templates.iterdir():
110
+ dest = user_templates / item.name
111
+ if not dest.exists():
112
+ shutil.copy(item, dest)
113
+
114
+ print(f"Copied default Templates to {self.global_dir}")
115
+ time.sleep(2)
116
+
125
117
  if __name__ == "__main__":
126
118
  ConfigManager()
@@ -10,11 +10,8 @@ from da.modules.version_logic import VersionLogic
10
10
  from da.modules.opener import Opener
11
11
 
12
12
  class ProjectsManager:
13
- def __init__(self, color="light_blue"):
14
- os.system('title Developer Assistant')
15
- self.version = "1.0.0-alpha"
16
-
17
- self.config = ConfigManager('memory.ini')
13
+ def __init__(self, config, color="light_blue"):
14
+ self.config = config
18
15
  self.memory = self.config.load_memory()
19
16
  self.color = self.memory.get('color') or color
20
17
 
@@ -50,15 +47,14 @@ class ProjectsManager:
50
47
  return
51
48
 
52
49
  elif confirm.lower() == "y":
53
- self.new_manager = ConfigManager(f"{name}.ini")
54
- self.new_manager.data = {
50
+ new_manager = ConfigManager(f"{name}.ini")
51
+ new_manager.data = {
55
52
  "path": path,
56
53
  "changelog": changelog,
57
54
  "version": version,
58
55
  "cloud": cloud
59
56
  }
60
- self.new_manager.project_ini()
61
-
57
+ new_manager.project_ini()
62
58
  return
63
59
 
64
60
  else:
@@ -68,26 +64,24 @@ class ProjectsManager:
68
64
  return
69
65
 
70
66
  def load_project(self, project):
67
+ version_logic = VersionLogic(config=self.config)
68
+ project_ini_path = self.config.projects_folder / f"{project}.ini"
69
+ load_manager = ConfigManager(f"{project}.ini")
70
+
71
71
  while True:
72
- chosen_project = f"{project}"
73
- self.load_manager = ConfigManager(f"{project}.ini")
74
72
  try:
75
- self.setting = self.load_manager.load_project()
73
+ setting = load_manager.load_project()
76
74
  except KeyError:
77
- print(colored(f"\nCan't find {chosen_project}.ini", "light_red"))
75
+ print(colored(f"\nCan't find {project}.ini", "light_red"))
78
76
  time.sleep(2)
79
77
  return
80
78
 
81
- self.version_logic = VersionLogic()
82
-
83
- project_ini_path = self.load_manager.projects_folder / f"{chosen_project}.ini"
84
-
85
79
  os.system(self.clear_screen)
86
80
  print("Main menu / Projects / Project menu")
87
81
  print(self.header.center(127, "="))
88
82
  print("E. Back\n")
89
83
  print(colored("Chosen project:", attrs=["underline"]))
90
- print(colored(chosen_project, f"{self.color}"))
84
+ print(colored(project, f"{self.color}"))
91
85
  print("\n1. Open project folder.")
92
86
  print("2. Update the changelog.")
93
87
  print("3. Backup to the cloud. [WIP]")
@@ -99,14 +93,14 @@ class ProjectsManager:
99
93
  return
100
94
 
101
95
  elif choice == "1":
102
- path = self.setting.get('path')
96
+ path = setting.get('path')
103
97
  folder = Path(path)
104
98
  Opener.open(folder)
105
99
 
106
100
  elif choice == "2":
107
- self.version_logic.project_menu(chosen_project)
101
+ version_logic.project_menu(project)
108
102
 
109
- # elif choice == "3":
103
+ #elif choice == "3":
110
104
 
111
105
  elif choice == "4":
112
106
  Opener.open(project_ini_path)
@@ -114,7 +108,7 @@ class ProjectsManager:
114
108
  else:
115
109
  print("")
116
110
  print(colored("Unknown option...", "light_red", attrs=["blink"]))
117
- time.sleep(2)
111
+ time.sleep(1)
118
112
 
119
113
  if __name__ == "__main__":
120
114
  ProjectsManager()
@@ -14,8 +14,8 @@ from da.modules.config_manager import ConfigManager
14
14
  from da.modules.opener import Opener
15
15
 
16
16
  class VersionLogic:
17
- def __init__(self, color="light_blue"):
18
- self.config = ConfigManager('memory.ini')
17
+ def __init__(self, config, color="light_blue"):
18
+ self.config = config
19
19
  self.memory = self.config.load_memory()
20
20
  self.color = self.memory.get('color') or color
21
21
 
@@ -27,9 +27,7 @@ class VersionLogic:
27
27
  def project_menu(self, project):
28
28
  self.active_project = project
29
29
 
30
- self.load_manager = ConfigManager(f"{project}.ini")
31
- self.setting = self.load_manager.load_project()
32
- self.changelog_path = Path(self.setting.get('changelog'))
30
+ load_manager = ConfigManager(f"{project}.ini")
33
31
 
34
32
  now = datetime.now()
35
33
  self.today = now.strftime("%Y-%m-%d")
@@ -38,13 +36,18 @@ class VersionLogic:
38
36
  self.templog_path = ROOT / "CHANGELOG.tmp"
39
37
 
40
38
  while True:
39
+ self.setting = load_manager.load_project()
40
+ self.changelog_path = Path(self.setting.get('changelog'))
41
+ self.prj_ver = self.setting.get('version')
42
+ prj_path = Path(self.setting.get('path'))
43
+
41
44
  os.system(self.clear_screen)
42
45
  print("Main menu / Projects / Project menu / Changelog")
43
46
  print(self.header.center(127, "="))
44
47
  print("E. Back\n")
45
48
  print(colored("Chosen project:", attrs=["underline"]))
46
49
  print(colored(self.active_project, f"{self.color}"))
47
- print("Version: " + colored(self.setting.get('version'), f"{self.color}"))
50
+ print("Version: " + colored(self.prj_ver, f"{self.color}"))
48
51
  print("\n1. Create a new changelog")
49
52
  print("2. Add new changes")
50
53
  print("3. Open the changelog")
@@ -56,10 +59,13 @@ class VersionLogic:
56
59
  return
57
60
 
58
61
  elif choice == "1":
59
- self.create_changelog()
62
+ if not os.path.exists(prj_path):
63
+ print(colored("\nSystem cannot find the path to this project.", "light_red"))
64
+ time.sleep(2)
65
+ else:
66
+ self.create_changelog()
60
67
 
61
68
  elif choice == "2":
62
- #==Check if the file path exists==
63
69
  if not os.path.exists(self.changelog_path):
64
70
  print(colored("\nSystem cannot find the changelog path.", "light_red"))
65
71
  time.sleep(1.5)
@@ -70,7 +76,6 @@ class VersionLogic:
70
76
  Opener.open(self.changelog_path)
71
77
 
72
78
  elif choice == "4":
73
- #==Check if the file path exists==
74
79
  if not os.path.exists(self.changelog_path):
75
80
  print(colored("\nSystem cannot find the changelog path.", "light_red"))
76
81
  time.sleep(1.5)
@@ -80,14 +85,18 @@ class VersionLogic:
80
85
  else:
81
86
  print("")
82
87
  print(colored("Unknown option...", "light_red", attrs=["blink"]))
83
- time.sleep(2)
88
+ time.sleep(1)
84
89
 
85
90
  def create_changelog(self):
86
91
  os.system(self.clear_screen)
87
92
  print(self.header.center(127, "="))
88
93
  print("E. Back/abort\n")
89
94
 
90
- version = input("Version: ")
95
+ if os.path.exists(self.changelog_path):
96
+ print(colored("This action will overwrite your existing changelog!\n", "yellow"))
97
+ input("Acknowledge..." + colored("[Enter]", f"{self.color}"))
98
+
99
+ version = input("\nVersion: ")
91
100
  if version.lower() == "e":
92
101
  return
93
102
  change_type = input("\nChange type: ")
@@ -112,9 +121,16 @@ class VersionLogic:
112
121
 
113
122
  rendered = self.template_renderer(template, data)
114
123
 
115
- mode = "a" if os.path.exists(self.changelog_path) else "w"
116
- with open(self.changelog_path, mode, encoding="utf-8") as f:
124
+ with open(self.changelog_path, "w", encoding="utf-8") as f:
117
125
  f.write(rendered + "\n")
126
+
127
+ new_config = ConfigManager(f"{self.active_project}.ini")
128
+ new_config.update_project("version", version)
129
+
130
+ last_project = self.memory.get('last_project')
131
+ if last_project != self.active_project:
132
+ self.config.update_memory("ITEMS", "last_project", self.active_project)
133
+
118
134
  return
119
135
 
120
136
  def update_changelog(self):
@@ -128,7 +144,11 @@ class VersionLogic:
128
144
  print("E. Back/abort")
129
145
  print("O. Open templog for fixes.")
130
146
  print("S. Review changes & save\n")
131
- print("Version: " + colored(self.setting.get('version'), f"{self.color}"))
147
+
148
+ print(colored("Chosen project:", attrs=["underline"]))
149
+ print(colored(self.active_project, f"{self.color}"))
150
+ print("Version: " + colored(self.prj_ver, f"{self.color}"))
151
+
132
152
  print(colored("\nChoose the change type:", f"{self.color}"))
133
153
  print("1. Added")
134
154
  print("2. Removed")
@@ -172,7 +192,7 @@ class VersionLogic:
172
192
  else:
173
193
  print("")
174
194
  print(colored("Unknown option...", "light_red", attrs=["blink"]))
175
- time.sleep(2)
195
+ time.sleep(1)
176
196
 
177
197
  def prepend_changes(self):
178
198
  header = f"### {self.change_type}"
@@ -222,19 +242,20 @@ class VersionLogic:
222
242
  if os.path.exists(self.templog_path):
223
243
  with open(self.templog_path, "r", encoding="utf-8") as f:
224
244
  templog_content = f.read()
225
- print(colored(f"[version] - {self.today}\n", "magenta", attrs=["underline"]))
245
+ print(colored(f"[New version] - {self.today}\n", "magenta", attrs=["underline"]))
226
246
  MARKDOWN = templog_content
227
247
  console = Console()
228
248
  md = Markdown(MARKDOWN)
229
249
  console.print(md)
230
250
  else:
231
251
  print(colored("No changes added.", "light_red"))
232
- time.sleep(2)
252
+ time.sleep(1)
233
253
  return
234
254
  choice = input("\nContinue" + colored("[Enter]", f"{self.color}") + " or go back" + colored("[E] ", f"{self.color}"))
235
255
  if choice.lower() == "e":
236
256
  return
237
257
 
258
+ print("\nCurrent version: " + colored(self.prj_ver, f"{self.color}"))
238
259
  version = input("\nNew version number: ").strip()
239
260
 
240
261
  print("\nWorking...")
@@ -270,9 +291,8 @@ class VersionLogic:
270
291
 
271
292
  os.remove(self.templog_path)
272
293
 
273
- #==Update ini files==
274
- config = ConfigManager(f"{self.active_project}.ini")
275
- config.update_project("version", version)
294
+ new_config = ConfigManager(f"{self.active_project}.ini")
295
+ new_config.update_project("version", version)
276
296
 
277
297
  last_project = self.memory.get('last_project')
278
298
  if last_project != self.active_project:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: developer-assistant
3
- Version: 0.2.1
3
+ Version: 0.2.5
4
4
  Summary: A lightweight TUI designed to simplify formatting of Markdown changelogs.
5
5
  License: The MIT License (MIT)
6
6
 
@@ -42,6 +42,10 @@ Dynamic: license-file
42
42
 
43
43
  > **Tip:** Once setup is complete and you start the program, an intro with all the necessary information will be displayed for you in the terminal.
44
44
 
45
+ > **Linux note:**
46
+ > Avoid using `sudo pip install` because it installs into the system Python.
47
+ If you want a system‑wide install, use the uv method or use `pip install --user`
48
+
45
49
  ## Updating DA
46
50
  Two possibilities, depending on how you installed.
47
51
 
@@ -68,11 +72,11 @@ Don't change the folder structure or modify variable names inside `.ini` files.
68
72
 
69
73
  **The user's data (`Templates/`, `Projects/`, `memory.ini`) is stored in standard locations:**
70
74
 
71
- Windows: `C:\Users\...\AppData\Roaming\da-ui\`
75
+ * Windows: `C:\Users\...\AppData\Roaming\da-ui\`
72
76
 
73
- Linux: `~/.config/da-ui/`
77
+ * Linux: `~/.config/da-ui/`
74
78
 
75
- macOS: `~/Library/Application Support/da-ui/`
79
+ * macOS: `~/Library/Application Support/da-ui/`
76
80
 
77
81
  The `da-ui/` folder will be created automatically.
78
82
 
@@ -101,19 +105,19 @@ You can access files/folders and configuration straight from the menus, so you s
101
105
 
102
106
  The `memory.ini` file does exactly what you'd expect, it features:
103
107
 
104
- > Last project
108
+ * Last project
105
109
 
106
- > Pinned projects
110
+ * Pinned projects
107
111
 
108
- > Custom colour
112
+ * Custom colour
109
113
 
110
114
  Last project gets updated automatically, the rest are up to you.
111
115
 
112
116
  - *`Ctrl+C` works everywhere to quickly exit DA.*
113
117
 
114
118
  ### Setting up your first project
115
- For a dummy changelog to experiment with, navigate to `Main menu / Projects`, choose `Test-Project`, then choose option `4.` to start adjusting this projects paths.
119
+ For a dummy changelog to experiment with, navigate to `Main menu / Projects`, choose `test-project`, then choose option `4.` to start adjusting this projects paths.
116
120
 
117
- Now make an optional `Test-Project/` folder with a `CHANGELOG.md` in it anywhere on your system and point the `.ini` file to it.
121
+ Now make an optional `test-project/` folder with a `CHANGELOG.md` in it anywhere on your system and point the `.ini` file to it.
118
122
 
119
123
  Once configured, you can create as many changelog entries as you want by picking that project in the menu.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "developer-assistant"
3
- version = "0.2.1"
3
+ version = "0.2.5"
4
4
  description = "A lightweight TUI designed to simplify formatting of Markdown changelogs."
5
5
  readme = "PYPI.md"
6
6
  requires-python = ">=3.10"
@@ -1,5 +0,0 @@
1
- [SETTINGS]
2
- path = C:\Users\...\Developer-Assistant\Test-Project
3
- changelog = C:\Users\...\Developer-Assistant\Test-Project\CHANGELOG.md
4
- version = 1.0.0
5
- cloud =