Browse Source

remplace DEBUG par un test sur l'existence des tests

omassot 6 years ago
parent
commit
d63ab31978
2 changed files with 5 additions and 7 deletions
  1. 0 2
      core/constants.py
  2. 5 5
      ui/dlg_contact.py

+ 0 - 2
core/constants.py

@@ -8,8 +8,6 @@ from path import Path
 
 VERSION = "0.7.4"
 
-DEBUG = False
-
 MAIN = Path(__file__).parent.parent.abspath()
 
 CONTACT = "sig@manchenumerique.fr"

+ 5 - 5
ui/dlg_contact.py

@@ -9,11 +9,11 @@ import unittest
 
 from PyQt5 import QtWidgets
 from PyQt5 import uic
-from PyQt5.QtCore import Qt, QFileInfo
+from PyQt5.QtCore import Qt
 from PyQt5.QtGui import QIcon, QPixmap
-from PyQt5.QtWidgets import QTextBrowser, QDialog, QApplication
+from PyQt5.QtWidgets import QTextBrowser, QApplication
 
-from core.constants import MAIN, LOGDIR, RSCDIR, CONTACT, TESTDIR, DEBUG
+from core.constants import MAIN, LOGDIR, RSCDIR, CONTACT, TESTDIR
 from path import Path
 
 
@@ -44,8 +44,8 @@ class DlgContact(QtWidgets.QDialog):
         self.ui.lbl_mail.setOpenExternalLinks(True)
         
         self.ui.btn_open_log_dir.clicked.connect(self.open_log_dir)
-            
-        self.ui.btn_test.setVisible(DEBUG)
+        
+        self.ui.btn_test.setVisible(Path(MAIN / "test").isdir())
         self.ui.btn_test.clicked.connect(self.run_tests)
     
         self._chk_dlg = QTextBrowser()