developer-assistant 0.2.5__tar.gz → 0.3.0__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.
- {developer_assistant-0.2.5/developer_assistant.egg-info → developer_assistant-0.3.0}/PKG-INFO +28 -18
- {developer_assistant-0.2.5 → developer_assistant-0.3.0}/PYPI.md +26 -16
- {developer_assistant-0.2.5 → developer_assistant-0.3.0}/README.md +30 -17
- {developer_assistant-0.2.5 → developer_assistant-0.3.0}/da/default/default-memory.ini +1 -0
- {developer_assistant-0.2.5 → developer_assistant-0.3.0}/da/default/test-project.ini +3 -1
- {developer_assistant-0.2.5 → developer_assistant-0.3.0}/da/interface.py +156 -94
- developer_assistant-0.3.0/da/intro.md +78 -0
- {developer_assistant-0.2.5 → developer_assistant-0.3.0}/da/modules/config_manager.py +65 -33
- {developer_assistant-0.2.5 → developer_assistant-0.3.0}/da/modules/opener.py +2 -5
- developer_assistant-0.3.0/da/modules/projects_manager.py +267 -0
- {developer_assistant-0.2.5 → developer_assistant-0.3.0}/da/modules/version_logic.py +90 -43
- {developer_assistant-0.2.5 → developer_assistant-0.3.0/developer_assistant.egg-info}/PKG-INFO +28 -18
- {developer_assistant-0.2.5 → developer_assistant-0.3.0}/pyproject.toml +2 -2
- developer_assistant-0.2.5/da/intro.md +0 -63
- developer_assistant-0.2.5/da/modules/projects_manager.py +0 -114
- {developer_assistant-0.2.5 → developer_assistant-0.3.0}/LICENSE +0 -0
- {developer_assistant-0.2.5 → developer_assistant-0.3.0}/da/__init__.py +0 -0
- {developer_assistant-0.2.5 → developer_assistant-0.3.0}/da/default/default-changelog.md +0 -0
- {developer_assistant-0.2.5 → developer_assistant-0.3.0}/da/modules/__init__.py +0 -0
- {developer_assistant-0.2.5 → developer_assistant-0.3.0}/da/templates/changelog_template.txt +0 -0
- {developer_assistant-0.2.5 → developer_assistant-0.3.0}/da/templates/entry_template.txt +0 -0
- {developer_assistant-0.2.5 → developer_assistant-0.3.0}/da/templates/header_template.txt +0 -0
- {developer_assistant-0.2.5 → developer_assistant-0.3.0}/developer_assistant.egg-info/SOURCES.txt +0 -0
- {developer_assistant-0.2.5 → developer_assistant-0.3.0}/developer_assistant.egg-info/dependency_links.txt +0 -0
- {developer_assistant-0.2.5 → developer_assistant-0.3.0}/developer_assistant.egg-info/entry_points.txt +0 -0
- {developer_assistant-0.2.5 → developer_assistant-0.3.0}/developer_assistant.egg-info/requires.txt +0 -0
- {developer_assistant-0.2.5 → developer_assistant-0.3.0}/developer_assistant.egg-info/top_level.txt +0 -0
- {developer_assistant-0.2.5 → developer_assistant-0.3.0}/setup.cfg +0 -0
{developer_assistant-0.2.5/developer_assistant.egg-info → developer_assistant-0.3.0}/PKG-INFO
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: developer-assistant
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: A lightweight TUI
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: A lightweight TUI app for managing and simplifying your Markdown changelogs.
|
|
5
5
|
License: The MIT License (MIT)
|
|
6
6
|
|
|
7
7
|
Copyright (c) 2026 Ivori Huobolainen
|
|
@@ -56,14 +56,14 @@ B. **Using pip:** `python -m pip install -U developer-assistant`
|
|
|
56
56
|
## Introduction
|
|
57
57
|
|
|
58
58
|
### What does this tool do?
|
|
59
|
-
Developer Assistant is a lightweight TUI
|
|
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.
|
|
60
60
|
|
|
61
|
-
You can
|
|
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.
|
|
62
62
|
|
|
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
|
|
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.
|
|
64
64
|
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
## Using the program.
|
|
67
67
|
1. **What *not* to do**
|
|
68
68
|
|
|
69
69
|
Don't change the folder structure or modify variable names inside `.ini` files.
|
|
@@ -78,30 +78,37 @@ Don't change the folder structure or modify variable names inside `.ini` files.
|
|
|
78
78
|
|
|
79
79
|
* macOS: `~/Library/Application Support/da-ui/`
|
|
80
80
|
|
|
81
|
-
The `da-ui/` folder will be created automatically.
|
|
81
|
+
The `da-ui/` folder and subfolders will be created automatically.
|
|
82
82
|
|
|
83
83
|
You can access its content quickly when going to: `Main menu / Settings`
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
**Profiles for seperate projects and templates**
|
|
86
|
+
|
|
87
|
+
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
|
+
|
|
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**.
|
|
90
|
+
|
|
91
|
+
**Customizable templates**
|
|
86
92
|
|
|
87
93
|
In the **local** `Templates/` folder you can modify the template contents to your liking - **just avoid changing the `{{placeholder}}` names**.
|
|
88
94
|
|
|
89
|
-
|
|
95
|
+
**Linked projects all in one place**
|
|
90
96
|
|
|
91
97
|
The `Projects/` folder holds the `.ini` files you create when starting a new project with DA.
|
|
92
98
|
|
|
93
|
-
|
|
99
|
+
**Safe changelog updates**
|
|
94
100
|
|
|
95
101
|
Before applying any changes, your previous `CHANGELOG.md` is automatically backed up into your project folder.
|
|
96
|
-
New changes are first written to a temporary file and only
|
|
102
|
+
New changes are first written to a temporary file and only prepended to & replaced with your real changelog once you confirm them.
|
|
103
|
+
|
|
97
104
|
This ensures your existing changelog is never overwritten or corrupted, and you always have a fallback copy.
|
|
98
105
|
If the temporary changelog is present on startup you are prompted to remove or keep it.
|
|
99
106
|
|
|
100
|
-
|
|
107
|
+
**Ease of navigation**
|
|
101
108
|
|
|
102
109
|
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.
|
|
103
110
|
|
|
104
|
-
|
|
111
|
+
**Configuration**
|
|
105
112
|
|
|
106
113
|
The `memory.ini` file does exactly what you'd expect, it features:
|
|
107
114
|
|
|
@@ -109,15 +116,18 @@ The `memory.ini` file does exactly what you'd expect, it features:
|
|
|
109
116
|
|
|
110
117
|
* Pinned projects
|
|
111
118
|
|
|
119
|
+
* Active profile
|
|
120
|
+
|
|
112
121
|
* Custom colour
|
|
113
122
|
|
|
114
|
-
Last project
|
|
123
|
+
Last project & active profile get updated automatically, the rest are up to you.
|
|
124
|
+
|
|
125
|
+
**`Ctrl+C` works everywhere to quickly exit DA.**
|
|
115
126
|
|
|
116
|
-
- *`Ctrl+C` works everywhere to quickly exit DA.*
|
|
117
127
|
|
|
118
|
-
### Setting up
|
|
119
|
-
For a dummy changelog to experiment with, navigate to `Main menu / Projects`, choose `test-project`, then choose option `
|
|
128
|
+
### Setting up the test project
|
|
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*"**
|
|
120
130
|
|
|
121
|
-
|
|
131
|
+
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.
|
|
122
132
|
|
|
123
133
|
Once configured, you can create as many changelog entries as you want by picking that project in the menu.
|
|
@@ -25,14 +25,14 @@ B. **Using pip:** `python -m pip install -U developer-assistant`
|
|
|
25
25
|
## Introduction
|
|
26
26
|
|
|
27
27
|
### What does this tool do?
|
|
28
|
-
Developer Assistant is a lightweight TUI
|
|
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.
|
|
29
29
|
|
|
30
|
-
You can
|
|
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.
|
|
31
31
|
|
|
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
|
|
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.
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
## Using the program.
|
|
36
36
|
1. **What *not* to do**
|
|
37
37
|
|
|
38
38
|
Don't change the folder structure or modify variable names inside `.ini` files.
|
|
@@ -47,30 +47,37 @@ Don't change the folder structure or modify variable names inside `.ini` files.
|
|
|
47
47
|
|
|
48
48
|
* macOS: `~/Library/Application Support/da-ui/`
|
|
49
49
|
|
|
50
|
-
The `da-ui/` folder will be created automatically.
|
|
50
|
+
The `da-ui/` folder and subfolders will be created automatically.
|
|
51
51
|
|
|
52
52
|
You can access its content quickly when going to: `Main menu / Settings`
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
**Profiles for seperate projects and templates**
|
|
55
|
+
|
|
56
|
+
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
|
+
|
|
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**.
|
|
59
|
+
|
|
60
|
+
**Customizable templates**
|
|
55
61
|
|
|
56
62
|
In the **local** `Templates/` folder you can modify the template contents to your liking - **just avoid changing the `{{placeholder}}` names**.
|
|
57
63
|
|
|
58
|
-
|
|
64
|
+
**Linked projects all in one place**
|
|
59
65
|
|
|
60
66
|
The `Projects/` folder holds the `.ini` files you create when starting a new project with DA.
|
|
61
67
|
|
|
62
|
-
|
|
68
|
+
**Safe changelog updates**
|
|
63
69
|
|
|
64
70
|
Before applying any changes, your previous `CHANGELOG.md` is automatically backed up into your project folder.
|
|
65
|
-
New changes are first written to a temporary file and only
|
|
71
|
+
New changes are first written to a temporary file and only prepended to & replaced with your real changelog once you confirm them.
|
|
72
|
+
|
|
66
73
|
This ensures your existing changelog is never overwritten or corrupted, and you always have a fallback copy.
|
|
67
74
|
If the temporary changelog is present on startup you are prompted to remove or keep it.
|
|
68
75
|
|
|
69
|
-
|
|
76
|
+
**Ease of navigation**
|
|
70
77
|
|
|
71
78
|
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.
|
|
72
79
|
|
|
73
|
-
|
|
80
|
+
**Configuration**
|
|
74
81
|
|
|
75
82
|
The `memory.ini` file does exactly what you'd expect, it features:
|
|
76
83
|
|
|
@@ -78,15 +85,18 @@ The `memory.ini` file does exactly what you'd expect, it features:
|
|
|
78
85
|
|
|
79
86
|
* Pinned projects
|
|
80
87
|
|
|
88
|
+
* Active profile
|
|
89
|
+
|
|
81
90
|
* Custom colour
|
|
82
91
|
|
|
83
|
-
Last project
|
|
92
|
+
Last project & active profile get updated automatically, the rest are up to you.
|
|
93
|
+
|
|
94
|
+
**`Ctrl+C` works everywhere to quickly exit DA.**
|
|
84
95
|
|
|
85
|
-
- *`Ctrl+C` works everywhere to quickly exit DA.*
|
|
86
96
|
|
|
87
|
-
### Setting up
|
|
88
|
-
For a dummy changelog to experiment with, navigate to `Main menu / Projects`, choose `test-project`, then choose option `
|
|
97
|
+
### Setting up the test project
|
|
98
|
+
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*"**
|
|
89
99
|
|
|
90
|
-
|
|
100
|
+
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.
|
|
91
101
|
|
|
92
102
|
Once configured, you can create as many changelog entries as you want by picking that project in the menu.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Developer Assistant
|
|
2
2
|
[](https://pypi.org/project/developer-assistant/)
|
|
3
3
|
|
|
4
|
-
> **A lightweight TUI
|
|
4
|
+
> **A lightweight TUI app for managing and simplifying your Markdown changelogs.**
|
|
5
5
|
|
|
6
6
|
* **Setup:** Start with [SETUP](./SETUP.md) to get started.
|
|
7
7
|
|
|
@@ -9,9 +9,11 @@
|
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
**Requirements:** Python 3.10 or later.
|
|
12
|
+
* **Requirements:** Python 3.10 or later.
|
|
13
13
|
|
|
14
|
-
**Cross-platform:** Windows, Linux, macOS(*unverified*)
|
|
14
|
+
* **Cross-platform:** Windows, Linux, macOS(*unverified*)
|
|
15
|
+
|
|
16
|
+
* **Specifics:** [SYSTEM STRUCTURE](./documents/SYSTEM_STRUCTURE.txt)
|
|
15
17
|
|
|
16
18
|
|
|
17
19
|
## Appearance
|
|
@@ -28,12 +30,13 @@ Preview your Markdown changelogs directly in the terminal with Rich rendering:
|
|
|
28
30
|
## Introduction
|
|
29
31
|
|
|
30
32
|
### What does this tool do?
|
|
31
|
-
Developer Assistant is a lightweight TUI
|
|
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.
|
|
32
34
|
|
|
33
|
-
You can
|
|
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.
|
|
34
36
|
|
|
35
|
-
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
|
|
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.
|
|
36
38
|
|
|
39
|
+
---
|
|
37
40
|
|
|
38
41
|
### Using the program.
|
|
39
42
|
1. **What *not* to do**
|
|
@@ -50,30 +53,37 @@ Don't change the folder structure or modify variable names inside `.ini` files.
|
|
|
50
53
|
|
|
51
54
|
* macOS: `~/Library/Application Support/da-ui/`
|
|
52
55
|
|
|
53
|
-
The `da-ui/` folder will be created automatically.
|
|
56
|
+
The `da-ui/` folder and subfolders will be created automatically.
|
|
54
57
|
|
|
55
58
|
You can access its content quickly when going to: `Main menu / Settings`
|
|
56
59
|
|
|
57
|
-
|
|
60
|
+
**Profiles for seperate projects and templates**
|
|
61
|
+
|
|
62
|
+
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
|
+
|
|
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**.
|
|
65
|
+
|
|
66
|
+
**Customizable templates**
|
|
58
67
|
|
|
59
68
|
In the **local** `Templates/` folder you can modify the template contents to your liking - **just avoid changing the `{{placeholder}}` names**.
|
|
60
69
|
|
|
61
|
-
|
|
70
|
+
**Linked projects all in one place**
|
|
62
71
|
|
|
63
72
|
The `Projects/` folder holds the `.ini` files you create when starting a new project with DA.
|
|
64
73
|
|
|
65
|
-
|
|
74
|
+
**Safe changelog updates**
|
|
66
75
|
|
|
67
76
|
Before applying any changes, your previous `CHANGELOG.md` is automatically backed up into your project folder.
|
|
68
|
-
New changes are first written to a temporary file and only
|
|
77
|
+
New changes are first written to a temporary file and only prepended to & replaced with your real changelog once you confirm them.
|
|
78
|
+
|
|
69
79
|
This ensures your existing changelog is never overwritten or corrupted, and you always have a fallback copy.
|
|
70
80
|
If the temporary changelog is present on startup you are prompted to remove or keep it.
|
|
71
81
|
|
|
72
|
-
|
|
82
|
+
**Ease of navigation**
|
|
73
83
|
|
|
74
84
|
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.
|
|
75
85
|
|
|
76
|
-
|
|
86
|
+
**Configuration**
|
|
77
87
|
|
|
78
88
|
The `memory.ini` file does exactly what you'd expect, it features:
|
|
79
89
|
|
|
@@ -81,15 +91,18 @@ The `memory.ini` file does exactly what you'd expect, it features:
|
|
|
81
91
|
|
|
82
92
|
* Pinned projects
|
|
83
93
|
|
|
94
|
+
* Active profile
|
|
95
|
+
|
|
84
96
|
* Custom colour
|
|
85
97
|
|
|
86
|
-
Last project
|
|
98
|
+
Last project & active profile get updated automatically, the rest are up to you.
|
|
87
99
|
|
|
88
|
-
|
|
100
|
+
**`Ctrl+C` works everywhere to quickly exit DA.**
|
|
89
101
|
|
|
102
|
+
---
|
|
90
103
|
|
|
91
|
-
### Setting up
|
|
92
|
-
For a dummy changelog to experiment with, navigate to `Main menu / Projects`, choose `test-project`, then choose option `
|
|
104
|
+
### Setting up the test project
|
|
105
|
+
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*"**
|
|
93
106
|
|
|
94
107
|
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
108
|
|
|
@@ -4,6 +4,7 @@ import platform
|
|
|
4
4
|
import subprocess
|
|
5
5
|
import shutil
|
|
6
6
|
from pathlib import Path
|
|
7
|
+
|
|
7
8
|
from termcolor import colored
|
|
8
9
|
from rich.progress import track
|
|
9
10
|
from rich.console import Console
|
|
@@ -15,8 +16,10 @@ from da.modules.opener import Opener
|
|
|
15
16
|
from importlib import resources
|
|
16
17
|
|
|
17
18
|
class Interface:
|
|
18
|
-
def __init__(self
|
|
19
|
-
self.version = "0.
|
|
19
|
+
def __init__(self):
|
|
20
|
+
self.version = "0.3.0"
|
|
21
|
+
self.clear = 'cls' if platform.system() == 'Windows' else 'clear'
|
|
22
|
+
|
|
20
23
|
title = f"DA - {self.version}"
|
|
21
24
|
|
|
22
25
|
if platform.system() == "Windows":
|
|
@@ -24,27 +27,36 @@ class Interface:
|
|
|
24
27
|
else:
|
|
25
28
|
print(f'\33]0;{title}\a', end='', flush=True)
|
|
26
29
|
|
|
27
|
-
self.config = ConfigManager('memory.ini')
|
|
30
|
+
self.config = ConfigManager('memory.ini', profile="Default")
|
|
28
31
|
|
|
29
|
-
self.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
self.memory = None
|
|
33
|
+
self.color = None
|
|
34
|
+
self.header = None
|
|
35
|
+
self.user_path = None
|
|
33
36
|
|
|
34
|
-
self.
|
|
35
|
-
self.color = self.memory.get('color') or color
|
|
36
|
-
|
|
37
|
-
#==Reusables==
|
|
38
|
-
self.header = (colored(" Developer Assistant ", f"{self.color}"))
|
|
39
|
-
self.clear_screen = 'cls' if platform.system() == 'Windows' else 'clear'
|
|
40
|
-
self.user_path = os.environ.get('USERPROFILE') or os.environ.get('HOME', 'User')
|
|
37
|
+
self.first_run = False
|
|
41
38
|
|
|
42
39
|
def run(self):
|
|
40
|
+
steps = [
|
|
41
|
+
("Initializing runtime...", self.runtime_init),
|
|
42
|
+
("Checking configuration...", self.config.data_check)
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
for label, step in track(steps):
|
|
46
|
+
os.system(self.clear)
|
|
47
|
+
print(label.center(65))
|
|
48
|
+
result = step()
|
|
49
|
+
time.sleep(0.30)
|
|
50
|
+
if isinstance(result, list):
|
|
51
|
+
for msg in result:
|
|
52
|
+
print(msg.center(65))
|
|
53
|
+
time.sleep(2)
|
|
54
|
+
|
|
43
55
|
temp_log = Path(__file__).parent / "CHANGELOG.tmp"
|
|
44
56
|
|
|
45
57
|
if os.path.exists(temp_log):
|
|
46
58
|
while True:
|
|
47
|
-
os.system(self.
|
|
59
|
+
os.system(self.clear)
|
|
48
60
|
print(colored(f"Temporary changelog detected in:\n{temp_log}\n", "yellow"))
|
|
49
61
|
print(colored("D", "light_red") + "elete or " + colored("K", "light_red") + "eep?\n")
|
|
50
62
|
choice = input(f"{self.user_path}> ").lower()
|
|
@@ -56,17 +68,6 @@ class Interface:
|
|
|
56
68
|
else:
|
|
57
69
|
print(colored("\nPlease make a valid choice.", "light_red"))
|
|
58
70
|
time.sleep(1.5)
|
|
59
|
-
|
|
60
|
-
os.system(self.clear_screen)
|
|
61
|
-
message = (colored("Developer Assistant Ver. ", attrs=["bold"]) + (colored(self.version, f"{self.color}", attrs=["bold"])))
|
|
62
|
-
status = (colored("Loading, please wait... ", attrs=["blink"]))
|
|
63
|
-
|
|
64
|
-
print(message.center(85))
|
|
65
|
-
print("")
|
|
66
|
-
print(status.center(73))
|
|
67
|
-
|
|
68
|
-
for i in track(range(20)):
|
|
69
|
-
time.sleep(0.10)
|
|
70
71
|
|
|
71
72
|
state = "intro" if self.first_run else "menu"
|
|
72
73
|
|
|
@@ -77,88 +78,57 @@ class Interface:
|
|
|
77
78
|
|
|
78
79
|
elif state == "menu":
|
|
79
80
|
result = self.menu()
|
|
80
|
-
if result == "
|
|
81
|
+
if result == "profiles":
|
|
82
|
+
self.profiles()
|
|
83
|
+
state = "menu"
|
|
84
|
+
|
|
85
|
+
elif result == "settings":
|
|
86
|
+
self.settings()
|
|
87
|
+
state = "menu"
|
|
88
|
+
|
|
89
|
+
elif result == "exit":
|
|
81
90
|
state = "exit"
|
|
82
91
|
|
|
83
92
|
def menu(self):
|
|
93
|
+
self.active_profile = self.memory.get('profile')
|
|
94
|
+
|
|
95
|
+
projects_manager = ProjectsManager(
|
|
96
|
+
config=self.config,
|
|
97
|
+
color=self.color,
|
|
98
|
+
header=self.header,
|
|
99
|
+
cls=self.clear,
|
|
100
|
+
user_path=self.user_path
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
last_project = self.memory.get('last_project')
|
|
84
104
|
while True:
|
|
85
|
-
os.system(self.
|
|
86
|
-
print("Main menu")
|
|
105
|
+
os.system(self.clear)
|
|
106
|
+
print(colored(f"{self.active_profile}", f"{self.color}") + " / Main menu")
|
|
87
107
|
print(self.header.center(127, "="))
|
|
88
|
-
print("
|
|
89
|
-
print("
|
|
90
|
-
print("
|
|
108
|
+
print("E. Exit\n")
|
|
109
|
+
print("Last project:")
|
|
110
|
+
print(colored(last_project, f"{self.color}"))
|
|
111
|
+
print("\n1. Projects")
|
|
112
|
+
print("2. Profiles")
|
|
113
|
+
print("3. Settings\n")
|
|
91
114
|
|
|
92
115
|
choice = input(f"{self.user_path}> ").strip()
|
|
93
116
|
|
|
94
117
|
if choice.lower() == "e":
|
|
95
|
-
os.system(self.
|
|
118
|
+
os.system(self.clear)
|
|
96
119
|
print(self.header.center(127, "="))
|
|
97
120
|
print("Bye!")
|
|
98
121
|
time.sleep(1)
|
|
99
122
|
return "exit"
|
|
100
123
|
|
|
101
124
|
elif choice == "1":
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
elif choice == "2":
|
|
105
|
-
self.settings()
|
|
106
|
-
else:
|
|
107
|
-
print("")
|
|
108
|
-
print(colored("Unknown option...", "light_red", attrs=["blink"]))
|
|
109
|
-
time.sleep(1)
|
|
110
|
-
|
|
111
|
-
def projects(self):
|
|
112
|
-
projects_manager = ProjectsManager(config=self.config)
|
|
113
|
-
while True:
|
|
114
|
-
self.memory = self.config.load_memory()
|
|
115
|
-
os.system(self.clear_screen)
|
|
116
|
-
print("Main menu / Projects")
|
|
117
|
-
print(self.header.center(127, "="))
|
|
118
|
-
print("E. Back\n")
|
|
119
|
-
print(colored("1. The last project:", attrs=["underline"]))
|
|
120
|
-
print(colored(self.memory.get('last_project'), f"{self.color}"))
|
|
121
|
-
print("\n2. Start a new project.\n")
|
|
122
|
-
print(colored("Continue a project.", attrs=["underline"]))
|
|
123
|
-
print("Pinned:")
|
|
124
|
-
print("a. " + colored(self.memory.get('pinned_project'), f"{self.color}"))
|
|
125
|
-
print("b. " + colored(self.memory.get('pinned_project1'), f"{self.color}"))
|
|
126
|
-
print("c. " + colored(self.memory.get('pinned_project2'), f"{self.color}"))
|
|
127
|
-
|
|
128
|
-
print("")
|
|
129
|
-
choice = input(f"{self.user_path}> ").strip()
|
|
130
|
-
|
|
131
|
-
if choice.lower() == "e":
|
|
132
|
-
return
|
|
133
|
-
|
|
134
|
-
elif choice == "1":
|
|
135
|
-
project = self.memory.get('last_project')
|
|
136
|
-
if not project:
|
|
137
|
-
print(colored("\nLast project has not been defined...", "light_red", attrs=["blink"]))
|
|
138
|
-
time.sleep(2)
|
|
139
|
-
else:
|
|
140
|
-
projects_manager.load_project(f"{project}")
|
|
125
|
+
projects_manager.projects(self.active_profile)
|
|
141
126
|
|
|
142
127
|
elif choice == "2":
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
elif choice.lower() in ("a", "b", "c"):
|
|
146
|
-
#==If the pinned project is empty, return an error message==
|
|
147
|
-
options_map = {
|
|
148
|
-
'a': 'pinned_project',
|
|
149
|
-
'b': 'pinned_project1',
|
|
150
|
-
'c': 'pinned_project2'
|
|
151
|
-
}
|
|
152
|
-
key = options_map.get(choice.lower())
|
|
153
|
-
project_name = self.memory.get(key)
|
|
154
|
-
if project_name == "":
|
|
155
|
-
print("")
|
|
156
|
-
print(colored(f"Project '{choice}' has not been defined...", "light_red", attrs=["blink"]))
|
|
157
|
-
time.sleep(2)
|
|
158
|
-
else:
|
|
159
|
-
project = self.memory.get(key)
|
|
160
|
-
projects_manager.load_project(f"{project}")
|
|
128
|
+
return "profiles"
|
|
161
129
|
|
|
130
|
+
elif choice == "3":
|
|
131
|
+
return "settings"
|
|
162
132
|
else:
|
|
163
133
|
print("")
|
|
164
134
|
print(colored("Unknown option...", "light_red", attrs=["blink"]))
|
|
@@ -166,13 +136,15 @@ class Interface:
|
|
|
166
136
|
|
|
167
137
|
def settings(self):
|
|
168
138
|
while True:
|
|
169
|
-
os.system(self.
|
|
170
|
-
print("Main menu / Settings")
|
|
139
|
+
os.system(self.clear)
|
|
140
|
+
print(colored(f"{self.active_profile}", f"{self.color}") + " / Main menu / Settings")
|
|
171
141
|
print(self.header.center(127, "="))
|
|
172
142
|
print("E. Back\n")
|
|
143
|
+
|
|
173
144
|
print(colored("Configuration options", attrs=["underline"]))
|
|
174
145
|
print("1. Edit pinned projects [WIP]")
|
|
175
146
|
print("2. Change program's color [WIP]\n")
|
|
147
|
+
|
|
176
148
|
print(colored("Other options", attrs=["underline"]))
|
|
177
149
|
print("3. Open memory.ini manually")
|
|
178
150
|
print("4. Open the Projects folder")
|
|
@@ -197,6 +169,96 @@ class Interface:
|
|
|
197
169
|
print(colored("Unknown option...", "light_red", attrs=["blink"]))
|
|
198
170
|
time.sleep(1)
|
|
199
171
|
|
|
172
|
+
def profiles(self):
|
|
173
|
+
while True:
|
|
174
|
+
os.system(self.clear)
|
|
175
|
+
print(colored(f"{self.active_profile}", f"{self.color}") + " / Main menu / Profiles")
|
|
176
|
+
print(self.header.center(127, "="))
|
|
177
|
+
print("E. Back\n")
|
|
178
|
+
|
|
179
|
+
print("1. Create a new profile")
|
|
180
|
+
print("2. Switch profiles\n")
|
|
181
|
+
|
|
182
|
+
choice = input(f"{self.user_path}> ").strip()
|
|
183
|
+
|
|
184
|
+
if choice.lower() == "e":
|
|
185
|
+
return
|
|
186
|
+
elif choice == "1":
|
|
187
|
+
self.new_profile()
|
|
188
|
+
elif choice == "2":
|
|
189
|
+
self.switch_profile()
|
|
190
|
+
else:
|
|
191
|
+
print("")
|
|
192
|
+
print(colored("Unknown option...", "light_red", attrs=["blink"]))
|
|
193
|
+
time.sleep(1)
|
|
194
|
+
|
|
195
|
+
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)
|
|
208
|
+
|
|
209
|
+
self.memory = self.config.load_memory()
|
|
210
|
+
|
|
211
|
+
profile = self.memory.get('profile')
|
|
212
|
+
self.config = ConfigManager("memory.ini", profile=profile)
|
|
213
|
+
|
|
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)
|
|
221
|
+
|
|
222
|
+
def new_profile(self):
|
|
223
|
+
name = input("\nNew profile name > ").strip()
|
|
224
|
+
|
|
225
|
+
profile_dir = self.config.profile_dir / name
|
|
226
|
+
profile_dir.mkdir(parents=True, exist_ok=True)
|
|
227
|
+
|
|
228
|
+
(profile_dir / "Projects").mkdir(exist_ok=True)
|
|
229
|
+
(profile_dir / "Templates").mkdir(exist_ok=True)
|
|
230
|
+
|
|
231
|
+
default_templates = resources.files("da.templates")
|
|
232
|
+
for item in default_templates.iterdir():
|
|
233
|
+
dest = profile_dir / "Templates"
|
|
234
|
+
shutil.copy(item, dest)
|
|
235
|
+
|
|
236
|
+
self.config.update_memory("CONFIG", "profile", name)
|
|
237
|
+
|
|
238
|
+
self.memory = self.config.load_memory()
|
|
239
|
+
|
|
240
|
+
profile = self.memory.get('profile')
|
|
241
|
+
self.config = ConfigManager("memory.ini", profile=profile)
|
|
242
|
+
|
|
243
|
+
self.memory = self.config.load_memory()
|
|
244
|
+
self.active_profile = self.memory.get('profile')
|
|
245
|
+
return
|
|
246
|
+
|
|
247
|
+
def runtime_init(self):
|
|
248
|
+
if not self.config.memory_ini.exists():
|
|
249
|
+
self.local_init()
|
|
250
|
+
self.first_run = True
|
|
251
|
+
|
|
252
|
+
self.memory = self.config.load_memory()
|
|
253
|
+
active_profile = self.memory.get("profile") or "Default"
|
|
254
|
+
|
|
255
|
+
self.config = ConfigManager("memory.ini", profile=active_profile)
|
|
256
|
+
self.memory = self.config.load_memory()
|
|
257
|
+
|
|
258
|
+
self.color = self.memory.get('color') or "light_blue"
|
|
259
|
+
self.header = (colored(" Developer Assistant ", f"{self.color}"))
|
|
260
|
+
self.user_path = os.environ.get('USERPROFILE') or os.environ.get('HOME', 'User')
|
|
261
|
+
|
|
200
262
|
def local_init(self):
|
|
201
263
|
default_files = resources.files("da.default")
|
|
202
264
|
dest = self.config.memory_ini
|
|
@@ -213,7 +275,7 @@ class Interface:
|
|
|
213
275
|
shutil.copy(item, dest)
|
|
214
276
|
|
|
215
277
|
def intro(self):
|
|
216
|
-
os.system(self.
|
|
278
|
+
os.system(self.clear)
|
|
217
279
|
print(colored("Welcome to the Developer Assistant\n", f"{self.color}", attrs=["bold"]))
|
|
218
280
|
print("Here's everything you need to get started...\n")
|
|
219
281
|
|
|
@@ -233,7 +295,7 @@ def main():
|
|
|
233
295
|
app = Interface()
|
|
234
296
|
app.run()
|
|
235
297
|
except KeyboardInterrupt:
|
|
236
|
-
print("\n\n" + colored("Execution interrupted. Exiting...", "
|
|
298
|
+
print("\n\n" + colored("Execution interrupted. Exiting...", "cyan", attrs=["bold"]))
|
|
237
299
|
time.sleep(1)
|
|
238
300
|
sys.exit(0)
|
|
239
301
|
|