Skip to content

Commit 032e970

Browse files
committed
feat: improve type hinting in main.py and add option to toggle script window visibility in README_ptBR.md
1 parent b8870be commit 032e970

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

README_ptBR.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ if __name__ == "__main__":
374374
- [ ] **Abstração de Projetos**: Refatorar para classes (`PythonProject`, `NodeProject`) facilitando a adição de novas linguagens.
375375
- [ ] **Type Hinting**: Melhorar a tipagem em todos os métodos para melhor suporte em IDEs.
376376
- [ ] Arrumar bugs relacionado a path, atualmente se adicionar um script python e ele não estiver na raiz do projeto o venv não sera executado, fortscript tenta executar com python padrão, mas da erro por não possuir os imports e a janela do terminal se encerra
377-
- [ ] Adicionar opção de ativar ou desativar as janelas que aparecem dos scripts
377+
378378
### CLI
379379

380380
- [ ] **System Tray**: Rodar minimizado na bandeja do sistema.
@@ -399,6 +399,7 @@ if __name__ == "__main__":
399399
- [x] Callbacks de eventos (`on_pause` e `on_resume`)
400400
- [x] Níveis de log configuráveis (DEBUG, INFO, WARNING, ERROR)
401401
- [x] Encerramento seguro de processos (tree-kill)
402+
- [x] Adicionar opção de ativar ou desativar as janelas que aparecem dos scripts (Apenas em OS Windows)
402403

403404
---
404405

src/fortscript/main.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,22 @@ class FortScript:
5858
def __init__(
5959
self,
6060
config_path: str ='fortscript.yaml',
61-
projects: list[str] | None = None,
62-
heavy_process: list | None = None,
61+
projects: list[dict[str,str]] | None = None,
62+
heavy_process: list[dict[str,str]] | None = None,
6363
ram_threshold: int | None = None,
6464
ram_safe: int | None = None,
6565
on_pause: Callable | None = None,
6666
on_resume: Callable | None = None,
6767
log_level: str | int | None = None,
68+
new_console: bool = True,
6869
):
6970
"""
7071
Initializes FortScript with the configuration file.
7172
7273
Args:
7374
config_path (str): The path to the YAML configuration file.
7475
"""
76+
self.new_console = new_console
7577
self.file_config = self.load_config(config_path)
7678

7779
self.active_processes = []
@@ -150,7 +152,7 @@ def _start_project(self, project):
150152

151153
project_dir = os.path.dirname(script_path)
152154
creation_flags = 0
153-
if self.is_windows:
155+
if self.is_windows and self.new_console:
154156
creation_flags = subprocess.CREATE_NEW_CONSOLE
155157

156158
# Check if the script is Python

0 commit comments

Comments
 (0)