Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dedaleDev committed Apr 16, 2024
1 parent 75e4120 commit 129b19e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion operationOnDataBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ def searchAuteur(db:database.db):
print(f"Une erreur est survenue lors de la recherche du point de vente :{e}, ligne : {e.__traceback__.tb_lineno}")

def searchLivre(db:database.db, recherche:str = None):
print(recherche)
try :
if recherche == None:
recherche = getAnswer("Rechercher un livre : ", "str", "Le livre", 1, 50)
Expand Down
8 changes: 6 additions & 2 deletions searchEngine.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def searchAuteur(recherche:str, db:database.db, onlyOne:bool = False)->list:
for i in result:#enlève les doublons
if i not in temp:
temp.append(i)
if temp == []:
return None
result = temp
if onlyOne and len(result) > 1:
print(f"Résultat de la recherche pour {' '.join(recherche)}:\n")
Expand Down Expand Up @@ -49,6 +51,8 @@ def searchPointDeVente(recherche:str, db:database.db, onlyOne:bool = False)->lis
for i in result:#enlève les doublons
if i not in temp and i != None and i != ( ):
temp.append(i)
if temp == []:
return None
result = list(temp[0])
if onlyOne and len(result) > 1:
print(f"Résultat de la recherche pour {recherche}:\n")
Expand Down Expand Up @@ -81,12 +85,12 @@ def searchLivre(recherche:str, db:database.db, onlyOne:bool = False)->list:
print("Recherche d'un code ISBN")
request.insert(0, "selectLivreByISBN")
result = searchEngine(recherche, request, db)
print(result)
temp = []
for i in result:#enlève les doublons
if i not in temp and i != None and i != ( ):
temp.append(i)
print(temp)
if temp == []:
return None
result = list(temp[0])
if onlyOne and len(result) > 1:
print(f"Résultat de la recherche pour {recherche}:\n")
Expand Down

0 comments on commit 129b19e

Please sign in to comment.