feat: extract code in root index

This commit is contained in:
Alice 2023-09-02 18:14:40 +02:00
parent 86131c796e
commit 41e51b69af
3 changed files with 16 additions and 16 deletions

View file

@ -3,5 +3,5 @@ prices = {
'card_exte': 20 'card_exte': 20
} }
db_path = '../db/baseFilms.db' db_path = './db/baseFilms.db'
migrations_db = '../db/migrations' migrations_db = './db/migrations'

11
index.py Normal file
View file

@ -0,0 +1,11 @@
from scripts.ccInterface import FilmInterface
fi = FilmInterface()
try:
fi.main()
except EOFError:
print("\nCtrl-D : Sortie du programme")
pass
#except:
# fi.main()
# pass

View file

@ -12,8 +12,8 @@ import os
# * mettre en place une file d'instruction pour anticiper # * mettre en place une file d'instruction pour anticiper
# * vérifier les eval et les types donnés # * vérifier les eval et les types donnés
from genCom import GenerateurComm from scripts.genCom import GenerateurComm
from cineclubBlogSQ import filmSQ as f from scripts.cineclubBlogSQ import filmSQ as f
from config import migrations_db, db_path from config import migrations_db, db_path
import sqlite3 import sqlite3
@ -102,7 +102,7 @@ class FilmInterface():
def corrigerFilm(self): def corrigerFilm(self):
if self.filmCharge: if self.filmCharge:
# recuperer les cles possibles # recuperer les cles possibles
conn = sqlite3.connect("../db/baseFilms.db") conn = sqlite3.connect(db_path)
conn.row_factory = sqlite3.Row conn.row_factory = sqlite3.Row
c = conn.cursor() c = conn.cursor()
try: try:
@ -203,14 +203,3 @@ class FilmInterface():
def main(self): def main(self):
self.menu() self.menu()
pass pass
fi = FilmInterface()
try:
fi.main()
except EOFError:
print("\nCtrl-D : Sortie du programme")
pass
#except:
# fi.main()
# pass