developer-assistant 0.3.0__tar.gz → 0.3.6__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.3.0/developer_assistant.egg-info → developer_assistant-0.3.6}/PKG-INFO +41 -21
  2. {developer_assistant-0.3.0 → developer_assistant-0.3.6}/PYPI.md +39 -8
  3. {developer_assistant-0.3.0 → developer_assistant-0.3.6}/README.md +48 -13
  4. {developer_assistant-0.3.0 → developer_assistant-0.3.6}/da/default/test-project.ini +3 -1
  5. {developer_assistant-0.3.0 → developer_assistant-0.3.6}/da/interface.py +77 -46
  6. {developer_assistant-0.3.0 → developer_assistant-0.3.6}/da/intro.md +22 -3
  7. {developer_assistant-0.3.0 → developer_assistant-0.3.6}/da/modules/config_manager.py +25 -10
  8. {developer_assistant-0.3.0 → developer_assistant-0.3.6}/da/modules/opener.py +1 -3
  9. {developer_assistant-0.3.0 → developer_assistant-0.3.6}/da/modules/projects_manager.py +32 -30
  10. {developer_assistant-0.3.0 → developer_assistant-0.3.6}/da/modules/version_logic.py +100 -90
  11. developer_assistant-0.3.6/da/templates/changelog_template.txt +5 -0
  12. {developer_assistant-0.3.0 → developer_assistant-0.3.6/developer_assistant.egg-info}/PKG-INFO +41 -21
  13. {developer_assistant-0.3.0 → developer_assistant-0.3.6}/pyproject.toml +2 -5
  14. developer_assistant-0.3.0/da/templates/changelog_template.txt +0 -6
  15. {developer_assistant-0.3.0 → developer_assistant-0.3.6}/LICENSE +0 -0
  16. {developer_assistant-0.3.0 → developer_assistant-0.3.6}/da/__init__.py +0 -0
  17. {developer_assistant-0.3.0 → developer_assistant-0.3.6}/da/default/default-changelog.md +0 -0
  18. {developer_assistant-0.3.0 → developer_assistant-0.3.6}/da/default/default-memory.ini +0 -0
  19. {developer_assistant-0.3.0 → developer_assistant-0.3.6}/da/modules/__init__.py +0 -0
  20. {developer_assistant-0.3.0 → developer_assistant-0.3.6}/da/templates/entry_template.txt +0 -0
  21. {developer_assistant-0.3.0 → developer_assistant-0.3.6}/da/templates/header_template.txt +0 -0
  22. {developer_assistant-0.3.0 → developer_assistant-0.3.6}/developer_assistant.egg-info/SOURCES.txt +0 -0
  23. {developer_assistant-0.3.0 → developer_assistant-0.3.6}/developer_assistant.egg-info/dependency_links.txt +0 -0
  24. {developer_assistant-0.3.0 → developer_assistant-0.3.6}/developer_assistant.egg-info/entry_points.txt +0 -0
  25. {developer_assistant-0.3.0 → developer_assistant-0.3.6}/developer_assistant.egg-info/requires.txt +0 -0
  26. {developer_assistant-0.3.0 → developer_assistant-0.3.6}/developer_assistant.egg-info/top_level.txt +0 -0
  27. {developer_assistant-0.3.0 → developer_assistant-0.3.6}/setup.cfg +0 -0
@@ -1,22 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: developer-assistant
3
- Version: 0.3.0
3
+ Version: 0.3.6
4
4
  Summary: A lightweight TUI app for managing and simplifying your Markdown changelogs.
5
- License: The MIT License (MIT)
6
-
7
- Copyright (c) 2026 Ivori Huobolainen
8
-
9
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5
+ License-Expression: MIT
14
6
  Project-URL: Homepage, https://github.com/Ivory-Hubert/Developer-Assistant
15
- Project-URL: Repository, https://github.com/Ivory-Hubert/Developer-Assistant.git
16
- Project-URL: Issues, https://github.com/Ivory-Hubert/Developer-Assistant/issues
17
7
  Project-URL: Changelog, https://github.com/Ivory-Hubert/Developer-Assistant/blob/main/CHANGELOG.md
18
8
  Classifier: Programming Language :: Python :: 3
19
- Classifier: License :: OSI Approved :: MIT License
20
9
  Classifier: Operating System :: OS Independent
21
10
  Classifier: Environment :: Console
22
11
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
@@ -32,6 +21,9 @@ Dynamic: license-file
32
21
  # Developer Assistant
33
22
 
34
23
  ## Installing from PyPI
24
+
25
+ The program is designed for minimal friction and simple setup. Only installation is required, on first run DA will create local user data automatically. The same automatic process is used for creating new profiles.
26
+
35
27
  **Using uv:**
36
28
  `uv tool install developer-assistant`
37
29
 
@@ -46,6 +38,8 @@ Dynamic: license-file
46
38
  > Avoid using `sudo pip install` because it installs into the system Python.
47
39
  If you want a system‑wide install, use the uv method or use `pip install --user`
48
40
 
41
+ ---
42
+
49
43
  ## Updating DA
50
44
  Two possibilities, depending on how you installed.
51
45
 
@@ -53,17 +47,21 @@ A. **Using uv:** `uv tool upgrade developer-assistant`
53
47
 
54
48
  B. **Using pip:** `python -m pip install -U developer-assistant`
55
49
 
50
+
56
51
  ## Introduction
57
52
 
58
- ### What does this tool do?
59
- Developer Assistant is a lightweight TUI app for simplifying and managing your changelogs. You can customize the templates for each profile to match your existing format, and use DA as a central hub to access every changelog and project folder you maintain.
53
+ ### What does this program do?
54
+ Developer Assistant is a lightweight TUI for simplifying and managing your changelogs. You can customize the templates for **each profile** to match your existing format, and use DA as a central hub to access every changelog and project folder you maintain.
55
+
56
+ You can create as many profiles as you need. Each profile gets its own **project specific** `.ini` files, created automatically through the menu based on the information you provide. These act as links that tell DA where your changelogs are, which profile owns them and what's the last version number.
60
57
 
61
- You can create as many profiles as you need. Each profile gets its own **project specific** `.ini` files, created automatically through the menu based on the information you provide. These act as links that tell DA where your changelogs are and what's the last version number.
58
+ Each project `.ini` can also hold a custom terminal command, that is run in that projects folder. So you can easly integrate updating your changelogs in DA with Git commands for example.
62
59
 
63
- Your files are kept safe at all times. Before adding new changes, your existing `CHANGELOG.md` is automatically backed up. While editing, all changes are written to a temporary file first and only prepended to & replaced with your real changelog once you confirm them.
60
+ **Your files are kept safe at all times.** Before adding new changes, your existing `CHANGELOG.md` is automatically backed up. While editing, all changes are written to a temporary file first and only prepended to & replaced with your real changelog once you confirm them.
64
61
 
62
+ ---
65
63
 
66
- ## Using the program.
64
+ ### Using the program.
67
65
  1. **What *not* to do**
68
66
 
69
67
  Don't change the folder structure or modify variable names inside `.ini` files.
@@ -80,22 +78,41 @@ Don't change the folder structure or modify variable names inside `.ini` files.
80
78
 
81
79
  The `da-ui/` folder and subfolders will be created automatically.
82
80
 
83
- You can access its content quickly when going to: `Main menu / Settings`
81
+ > **Tip:** You can access its content quickly when going to: `Main menu / Settings`
84
82
 
85
83
  **Profiles for seperate projects and templates**
86
84
 
87
85
  The program comes with the "Default" profile, you can choose to either stick with this one or create your own profiles in `Main menu / Profiles`. Each profile has seperate projects and they can't be accessed by other profiles. You can choose to customize the templates seperately too.
88
86
 
89
- Migrating a project or template from one profile to another is currently manual, **make sure to also change the "*owner*" value in `.ini` files accordingly**.
87
+ > **Note:** Migrating a project or template from one profile to another is currently manual, **make sure to also change the "*owner*" value in `.ini` files accordingly**.
88
+
89
+ ---
90
90
 
91
91
  **Customizable templates**
92
92
 
93
93
  In the **local** `Templates/` folder you can modify the template contents to your liking - **just avoid changing the `{{placeholder}}` names**.
94
94
 
95
+ Templates come in three flavours:
96
+
97
+ * changelog_template.txt - *Changelog title*
98
+
99
+ * header_template.txt - *Version and date*
100
+
101
+ * entry_template.txt - *Change entry and comments*
102
+
103
+
95
104
  **Linked projects all in one place**
96
105
 
97
106
  The `Projects/` folder holds the `.ini` files you create when starting a new project with DA.
98
107
 
108
+ [Project.ini example](./documents/project-example.ini)
109
+
110
+ The `command` variable is a custom command that DA will run in your project folder once you choose "Format & commit" in `Main menu / Projects / Project menu / Changelog`. Even when provided, it is **not** run without your confirmation, first it's printed with the folder name and you can choose to skip it.
111
+
112
+ `owner` & `edited` are filled out automatically when a new project is created and `edited` updates with every changelog update.
113
+
114
+ ---
115
+
99
116
  **Safe changelog updates**
100
117
 
101
118
  Before applying any changes, your previous `CHANGELOG.md` is automatically backed up into your project folder.
@@ -104,10 +121,12 @@ New changes are first written to a temporary file and only prepended to & replac
104
121
  This ensures your existing changelog is never overwritten or corrupted, and you always have a fallback copy.
105
122
  If the temporary changelog is present on startup you are prompted to remove or keep it.
106
123
 
124
+
107
125
  **Ease of navigation**
108
126
 
109
127
  You can access files/folders and configuration straight from the menus, so you shouldn't find yourself searching through the program's directory or even your local user data very often.
110
128
 
129
+
111
130
  **Configuration**
112
131
 
113
132
  The `memory.ini` file does exactly what you'd expect, it features:
@@ -122,8 +141,9 @@ The `memory.ini` file does exactly what you'd expect, it features:
122
141
 
123
142
  Last project & active profile get updated automatically, the rest are up to you.
124
143
 
125
- **`Ctrl+C` works everywhere to quickly exit DA.**
144
+ > **Tip:** `Ctrl+C` works everywhere to quickly exit DA.
126
145
 
146
+ ---
127
147
 
128
148
  ### Setting up the test project
129
149
  For a dummy changelog to experiment with, navigate to `Main menu / Projects`, choose `test-project`, then choose option `3.` to start adjusting this projects paths. **Before setting up your own profile don't change "*Default*"**
@@ -1,6 +1,9 @@
1
1
  # Developer Assistant
2
2
 
3
3
  ## Installing from PyPI
4
+
5
+ The program is designed for minimal friction and simple setup. Only installation is required, on first run DA will create local user data automatically. The same automatic process is used for creating new profiles.
6
+
4
7
  **Using uv:**
5
8
  `uv tool install developer-assistant`
6
9
 
@@ -15,6 +18,8 @@
15
18
  > Avoid using `sudo pip install` because it installs into the system Python.
16
19
  If you want a system‑wide install, use the uv method or use `pip install --user`
17
20
 
21
+ ---
22
+
18
23
  ## Updating DA
19
24
  Two possibilities, depending on how you installed.
20
25
 
@@ -22,17 +27,21 @@ A. **Using uv:** `uv tool upgrade developer-assistant`
22
27
 
23
28
  B. **Using pip:** `python -m pip install -U developer-assistant`
24
29
 
30
+
25
31
  ## Introduction
26
32
 
27
- ### What does this tool do?
28
- Developer Assistant is a lightweight TUI app for simplifying and managing your changelogs. You can customize the templates for each profile to match your existing format, and use DA as a central hub to access every changelog and project folder you maintain.
33
+ ### What does this program do?
34
+ Developer Assistant is a lightweight TUI for simplifying and managing your changelogs. You can customize the templates for **each profile** to match your existing format, and use DA as a central hub to access every changelog and project folder you maintain.
35
+
36
+ You can create as many profiles as you need. Each profile gets its own **project specific** `.ini` files, created automatically through the menu based on the information you provide. These act as links that tell DA where your changelogs are, which profile owns them and what's the last version number.
29
37
 
30
- You can create as many profiles as you need. Each profile gets its own **project specific** `.ini` files, created automatically through the menu based on the information you provide. These act as links that tell DA where your changelogs are and what's the last version number.
38
+ Each project `.ini` can also hold a custom terminal command, that is run in that projects folder. So you can easly integrate updating your changelogs in DA with Git commands for example.
31
39
 
32
- Your files are kept safe at all times. Before adding new changes, your existing `CHANGELOG.md` is automatically backed up. While editing, all changes are written to a temporary file first and only prepended to & replaced with your real changelog once you confirm them.
40
+ **Your files are kept safe at all times.** Before adding new changes, your existing `CHANGELOG.md` is automatically backed up. While editing, all changes are written to a temporary file first and only prepended to & replaced with your real changelog once you confirm them.
33
41
 
42
+ ---
34
43
 
35
- ## Using the program.
44
+ ### Using the program.
36
45
  1. **What *not* to do**
37
46
 
38
47
  Don't change the folder structure or modify variable names inside `.ini` files.
@@ -49,22 +58,41 @@ Don't change the folder structure or modify variable names inside `.ini` files.
49
58
 
50
59
  The `da-ui/` folder and subfolders will be created automatically.
51
60
 
52
- You can access its content quickly when going to: `Main menu / Settings`
61
+ > **Tip:** You can access its content quickly when going to: `Main menu / Settings`
53
62
 
54
63
  **Profiles for seperate projects and templates**
55
64
 
56
65
  The program comes with the "Default" profile, you can choose to either stick with this one or create your own profiles in `Main menu / Profiles`. Each profile has seperate projects and they can't be accessed by other profiles. You can choose to customize the templates seperately too.
57
66
 
58
- Migrating a project or template from one profile to another is currently manual, **make sure to also change the "*owner*" value in `.ini` files accordingly**.
67
+ > **Note:** Migrating a project or template from one profile to another is currently manual, **make sure to also change the "*owner*" value in `.ini` files accordingly**.
68
+
69
+ ---
59
70
 
60
71
  **Customizable templates**
61
72
 
62
73
  In the **local** `Templates/` folder you can modify the template contents to your liking - **just avoid changing the `{{placeholder}}` names**.
63
74
 
75
+ Templates come in three flavours:
76
+
77
+ * changelog_template.txt - *Changelog title*
78
+
79
+ * header_template.txt - *Version and date*
80
+
81
+ * entry_template.txt - *Change entry and comments*
82
+
83
+
64
84
  **Linked projects all in one place**
65
85
 
66
86
  The `Projects/` folder holds the `.ini` files you create when starting a new project with DA.
67
87
 
88
+ [Project.ini example](./documents/project-example.ini)
89
+
90
+ The `command` variable is a custom command that DA will run in your project folder once you choose "Format & commit" in `Main menu / Projects / Project menu / Changelog`. Even when provided, it is **not** run without your confirmation, first it's printed with the folder name and you can choose to skip it.
91
+
92
+ `owner` & `edited` are filled out automatically when a new project is created and `edited` updates with every changelog update.
93
+
94
+ ---
95
+
68
96
  **Safe changelog updates**
69
97
 
70
98
  Before applying any changes, your previous `CHANGELOG.md` is automatically backed up into your project folder.
@@ -73,10 +101,12 @@ New changes are first written to a temporary file and only prepended to & replac
73
101
  This ensures your existing changelog is never overwritten or corrupted, and you always have a fallback copy.
74
102
  If the temporary changelog is present on startup you are prompted to remove or keep it.
75
103
 
104
+
76
105
  **Ease of navigation**
77
106
 
78
107
  You can access files/folders and configuration straight from the menus, so you shouldn't find yourself searching through the program's directory or even your local user data very often.
79
108
 
109
+
80
110
  **Configuration**
81
111
 
82
112
  The `memory.ini` file does exactly what you'd expect, it features:
@@ -91,8 +121,9 @@ The `memory.ini` file does exactly what you'd expect, it features:
91
121
 
92
122
  Last project & active profile get updated automatically, the rest are up to you.
93
123
 
94
- **`Ctrl+C` works everywhere to quickly exit DA.**
124
+ > **Tip:** `Ctrl+C` works everywhere to quickly exit DA.
95
125
 
126
+ ---
96
127
 
97
128
  ### Setting up the test project
98
129
  For a dummy changelog to experiment with, navigate to `Main menu / Projects`, choose `test-project`, then choose option `3.` to start adjusting this projects paths. **Before setting up your own profile don't change "*Default*"**
@@ -3,9 +3,11 @@
3
3
 
4
4
  > **A lightweight TUI app for managing and simplifying your Markdown changelogs.**
5
5
 
6
- * **Setup:** Start with [SETUP](./SETUP.md) to get started.
6
+ > `pip install developer-assistant`
7
7
 
8
- * **Changes:** Yes, I keep a [CHANGELOG](./CHANGELOG.md)
8
+ * **Installation:** more options in [SETUP](./SETUP.md)
9
+
10
+ * **Changes:** yes, I keep a [CHANGELOG](./CHANGELOG.md)
9
11
 
10
12
  ---
11
13
 
@@ -19,6 +21,8 @@
19
21
  ## Appearance
20
22
 
21
23
  ### Coloured, easy-to-use menus
24
+ A comfortable interface with a modern polish, built the good old way:
25
+
22
26
  ![Changelog Menu](documents/images/changelog-menu.png)
23
27
 
24
28
  ### Beautiful changelog previews
@@ -29,12 +33,14 @@ Preview your Markdown changelogs directly in the terminal with Rich rendering:
29
33
 
30
34
  ## Introduction
31
35
 
32
- ### What does this tool do?
33
- Developer Assistant is a lightweight TUI for simplifying and managing your changelogs. You can customize the templates for each profile to match your existing format, and use DA as a central hub to access every changelog and project folder you maintain.
36
+ ### What does this program do?
37
+ Developer Assistant is a lightweight TUI for simplifying and managing your changelogs. You can customize the templates for **each profile** to match your existing format, and use DA as a central hub to access every changelog and project folder you maintain.
38
+
39
+ You can create as many profiles as you need. Each profile gets its own **project specific** `.ini` files, created automatically through the menu based on the information you provide. These act as links that tell DA where your changelogs are, which profile owns them and what's the last version number.
34
40
 
35
- You can create as many profiles as you need. Each profile gets its own **project specific** `.ini` files, created automatically through the menu based on the information you provide. These act as links that tell DA where your changelogs are and what's the last version number.
41
+ Each project `.ini` can also hold a custom terminal command, that is run in that projects folder. So you can easly integrate updating your changelogs in DA with Git commands for example.
36
42
 
37
- Your files are kept safe at all times. Before adding new changes, your existing `CHANGELOG.md` is automatically backed up. While editing, all changes are written to a temporary file first and only prepended to & replaced with your real changelog once you confirm them.
43
+ **Your files are kept safe at all times.** Before adding new changes, your existing `CHANGELOG.md` is automatically backed up. While editing, all changes are written to a temporary file first and only prepended to & replaced with your real changelog once you confirm them.
38
44
 
39
45
  ---
40
46
 
@@ -55,22 +61,43 @@ Don't change the folder structure or modify variable names inside `.ini` files.
55
61
 
56
62
  The `da-ui/` folder and subfolders will be created automatically.
57
63
 
58
- You can access its content quickly when going to: `Main menu / Settings`
64
+ > [!TIP]
65
+ > You can access its contents quickly when going to: `Main menu / Settings`
59
66
 
60
67
  **Profiles for seperate projects and templates**
61
68
 
62
69
  The program comes with the "Default" profile, you can choose to either stick with this one or create your own profiles in `Main menu / Profiles`. Each profile has seperate projects and they can't be accessed by other profiles. You can choose to customize the templates seperately too.
63
70
 
64
- Migrating a project or template from one profile to another is currently manual, **make sure to also change the "*owner*" value in `.ini` files accordingly**.
71
+ > [!NOTE]
72
+ > Migrating a project or template from one profile to another is currently manual, **make sure to also change the "*owner*" value in `.ini` files accordingly**.
73
+
74
+ ---
65
75
 
66
76
  **Customizable templates**
67
77
 
68
78
  In the **local** `Templates/` folder you can modify the template contents to your liking - **just avoid changing the `{{placeholder}}` names**.
69
79
 
80
+ Templates come in three flavours:
81
+
82
+ * changelog_template.txt - *Changelog title*
83
+
84
+ * header_template.txt - *Version and date*
85
+
86
+ * entry_template.txt - *Change entry and comments*
87
+
88
+
70
89
  **Linked projects all in one place**
71
90
 
72
91
  The `Projects/` folder holds the `.ini` files you create when starting a new project with DA.
73
92
 
93
+ [Project.ini example](./documents/project-example.ini)
94
+
95
+ The `command` variable is a custom command that DA will run in your project folder once you choose "Format & commit" in `Main menu / Projects / Project menu / Changelog`. Even if provided, it is **not** run without your confirmation, first it's printed with the folder name and you can choose to skip it.
96
+
97
+ `owner` & `edited` are filled out automatically when a new project is created and `edited` updates with every changelog update.
98
+
99
+ ---
100
+
74
101
  **Safe changelog updates**
75
102
 
76
103
  Before applying any changes, your previous `CHANGELOG.md` is automatically backed up into your project folder.
@@ -79,10 +106,12 @@ New changes are first written to a temporary file and only prepended to & replac
79
106
  This ensures your existing changelog is never overwritten or corrupted, and you always have a fallback copy.
80
107
  If the temporary changelog is present on startup you are prompted to remove or keep it.
81
108
 
109
+
82
110
  **Ease of navigation**
83
111
 
84
112
  You can access files/folders and configuration straight from the menus, so you shouldn't find yourself searching through the program's directory or even your local user data very often.
85
113
 
114
+
86
115
  **Configuration**
87
116
 
88
117
  The `memory.ini` file does exactly what you'd expect, it features:
@@ -97,7 +126,8 @@ The `memory.ini` file does exactly what you'd expect, it features:
97
126
 
98
127
  Last project & active profile get updated automatically, the rest are up to you.
99
128
 
100
- **`Ctrl+C` works everywhere to quickly exit DA.**
129
+ > [!TIP]
130
+ > **`Ctrl+C` works everywhere to quickly exit DA.**
101
131
 
102
132
  ---
103
133
 
@@ -113,10 +143,15 @@ Once configured, you can create as many changelog entries as you want by picking
113
143
  Two possibilities, depending on how you installed.
114
144
 
115
145
  ### 1. Installed from PyPI
116
- A. **Using uv:** `uv tool upgrade developer-assistant`
117
-
118
- B. **Using pip:** `python -m pip install -U developer-assistant`
119
-
146
+ A. **Using uv:**
147
+ ```bash
148
+ uv tool upgrade developer-assistant
149
+ ```
150
+
151
+ B. **Using pip:**
152
+ ```bash
153
+ python -m pip install -U developer-assistant
154
+ ```
120
155
 
121
156
  ### 2. Installed from a local clone
122
157
  *Run all terminal commands in the repo folder*
@@ -3,5 +3,7 @@ edited =
3
3
  owner = Default
4
4
  path = C:\Users\...\Developer-Assistant\test-project
5
5
  changelog = C:\Users\...\Developer-Assistant\test-project\CHANGELOG.md
6
- version = 1.0.0
6
+ version = 1.0.0
7
+ command = git add CHANGELOG.md
8
+ ;; the command could be anything, DA will run it in your project folder if you add it (runs in "Format & commit")
7
9
  cloud =
@@ -17,7 +17,7 @@ from importlib import resources
17
17
 
18
18
  class Interface:
19
19
  def __init__(self):
20
- self.version = "0.3.0"
20
+ self.version = "0.3.6"
21
21
  self.clear = 'cls' if platform.system() == 'Windows' else 'clear'
22
22
 
23
23
  title = f"DA - {self.version}"
@@ -50,14 +50,14 @@ class Interface:
50
50
  if isinstance(result, list):
51
51
  for msg in result:
52
52
  print(msg.center(65))
53
- time.sleep(2)
53
+ time.sleep(1)
54
54
 
55
55
  temp_log = Path(__file__).parent / "CHANGELOG.tmp"
56
56
 
57
57
  if os.path.exists(temp_log):
58
58
  while True:
59
59
  os.system(self.clear)
60
- print(colored(f"Temporary changelog detected in:\n{temp_log}\n", "yellow"))
60
+ print(colored(f"Temporary changelog detected from your last session!\n", "yellow"))
61
61
  print(colored("D", "light_red") + "elete or " + colored("K", "light_red") + "eep?\n")
62
62
  choice = input(f"{self.user_path}> ").lower()
63
63
  if choice == "d":
@@ -67,7 +67,7 @@ class Interface:
67
67
  break
68
68
  else:
69
69
  print(colored("\nPlease make a valid choice.", "light_red"))
70
- time.sleep(1.5)
70
+ time.sleep(0.5)
71
71
 
72
72
  state = "intro" if self.first_run else "menu"
73
73
 
@@ -104,7 +104,7 @@ class Interface:
104
104
  while True:
105
105
  os.system(self.clear)
106
106
  print(colored(f"{self.active_profile}", f"{self.color}") + " / Main menu")
107
- print(self.header.center(127, "="))
107
+ print(self.header)
108
108
  print("E. Exit\n")
109
109
  print("Last project:")
110
110
  print(colored(last_project, f"{self.color}"))
@@ -116,7 +116,7 @@ class Interface:
116
116
 
117
117
  if choice.lower() == "e":
118
118
  os.system(self.clear)
119
- print(self.header.center(127, "="))
119
+ print(self.header)
120
120
  print("Bye!")
121
121
  time.sleep(1)
122
122
  return "exit"
@@ -131,14 +131,14 @@ class Interface:
131
131
  return "settings"
132
132
  else:
133
133
  print("")
134
- print(colored("Unknown option...", "light_red", attrs=["blink"]))
135
- time.sleep(1)
134
+ print(colored("Unknown option...", "light_red", attrs=["bold"]))
135
+ time.sleep(0.5)
136
136
 
137
137
  def settings(self):
138
138
  while True:
139
139
  os.system(self.clear)
140
140
  print(colored(f"{self.active_profile}", f"{self.color}") + " / Main menu / Settings")
141
- print(self.header.center(127, "="))
141
+ print(self.header)
142
142
  print("E. Back\n")
143
143
 
144
144
  print(colored("Configuration options", attrs=["underline"]))
@@ -166,58 +166,53 @@ class Interface:
166
166
  Opener.open(self.config.templates_folder)
167
167
  else:
168
168
  print("")
169
- print(colored("Unknown option...", "light_red", attrs=["blink"]))
170
- time.sleep(1)
169
+ print(colored("Unknown option...", "light_red", attrs=["bold"]))
170
+ time.sleep(0.5)
171
171
 
172
172
  def profiles(self):
173
173
  while True:
174
174
  os.system(self.clear)
175
175
  print(colored(f"{self.active_profile}", f"{self.color}") + " / Main menu / Profiles")
176
- print(self.header.center(127, "="))
176
+ print(self.header)
177
177
  print("E. Back\n")
178
178
 
179
- print("1. Create a new profile")
180
- print("2. Switch profiles\n")
179
+ print("1. Switch profiles\n")
180
+
181
+ print("2. Create a new profile")
182
+ print("3. Delete a profile\n")
181
183
 
182
184
  choice = input(f"{self.user_path}> ").strip()
183
185
 
184
186
  if choice.lower() == "e":
185
187
  return
186
188
  elif choice == "1":
187
- self.new_profile()
188
- elif choice == "2":
189
189
  self.switch_profile()
190
+ elif choice == "2":
191
+ self.new_profile()
192
+ elif choice == "3":
193
+ self.delete_profile()
190
194
  else:
191
195
  print("")
192
- print(colored("Unknown option...", "light_red", attrs=["blink"]))
193
- time.sleep(1)
196
+ print(colored("Unknown option...", "light_red", attrs=["bold"]))
197
+ time.sleep(0.5)
194
198
 
195
199
  def switch_profile(self):
196
- while True:
197
- prof_dir = self.config.profile_dir
198
- contents = os.listdir(prof_dir)
199
-
200
- print("\nYour profiles:")
201
- for item in contents:
202
- print(colored(f" - {item}", f"{self.color}"))
203
-
204
- name = input("\nProfile name > ").strip()
205
-
206
- if name in contents:
207
- self.config.update_memory("CONFIG", "profile", name)
200
+ prof_dir = self.config.profile_dir
201
+ contents = os.listdir(prof_dir)
208
202
 
209
- self.memory = self.config.load_memory()
203
+ print("\nYour profiles:")
204
+ for item in contents:
205
+ print(" -" + colored(f" {item}", f"{self.color}"))
210
206
 
211
- profile = self.memory.get('profile')
212
- self.config = ConfigManager("memory.ini", profile=profile)
207
+ name = input("\nProfile name > ").strip()
213
208
 
214
- self.memory = self.config.load_memory()
215
- self.active_profile = self.memory.get('profile')
216
- return
217
- else:
218
- print(colored("\nInvalid name!", "yellow"))
219
- time.sleep(1)
220
- os.system(self.clear)
209
+ if name in contents:
210
+ self.load_profile(name)
211
+ return
212
+ else:
213
+ print(colored("\nInvalid name!", "yellow"))
214
+ time.sleep(0.5)
215
+ os.system(self.clear)
221
216
 
222
217
  def new_profile(self):
223
218
  name = input("\nNew profile name > ").strip()
@@ -233,6 +228,33 @@ class Interface:
233
228
  dest = profile_dir / "Templates"
234
229
  shutil.copy(item, dest)
235
230
 
231
+ self.load_profile(name)
232
+ return
233
+
234
+ def delete_profile(self):
235
+ prof_dir = self.config.profile_dir
236
+ contents = os.listdir(prof_dir)
237
+
238
+ print("\nYour profiles:")
239
+ for item in contents:
240
+ print(" -" + colored(f" {item}", f"{self.color}"))
241
+
242
+ name = input("\nProfile name > ").strip()
243
+
244
+ if name in contents and name != "Default":
245
+ profiles = self.config.profile_dir
246
+ profile = profiles / name
247
+ shutil.rmtree(profile)
248
+
249
+ if name == self.active_profile:
250
+ self.load_profile(name="Default")
251
+ return
252
+ else:
253
+ print(colored("\nInvalid name!", "yellow"))
254
+ time.sleep(0.5)
255
+ os.system(self.clear)
256
+
257
+ def load_profile(self, name):
236
258
  self.config.update_memory("CONFIG", "profile", name)
237
259
 
238
260
  self.memory = self.config.load_memory()
@@ -242,7 +264,6 @@ class Interface:
242
264
 
243
265
  self.memory = self.config.load_memory()
244
266
  self.active_profile = self.memory.get('profile')
245
- return
246
267
 
247
268
  def runtime_init(self):
248
269
  if not self.config.memory_ini.exists():
@@ -256,10 +277,19 @@ class Interface:
256
277
  self.memory = self.config.load_memory()
257
278
 
258
279
  self.color = self.memory.get('color') or "light_blue"
259
- self.header = (colored(" Developer Assistant ", f"{self.color}"))
260
280
  self.user_path = os.environ.get('USERPROFILE') or os.environ.get('HOME', 'User')
261
281
 
282
+ brand = (colored(" Developer Assistant ", f"{self.color}"))
283
+ text = " Developer Assistant "
284
+
285
+ columns, _ = shutil.get_terminal_size()
286
+ pad_size = (columns - len(text)) // 2
287
+ bars = "=" * max(0, pad_size)
288
+
289
+ self.header = f"{bars}{brand}{bars}"
290
+
262
291
  def local_init(self):
292
+ #==Works together with ConfigManager.data_check==
263
293
  default_files = resources.files("da.default")
264
294
  dest = self.config.memory_ini
265
295
 
@@ -268,7 +298,7 @@ class Interface:
268
298
  shutil.copy(item, dest)
269
299
 
270
300
  self.config.projects_folder.mkdir(parents=True, exist_ok=True)
271
- # Add Test-Project
301
+
272
302
  dest = self.config.projects_folder
273
303
  for item in default_files.iterdir():
274
304
  if item.name == "test-project.ini":
@@ -283,9 +313,8 @@ class Interface:
283
313
 
284
314
  readme_content = resources.files("da").joinpath("intro.md").read_text()
285
315
 
286
- MARKDOWN = readme_content
287
316
  console = Console()
288
- md = Markdown(MARKDOWN)
317
+ md = Markdown(readme_content)
289
318
  console.print(md)
290
319
 
291
320
  input("\nContinue..." + colored("[Enter]", f"{self.color}"))
@@ -294,9 +323,11 @@ def main():
294
323
  try:
295
324
  app = Interface()
296
325
  app.run()
326
+ os.system(app.clear)
297
327
  except KeyboardInterrupt:
298
328
  print("\n\n" + colored("Execution interrupted. Exiting...", "cyan", attrs=["bold"]))
299
- time.sleep(1)
329
+ time.sleep(0.5)
330
+ os.system(app.clear)
300
331
  sys.exit(0)
301
332
 
302
333
  if __name__ == "__main__":