Przeglądaj źródła

Correction d'un bug

master
TheBidouilleur 2 tygodni temu
rodzic
commit
7385a65e3d
1 zmienionych plików z 9 dodań i 3 usunięć
  1. +9
    -3
      create_manga.py

+ 9
- 3
create_manga.py Wyświetl plik

@@ -20,9 +20,9 @@ def create_manga(url):
print("Author : " + str(data["author"]))
print("Link : " + url)
print("Last chap : " + str(data["chap"]))
print("Image : " + str(data["img"])
print("Image : " + str(data["img"]))

cursor.execute(""" INSERT INTO manga(id, title, author, url, chap, img) VALUES(:id, :title, :author, :url, :chap, :img)""", data)
cursor.execute("""INSERT INTO manga(id, title, author, url, chap, img) VALUES(:id, :title, :author, :url, :chap, :img)""", data)
conn.commit()

def main():
@@ -41,7 +41,13 @@ def main():
print("Mode utilisateur")
url = input("Veuillez entrer l'URL du manga : ")
print("URL : %s" % url)
create_manga(url)
try :
create_manga(url)
except sqlite3.IntegrityError :
print("Erreur dans l'ajout ! Deja present(?)")
except urllib.error.HTTPError :
print("Erreur HTTP.. deuxieme tentative")
create_manga(url)





Ładowanie…
Anuluj
Zapisz