allie
Advanced tools
| while True: | ||
| aux = input('Digite:') |
| Metadata-Version: 1.1 | ||
| Name: allie | ||
| Version: 1.0.4 | ||
| Version: 1.0.5 | ||
| Summary: Biblioteca de inteligência artificial | ||
@@ -5,0 +5,0 @@ Home-page: https://youtube.com/tdcprojetos |
@@ -18,2 +18,3 @@ setup.py | ||
| allie/conversas/origens.txt | ||
| scripts/configMenu.py | ||
| scripts/createFolder.py |
+27
-21
@@ -34,7 +34,7 @@ import wikipedia | ||
| #Ler o arquivo que contém os tokens e armazena em uma lista | ||
| with open('ALLIEToken/ArduinoToken.txt', "r") as output: | ||
| with open(file_find('ArduinoToken.txt', 'ALLIEToken'), 'r') as output: | ||
| ListaTemp = output.readlines() | ||
| #Verifica se há algum token na lista se não ele escreve o token gerado | ||
| if (len(ListaTemp) == 0): | ||
| with open('ALLIEToken/ArduinoToken.txt', "w") as output: | ||
| with open(file_find('ArduinoToken.txt', 'ALLIEToken'), "w") as output: | ||
| output.write(ArduinoToken) | ||
@@ -47,3 +47,3 @@ #Se houver mais de um token na lista ele escreve o novo token em uma nova linha | ||
| with open('ALLIEToken/ArduinoToken.txt', "w") as output: | ||
| with open(file_find('ArduinoToken.txt', 'ALLIEToken'), "w") as output: | ||
| for item in temp: | ||
@@ -63,3 +63,3 @@ output.write("%s\n" % item) | ||
| #ler todos os tokens do arquino e armazena em "Tokens" | ||
| with open('ALLIEToken/ArduinoToken.txt', "r") as output: | ||
| with open(file_find('ArduinoToken.txt', 'ALLIEToken'), "r") as output: | ||
| ListaTemp = output.readlines() | ||
@@ -95,3 +95,3 @@ Tokens = [] | ||
| if(SpeakError == True): | ||
| p = vlc.MediaPlayer('ALLIE_Falas_Offline/ALLIEConexaoOk.mp3') | ||
| p = vlc.MediaPlayer(file_find('ALLIEConexaoOk.mp3', 'ALLIE_Falas_Offline')) | ||
| p.audio_set_volume(100) | ||
@@ -106,3 +106,3 @@ p.play() | ||
| if(SpeakError == True): | ||
| p = vlc.MediaPlayer('ALLIE_Falas_Offline/ALLIErroConect.mp3') | ||
| p = vlc.MediaPlayer(file_find('ALLIErrorConect.mp3', 'ALLIE_Falas_Offline')) | ||
| p.audio_set_volume(100) | ||
@@ -127,3 +127,3 @@ p.play() | ||
| if(SpeakError == True): | ||
| p = vlc.MediaPlayer('ALLIE_Falas_Offline/ALLIERead.mp3') | ||
| p = vlc.MediaPlayer(file_find('ALLIERead.mp3', 'ALLIE_Falas_Offline')) | ||
| p.audio_set_volume(100) | ||
@@ -143,10 +143,10 @@ p.play() | ||
| if (arg == True): | ||
| conversa1 = open('conversas/origens.txt', 'r').readlines() | ||
| conversa1 = open(file_find('origens.txt', 'conversas'), 'r').readlines() | ||
| robot.train(conversa1) | ||
| for arquivo in os.listdir('conversas'): | ||
| conversa = open('conversas/' +arquivo, 'r').readlines() | ||
| for arquivo in os.listdir(file_find('', 'conversas')): | ||
| conversa = open(file_find('', 'conversas') +arquivo, 'r').readlines() | ||
| robot.train(conversa) | ||
| if(arg != True): | ||
| conversa = open('conversas/' +arg, 'r').readlines() | ||
| conversa = open(file_find('', 'conversas') +arg, 'r').readlines() | ||
| robot.train(conversa) | ||
@@ -221,10 +221,10 @@ | ||
| texto = polly.synthesize_speech(Text= text, OutputFormat= 'mp3', VoiceId='Vitoria') | ||
| with open('ALLIEspeak.mp3', 'wb') as f: | ||
| with open(file_find('ALLIEspeak.mp3', ''), 'wb') as f: | ||
| f.write(texto['AudioStream'].read()) | ||
| f.close() | ||
| p = vlc.MediaPlayer("ALLIEspeak.mp3") | ||
| p = vlc.MediaPlayer(file_find('ALLIEspeak.mp3', '')) | ||
| p.audio_set_volume(volume) | ||
| p.play() | ||
| except requests.ConnectionError: | ||
| p = vlc.MediaPlayer('ALLIE_Falas_Offline/Problema de rede.mp3') | ||
| p = vlc.MediaPlayer(file_find('Problema de rede.mp3', 'ALLIE_Falas_Offline')) | ||
| p.audio_set_volume(volume) | ||
@@ -241,3 +241,3 @@ p.play() | ||
| base[cod] = descricao | ||
| with open ('base de dados.txt', 'w') as ler: | ||
| with open (file_find('base de dados.txt', ''), 'w') as ler: | ||
| json.dump(base,ler) | ||
@@ -274,3 +274,3 @@ #Este metódo busca o significado de termos na base de dados do wikipedia | ||
| except requests.ConnectionError: | ||
| Falar('offline', False, 'ALLIE_Falas_Offline/Problema de rede.mp3') | ||
| Falar('offline', False, file_find('Problema de rede.mp3', 'ALLIE_Falas_Offline')) | ||
| #Esta função é usada para fazer o bot lebrar de suas origem sempre | ||
@@ -297,13 +297,19 @@ def Atualizar_Memoria(): | ||
| if os.path.exists('base de dados.txt'): | ||
| with open ('base de dados.txt', 'r') as ler: | ||
| def file_find(filename, folder): | ||
| directory = str(os.path.abspath(__file__)) | ||
| nwd = folder + '/' + filename | ||
| newDirectory = directory.replace('allie.py', nwd) | ||
| return newDirectory | ||
| if os.path.exists(file_find('base de dados.txt', '')): | ||
| with open (file_find('base de dados.txt', ''), 'r') as ler: | ||
| leituraBD = json.load(ler) | ||
| base = leituraBD | ||
| if os.path.exists('ALLIEToken/ArduinoToken.txt'): | ||
| with open ('ALLIEToken/ArduinoToken.txt', 'r') as ler: | ||
| if os.path.exists(file_find('ArduinoToken.txt', 'ALLIEToken')): | ||
| with open (file_find('ArduinoToken.txt', 'ALLIEToken'), 'r') as ler: | ||
| leituraBD = ler.readlines() | ||
| ArduinoAcessToken = leituraBD | ||
| else: | ||
| with open ('ALLIEToken/ArduinoToken.txt', 'w') as ler: | ||
| with open (file_find('ArduinoToken.txt', 'ALLIEToken'), 'w') as ler: | ||
| pass | ||
@@ -310,0 +316,0 @@ |
+1
-1
| Metadata-Version: 1.1 | ||
| Name: allie | ||
| Version: 1.0.4 | ||
| Version: 1.0.5 | ||
| Summary: Biblioteca de inteligência artificial | ||
@@ -5,0 +5,0 @@ Home-page: https://youtube.com/tdcprojetos |
| import os | ||
| os.mkdir('Lib/site-packages/allie/teste') | ||
| os.mkdir('Lib/site-packages/allie/ALLIE_Falas_Offline') | ||
| os.mkdir('Lib/site-packages/allie/conversas') | ||
| os.mkdir('Lib/site-packages/allie/ALLIEToken') | ||
+2
-2
@@ -5,3 +5,3 @@ from setuptools import setup | ||
| setup(name='allie', | ||
| version='1.0.4', | ||
| version='1.0.5', | ||
| description='Biblioteca de inteligência artificial', | ||
@@ -32,3 +32,3 @@ url='https://youtube.com/tdcprojetos', | ||
| scripts = [ 'scripts/createFolder.py'], | ||
| scripts = [ 'scripts/createFolder.py', 'scripts/configMenu.py'], | ||
@@ -35,0 +35,0 @@ data_files=[('Lib/site-packages/allie/ALLIE_Falas_Offline',['allie/ALLIE_Falas_Offline/ALLIE sond.mp3', |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
118562
0.63%21
5%354
2.91%