MAj
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
from src.v import Ui_Panneau, Ui_Borne, Camera
|
||||
from src.c import Teleporteur
|
||||
from src.m import Parking, Place
|
||||
from src.m import Parking
|
||||
|
||||
|
||||
__author__ = 'sidya'
|
||||
|
||||
|
||||
class Acces:
|
||||
"""
|
||||
Controleur Acces
|
||||
"""
|
||||
def __init__(self):
|
||||
self.__parking = Parking()
|
||||
self.__camera = Camera()
|
||||
@@ -19,6 +21,6 @@ class Acces:
|
||||
def majPanneau(self):
|
||||
self.__panneau.afficherNbPlaceDisponible()
|
||||
|
||||
def lancerProcedureEntree(self,client):
|
||||
def lancerProcedureEntree(self, client):
|
||||
self.__borne.afficher("Inserer votre carte ou valider")
|
||||
|
||||
|
||||
164
src/c/Borne.py
Normal file
164
src/c/Borne.py
Normal file
@@ -0,0 +1,164 @@
|
||||
from src.c.Teleporteur import Teleporteur
|
||||
from src.m.Client import Client
|
||||
from src.m.Place import Placement
|
||||
from src.m.TypeAbonnement import TypeAbonnement
|
||||
from src.v.Camera import Camera
|
||||
from PyQt4 import QtGui
|
||||
from src.v.MyQWidget import MyQWidget
|
||||
from src.v.Ui_Borne import Ui_Borne
|
||||
__author__ = 'sidya'
|
||||
|
||||
|
||||
class Borne:
|
||||
"""
|
||||
Controleur de la vue de la borne permettant l'accès au parking
|
||||
"""
|
||||
def __init__(self, main, parking):
|
||||
self.__parking = parking
|
||||
self.__main = main
|
||||
self.__main.activity("Affichage Borne", self.__main.lvl.INFO)
|
||||
|
||||
self.__w = MyQWidget(self.__main)
|
||||
self.__ui = Ui_Borne()
|
||||
self.__ui.setupUi(self.__w)
|
||||
|
||||
# connect
|
||||
self.__ui.btn_quitter.clicked.connect(self.quitter)
|
||||
self.__ui.btn_Voiture.clicked.connect(self.newVoiture)
|
||||
self.__ui.btn_annuler.clicked.connect(self.nonVoiture)
|
||||
self.__ui.btn_validerID.clicked.connect(self.identification)
|
||||
self.__ui.btn_valider_abo.clicked.connect(self.abo)
|
||||
self.__ui.btn_garer.clicked.connect(self.garer)
|
||||
self.__ui.btn_recuperer.clicked.connect(self.recuperer)
|
||||
|
||||
|
||||
#Validator
|
||||
|
||||
|
||||
self.__ui.nomParking = parking.nom
|
||||
self.nonVoiture()
|
||||
self.showWindow()
|
||||
|
||||
|
||||
|
||||
def nonVoiture(self):
|
||||
"""
|
||||
Met en etat initial de départ sans voiture
|
||||
:return:
|
||||
"""
|
||||
self.__c = None
|
||||
self.__ui.box_abo.setDisabled(True)
|
||||
self.__ui.box_garer.setDisabled(True)
|
||||
self.__ui.box_id.setDisabled(True)
|
||||
self.__ui.box_recup.setDisabled(False)
|
||||
|
||||
def newVoiture(self):
|
||||
"""
|
||||
Meten etat d'arrive de voiture detecte par la camera
|
||||
:return:
|
||||
"""
|
||||
self.v_actuel = Camera.donnerVoiture()
|
||||
self.__ui.box_abo.setDisabled(False)
|
||||
self.__ui.box_garer.setDisabled(False)
|
||||
self.__ui.box_id.setDisabled(False)
|
||||
self.__ui.box_recup.setDisabled(True)
|
||||
self.__ui.label_aff.setText("Bienvenue !")
|
||||
|
||||
|
||||
|
||||
def identification(self):
|
||||
"""
|
||||
Gestion de l'identification a partir d'un abo a partir de son id (lineedit)
|
||||
:return:
|
||||
"""
|
||||
self.__c = Client.get(self.__ui.lineEdit_id.text())
|
||||
if self.__c != None :
|
||||
self.__ui.label_aff.setText("Bonjour " + str(self.__c.nom)+ " " + str(self.__c.prenom))
|
||||
#self.__ui.labIdClient.setText(str(self.__c))
|
||||
self.__ui.box_id.setDisabled(True)
|
||||
else :
|
||||
self.__ui.label_aff.setText("Echec identification")
|
||||
self.__ui.labIdClient.setText("Non identifier")
|
||||
|
||||
def abo(self):
|
||||
"""
|
||||
Gestion validation formaulaire d'abonnement
|
||||
:return:
|
||||
"""
|
||||
if self.__c != None :
|
||||
self.__c.maj(self.__ui.nomLineEdit,
|
||||
self.__ui.prenomLineEdit,
|
||||
"",
|
||||
TypeAbonnement.SUPER_ABONNE)
|
||||
self.__ui.label_aff.setText("Mise a jour de votre abonnement effectué")
|
||||
else:
|
||||
if self.__ui.checkBox.isEnabled() :
|
||||
self.__c = Client(self.__ui.nomLineEdit,
|
||||
self.__ui.prenomLineEdit,
|
||||
"",
|
||||
TypeAbonnement.SUPER_ABONNE)
|
||||
else :
|
||||
self.__c = Client(self.__ui.nomLineEdit,
|
||||
self.__ui.prenomLineEdit,
|
||||
"",
|
||||
TypeAbonnement.ABONNE)
|
||||
self.__ui.label_aff.setText("Votre id membre est : " + self.__c.id)
|
||||
self.__ui.lineEdit_id.setText(self.__c.id)
|
||||
self.identification()
|
||||
|
||||
def garer(self):
|
||||
"""
|
||||
Gestion de la validation de garer son vehicule
|
||||
:return:
|
||||
"""
|
||||
if self.__c is None:
|
||||
id = Teleporteur.teleporterVoiture(self.v_actuel,self.__parking.recherchePlace(self.v_actuel))
|
||||
self.__ui.label_aff.setText("Votre num ticket est : " + id)
|
||||
else:
|
||||
if self.__c.abonnement != TypeAbonnement.SUPER_ABONNE :
|
||||
Teleporteur.teleporterVoiture(self.v_actuel,self.__parking.recherchePlace(self.v_actuel))
|
||||
else:
|
||||
Teleporteur.teleporterVoirureSuperAbonne(self.v_actuel)
|
||||
|
||||
|
||||
def recuperer(self):
|
||||
"""
|
||||
Essaie de recuperer une voiture avec le numero de ticket (lineedit)
|
||||
:return:
|
||||
"""
|
||||
p = Placement.get(self.__ui.numeroTicketLineEdit.text())
|
||||
if p is None:
|
||||
self.__ui.label_aff.setText("Mauvais numero de ticket")
|
||||
else:
|
||||
Teleporteur.teleporterVersSortie(p)
|
||||
self.__ui.label_aff.setText("Bonne journée")
|
||||
|
||||
|
||||
|
||||
def showWindow(self):
|
||||
"""
|
||||
Gestion affichage de la vue borne
|
||||
:return:
|
||||
"""
|
||||
self.__w.show()
|
||||
self.__child = None # supprime l'eventuel widget enfant
|
||||
self.__w.focusWidget() # reprend le focus sur la fenetre
|
||||
|
||||
def quitter(self):
|
||||
"""
|
||||
Gestion de sortie de la vue borne
|
||||
:return:
|
||||
"""
|
||||
self.__w.hide()
|
||||
self.__main.showWindow()
|
||||
|
||||
def error(self):
|
||||
"""
|
||||
Qdialog message erreur
|
||||
:return:
|
||||
"""
|
||||
QtGui.QMessageBox.warning(self.__w,
|
||||
"Erreur ...",
|
||||
"Une erreur est survenue ...")
|
||||
self.__w.hide()
|
||||
self.__main.showWindow()
|
||||
@@ -1,70 +1,110 @@
|
||||
from PyQt4 import QtGui, QtCore
|
||||
from PyQt4 import QtGui
|
||||
|
||||
from src.m.Parking import Parking
|
||||
from src.m.Place import ListeTypePlace
|
||||
from src.v.MyQWidget import MyQWidget
|
||||
from src.v.Ui_CreaParking import Ui_CreaParking
|
||||
|
||||
|
||||
__author__ = 'sidya'
|
||||
|
||||
|
||||
class CreaParking:
|
||||
"""
|
||||
Controleur de cretion de parking
|
||||
"""
|
||||
def __init__(self, main):
|
||||
self.__main = main
|
||||
self.__main.activity("Debut Creation Parking", self.__main.lvl.INFO)
|
||||
self._main = main
|
||||
self._main.activity("Debut Creation Parking", self._main.lvl.INFO)
|
||||
|
||||
self.__row = 0
|
||||
self._w = MyQWidget(self._main)
|
||||
self._ui = Ui_CreaParking()
|
||||
self._ui.setupUi(self._w)
|
||||
|
||||
self.__w = MyQWidget(self.__main)
|
||||
self.__ui = Ui_CreaParking()
|
||||
self.__ui.setupUi(self.__w)
|
||||
|
||||
#connect
|
||||
self.__ui.btn_addRow.clicked.connect(self.addRow)
|
||||
self.__ui.btn_rmRow.clicked.connect(self.rmRow)
|
||||
self.__ui.btn_valider.clicked.connect(self.valider)
|
||||
self.__ui.btn_annuler.clicked.connect(self.annuler)
|
||||
# connect
|
||||
self._ui.btn_addRow.clicked.connect(self.addRow)
|
||||
self._ui.btn_rmRow.clicked.connect(self.rmRow)
|
||||
self._ui.btn_valider.clicked.connect(self.valider)
|
||||
self._ui.btn_annuler.clicked.connect(self.annuler)
|
||||
|
||||
#Validator
|
||||
self.__ui.lineEdit_nbNiv.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp('[0-9]*')))
|
||||
|
||||
#self._ui.lineEdit_nbNiv.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp('[0-9]*')))
|
||||
|
||||
self._ui.tableWidget.insertRow(self._ui.tableWidget.rowCount())
|
||||
self.showWindow()
|
||||
|
||||
|
||||
def insererTable(self,hauteur,longueur,nombre) :
|
||||
self.__typePlacesparNiveau.add(hauteur,longueur,nombre)
|
||||
def majNbPlaceTotal(self):
|
||||
nb = 0
|
||||
for i in range(0, self._ui.tableWidget.rowCount()):
|
||||
nb += int(self._ui.tableWidget.itemAt(i, 3).text())
|
||||
self._ui.nbPlacesTotal.setText(str(nb))
|
||||
|
||||
def addRow(self):
|
||||
self.__ui.tableWidget.insertRow(self.__row)
|
||||
self.__row += 1
|
||||
"""
|
||||
Ajoute une ligne de creation de place
|
||||
:return:
|
||||
"""
|
||||
self._ui.tableWidget.insertRow(self._ui.tableWidget.rowCount())
|
||||
|
||||
def rmRow(self):
|
||||
self.__ui.tableWidget.removeRow(self.__ui.tableWidget.rowCount()-1)
|
||||
self.__row -= 1
|
||||
"""
|
||||
Enleve une ligne de creation de place
|
||||
:return:
|
||||
"""
|
||||
self._ui.tableWidget.removeRow(self._ui.tableWidget.rowCount() - 1)
|
||||
|
||||
def annuler(self):
|
||||
self.__main.activity("Annulation Creation Parking", self.__main.lvl.INFO)
|
||||
self.__w.hide()
|
||||
self.__main.showWindow()
|
||||
"""
|
||||
Gestion annulation creation parking
|
||||
:return:
|
||||
"""
|
||||
result = QtGui.QMessageBox.question(self._w,
|
||||
"Confirmer Fermeture...",
|
||||
"Etes vous sur de vouloir abandonner ?\n"
|
||||
"(Toute modification non enregistrée seras perdu)",
|
||||
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
|
||||
|
||||
if result == QtGui.QMessageBox.Yes:
|
||||
self._main.activity("Annulation Creation Parking", self._main.lvl.INFO)
|
||||
self._w.hide()
|
||||
self._main.showWindow()
|
||||
|
||||
def valider(self):
|
||||
"""
|
||||
Gestion validation de formulaire de creation de parking.
|
||||
:return:
|
||||
"""
|
||||
try:
|
||||
l = ListeTypePlace()
|
||||
for i in range(0,self.__ui.tableWidget.rowCount()):
|
||||
l.add(int(self.__ui.tableWidget.itemAt(i,0).text()), int(self.__ui.tableWidget.itemAt(i,1).text()),
|
||||
int(self.__ui.tableWidget.itemAt(i,3).text()))
|
||||
self.__main.addParking(Parking(
|
||||
int(self.__ui.lineEdit_nbNiv.text()),
|
||||
l,
|
||||
self.__ui.lineEdit_nom.text()))
|
||||
self.__main.activity("Ajout Parking : detail", self.__main.lvl.INFO)
|
||||
self.__w.hide()
|
||||
self.__main.showWindow()
|
||||
except Exception as e :
|
||||
self.__main.activity("Erreur lors de la creations du Parking \n" + str(e), self.__main.lvl.FAIL)
|
||||
self.annuler()
|
||||
for i in range(0, self._ui.tableWidget.rowCount()):
|
||||
l.add(int(self._ui.tableWidget.item(i, 0).text()), int(self._ui.tableWidget.item(i, 1).text()),
|
||||
int(self._ui.tableWidget.item(i, 2).text()))
|
||||
self._main.addParking(Parking(
|
||||
l,
|
||||
self._ui.lineEdit_nom.text()))
|
||||
self._main.activity("Ajout Parking : detail", self._main.lvl.INFO)
|
||||
self._w.hide()
|
||||
self._main.showWindow()
|
||||
except Exception as e:
|
||||
self._main.activity("Erreur lors de la creations du Parking \n" + str(e), self._main.lvl.FAIL)
|
||||
self.error()
|
||||
|
||||
def showWindow(self):
|
||||
self.__w.show()
|
||||
self.__child = None #supprime l'eventuel widget enfant
|
||||
self.__w.focusWidget() # reprend le focus sur la fenetre
|
||||
"""
|
||||
Gestion affichage vue Creation de Parking
|
||||
:return:
|
||||
"""
|
||||
self._w.show()
|
||||
self.__child = None # supprime l'eventuel widget enfant
|
||||
self._w.focusWidget() # reprend le focus sur la fenetre
|
||||
|
||||
def error(self):
|
||||
"""
|
||||
Qdialog message erreur
|
||||
:return:
|
||||
"""
|
||||
QtGui.QMessageBox.warning(self._w,
|
||||
"Erreur ...",
|
||||
"Erreur lors de la création du parking ...")
|
||||
self._w.hide()
|
||||
self._main.showWindow()
|
||||
32
src/c/DetailsPlaces.py
Normal file
32
src/c/DetailsPlaces.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from PyQt4.QtGui import QTableWidgetItem
|
||||
|
||||
from src.c.CreaParking import CreaParking
|
||||
|
||||
|
||||
__author__ = 'sidya'
|
||||
|
||||
|
||||
class DetailsPlaces(CreaParking):
|
||||
def __init__(self, main, parking):
|
||||
self.__parking = parking
|
||||
super(DetailsPlaces, self).__init__(main)
|
||||
|
||||
self._ui.lineEdit_nom.setText(parking.nom)
|
||||
for p in parking.typePlacesParNiv.l:
|
||||
row = self._ui.tableWidget.rowCount() - 1
|
||||
if row != 0:
|
||||
self._ui.tableWidget.insertRow(row)
|
||||
self._ui.tableWidget.setItem(row, 0, QTableWidgetItem(str(p.hauteur)))
|
||||
self._ui.tableWidget.setItem(row, 1, QTableWidgetItem(str(p.longueur)))
|
||||
self._ui.tableWidget.setItem(row, 2, QTableWidgetItem(str(p.nb)))
|
||||
|
||||
self._ui.lineEdit_nom.setDisabled(True)
|
||||
self._ui.tableWidget.setDisabled(True)
|
||||
self._ui.btn_annuler.setDisabled(True)
|
||||
self._ui.btn_addRow.setDisabled(True)
|
||||
self._ui.btn_rmRow.setDisabled(True)
|
||||
|
||||
def valider(self):
|
||||
self._w.hide()
|
||||
self._main.showWindow()
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import sys
|
||||
|
||||
from PyQt4 import QtGui, QtCore
|
||||
from PyQt4.QtCore import QTranslator, QLocale
|
||||
from PyQt4 import QtGui
|
||||
from src.c.Borne import Borne
|
||||
|
||||
from src.c.DetailsPlaces import DetailsPlaces
|
||||
from src.c.log.log import Log
|
||||
from src.c.log.log import lvl
|
||||
|
||||
from src.c.CreaParking import CreaParking
|
||||
from src.m.Parking import Parking, ListeTypePlace
|
||||
from src.v.MyQMainWindow import MyQMainWindow
|
||||
from src.v.Ui_MainWindow import Ui_MainWindow
|
||||
|
||||
@@ -17,30 +16,26 @@ __author__ = 'sidya'
|
||||
class Main:
|
||||
def __init__(self):
|
||||
# Init des logs
|
||||
self.lvl = lvl()
|
||||
self.lvl = lvl() # Public : Acces au constante
|
||||
self.__log = Log()
|
||||
|
||||
l = ListeTypePlace()
|
||||
l.add(10, 11, 5)
|
||||
l.add(7, 12, 5)
|
||||
p = Parking(5, l,"lol")
|
||||
|
||||
#Liste Clients et Parking
|
||||
self.__clients = []
|
||||
self.__parkings = [p]
|
||||
|
||||
|
||||
# Parking
|
||||
self.__parkings = []
|
||||
|
||||
app = QtGui.QApplication(sys.argv)
|
||||
|
||||
|
||||
self.__view = MyQMainWindow()
|
||||
self.__ui = Ui_MainWindow()
|
||||
self.__ui.setupUi(self.__view)
|
||||
|
||||
|
||||
#connect
|
||||
self.__ui.comboBox.currentIndexChanged['QString'].connect(self.selectParking)
|
||||
self.__ui.btn_creer.clicked.connect(self.creerParking)
|
||||
self.__ui.btn_supprimer.clicked.connect(self.rmParking)
|
||||
self.__ui.btn_details.clicked.connect(self.detailsPlacesParking)
|
||||
self.__ui.btn_borne.clicked.connect(self.afficherBorne)
|
||||
|
||||
|
||||
|
||||
#Chargement activité
|
||||
@@ -78,15 +73,15 @@ class Main:
|
||||
|
||||
def selectParking(self):
|
||||
self.__ui.nom.clear()
|
||||
self.__ui.niveau.clear()
|
||||
self.__ui.placesParNiveau.clear()
|
||||
self.__ui.placesDispo.clear()
|
||||
self.__ui.placesSuperAbo.clear()
|
||||
if(self.__ui.comboBox.currentIndex() != 0) :
|
||||
self.__ui.nom.setText(self.__parkings[self.__ui.comboBox.currentIndex()-1].nom)
|
||||
self.__ui.niveau.setText(str(self.__parkings[self.__ui.comboBox.currentIndex()-1].nbNiveau))
|
||||
self.__ui.placesParNiveau.setText(str(self.__parkings[self.__ui.comboBox.currentIndex()-1].nbPlacesParNiveau))
|
||||
self.__ui.placesDispo.setText(str(self.__parkings[self.__ui.comboBox.currentIndex()-1].nbPlacesLibresParking))
|
||||
if self.__ui.comboBox.count() > 1:
|
||||
print(self.__ui.comboBox.count())
|
||||
self.__ui.nom.setText(self.__parkings[self.__ui.comboBox.currentIndex() - 1].nom)
|
||||
self.__ui.placesParNiveau.setText(str(self.__parkings[self.__ui.comboBox.currentIndex() - 1].nbPlaces))
|
||||
self.__ui.placesDispo.setText(
|
||||
str(self.__parkings[self.__ui.comboBox.currentIndex() - 1].nbPlacesLibresParking))
|
||||
self.__ui.placesSuperAbo.setText("lol")
|
||||
|
||||
|
||||
@@ -94,11 +89,40 @@ class Main:
|
||||
self.__view.hide()
|
||||
self.__widgetCourant = CreaParking(self)
|
||||
|
||||
def addParking(self,parking):
|
||||
def addParking(self, parking):
|
||||
self.__parkings.append(parking)
|
||||
|
||||
def modifParking(self):
|
||||
if self.__ui.comboBox.currentIndex() != 0:
|
||||
self.__view.hide()
|
||||
self.__widgetCourant = ModifParking(self, self.__parkings[self.__ui.comboBox.currentIndex() - 1])
|
||||
|
||||
def rmParking(self):
|
||||
if self.__ui.comboBox.currentIndex() != 0:
|
||||
result = QtGui.QMessageBox.question(self.__view,
|
||||
"Confirmer Supression...",
|
||||
"Etes vous sur de vouloir supprimer ?\n"
|
||||
"(La suppression sera définitive)",
|
||||
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
|
||||
|
||||
if result == QtGui.QMessageBox.Yes:
|
||||
self.__parkings.remove(self.__parkings[self.__ui.comboBox.currentIndex() - 1])
|
||||
self.__view.hide()
|
||||
self.showWindow()
|
||||
|
||||
def detailsPlacesParking(self):
|
||||
if self.__ui.comboBox.currentIndex() != 0:
|
||||
self.__view.hide()
|
||||
self.__widgetCourant = DetailsPlaces(self, self.__parkings[self.__ui.comboBox.currentIndex() - 1])
|
||||
|
||||
def afficherBorne(self):
|
||||
if self.__ui.comboBox.currentIndex() != 0:
|
||||
self.__view.hide()
|
||||
self.__widgetCourant = Borne(self, self.__parkings[self.__ui.comboBox.currentIndex() - 1])
|
||||
|
||||
|
||||
def showWindow(self):
|
||||
self.majListeParking()
|
||||
self.__view.show()
|
||||
self.__widgetCourant = None #supprime eventuel widget
|
||||
self.__view.focusWidget() # reprend le focus sur la fenetre principal
|
||||
self.__widgetCourant = None # supprime eventuel widget
|
||||
self.__view.focusWidget() # reprend le focus sur la fenetre principal
|
||||
@@ -1,9 +1,18 @@
|
||||
from src.m.Place import Placement
|
||||
|
||||
__author__ = 'sidya'
|
||||
|
||||
|
||||
class Teleporteur :
|
||||
class Teleporteur:
|
||||
@classmethod
|
||||
def teleporterVoiture(self, voiture, place):
|
||||
p =Placement(voiture, place)
|
||||
return p.id
|
||||
|
||||
@classmethod
|
||||
def teleporterVoitureSuperAbonne(self, voiture):
|
||||
pass
|
||||
|
||||
def teleporterVoirureSuperAbonne(self, voiture):
|
||||
pass
|
||||
@classmethod
|
||||
def teleporterVersSortie(self, placement):
|
||||
placement.end()
|
||||
@@ -2,6 +2,8 @@ __author__ = 'sidya'
|
||||
|
||||
import logging
|
||||
from logging.handlers import RotatingFileHandler
|
||||
|
||||
|
||||
class bcolors:
|
||||
"""
|
||||
Define constant color value for different level
|
||||
@@ -12,6 +14,7 @@ class bcolors:
|
||||
FAIL = ' \033[91m '
|
||||
ENDC = ' \033[0m '
|
||||
|
||||
|
||||
class lvl:
|
||||
"""
|
||||
Define constant value for level log
|
||||
@@ -23,8 +26,10 @@ class lvl:
|
||||
FAIL = 40
|
||||
CRITICAL = 50
|
||||
|
||||
|
||||
class SingleLevelFilter(logging.Filter):
|
||||
"""Filter for one level"""
|
||||
|
||||
def __init__(self, passlevel, reject):
|
||||
"""
|
||||
Constructor
|
||||
@@ -33,17 +38,20 @@ class SingleLevelFilter(logging.Filter):
|
||||
"""
|
||||
self.passlevel = passlevel
|
||||
self.reject = reject
|
||||
|
||||
def filter(self, record):
|
||||
if self.reject:
|
||||
return (record.levelno != self.passlevel)
|
||||
else:
|
||||
return (record.levelno == self.passlevel)
|
||||
|
||||
|
||||
class Log(object):
|
||||
"""
|
||||
Log Manager
|
||||
"""
|
||||
def __init__(self) :
|
||||
|
||||
def __init__(self):
|
||||
"""
|
||||
Define 3 differents log :
|
||||
activity.log -> all activity
|
||||
@@ -72,18 +80,18 @@ class Log(object):
|
||||
self.logger.addHandler(steam_handler)
|
||||
|
||||
|
||||
def printL(self,pMsg,pLvl):
|
||||
def printL(self, pMsg, pLvl):
|
||||
"""
|
||||
Add color and write in log with an define level
|
||||
pMsg : message to write in log
|
||||
pLvl : level of log message
|
||||
"""
|
||||
if pLvl == lvl.DEBUG :
|
||||
if pLvl == lvl.DEBUG:
|
||||
pMsg = bcolors.DEBUG + str(pMsg) + bcolors.ENDC
|
||||
elif pLvl == lvl.INFO :
|
||||
elif pLvl == lvl.INFO:
|
||||
pMsg = bcolors.INFO + str(pMsg) + bcolors.ENDC
|
||||
elif pLvl == lvl.WARNING :
|
||||
elif pLvl == lvl.WARNING:
|
||||
pMsg = bcolors.WARNING + str(pMsg) + bcolors.ENDC
|
||||
elif pLvl == lvl.FAIL :
|
||||
elif pLvl == lvl.FAIL:
|
||||
pMsg = bcolors.FAIL + str(pMsg) + bcolors.ENDC
|
||||
self.logger.log(pLvl,pMsg)
|
||||
self.logger.log(pLvl, pMsg)
|
||||
@@ -1,7 +1,5 @@
|
||||
__author__ = 'sidya'
|
||||
|
||||
from nose.tools import assert_equal
|
||||
|
||||
|
||||
class TestAcces:
|
||||
pass
|
||||
@@ -1,5 +1,5 @@
|
||||
__author__ = 'sidya'
|
||||
|
||||
|
||||
class TestTeleporteur :
|
||||
class TestTeleporteur:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user