-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgemini.py
More file actions
34 lines (27 loc) · 1.03 KB
/
gemini.py
File metadata and controls
34 lines (27 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from gemini_config import develop_code
from functions import retornar_codigo, pegar_texto_externo, copiar_pasta, cadastrar_doc, cadastrar_worksheet
import time
import subprocess
def run_automation(user_input: str):
output = develop_code(user_input)
if output is not None:
try:
codigo = retornar_codigo(output)
documentation = pegar_texto_externo(output)
file = f"script {time.strftime('%d_%m_%y_%H-%M-%S', time.localtime())}"
origem = "script"
destino = f"C:\\IAron\\{file}"
copiar_pasta(origem, destino)
open(f'C:\\IAron\\{file}\\main.py', 'w', encoding="UTF-8").write(f"{codigo}")
cadastrar_doc(documentation, destino)
cadastrar_worksheet(output, destino)
subprocess.run(['explorer', destino])
return True
except Exception as e:
print(e)
return False
else:
return False
if __name__ == '__main__':
run_automation('Teste')
print('Código Criado')