Added some more debug elements.
This commit is contained in:
+10
-1
@@ -83,12 +83,13 @@ def main(sysArgs):
|
||||
"""
|
||||
|
||||
# Valid Input Options
|
||||
shortOpt = "hd:qtl:v"
|
||||
shortOpt = "hd:Dqtl:v"
|
||||
longOpt = [
|
||||
"help",
|
||||
"debug=",
|
||||
"verbose",
|
||||
"vverbose",
|
||||
"debuggui",
|
||||
"quiet",
|
||||
"time",
|
||||
"logfile=",
|
||||
@@ -107,6 +108,7 @@ def main(sysArgs):
|
||||
" -d, --debug Debug level. Valid options are DEBUG, INFO, WARN or ERROR.\n"
|
||||
" --verbose Increase verbosity of debug.\n"
|
||||
" --vverbose Increase verbosity of debug even more.\n"
|
||||
" -D, --debuggui Shows additional debug GUI elements.\n"
|
||||
" -q, --quiet Disable output to command line. Does not affect log file.\n"
|
||||
" -t, --time Shows time stamp in logging output. Adds milliseconds for verbose.\n"
|
||||
" -l, --logfile Specify log file.\n"
|
||||
@@ -128,6 +130,7 @@ def main(sysArgs):
|
||||
showTime = False
|
||||
confPath = None
|
||||
showGUI = True
|
||||
debugGUI = False
|
||||
|
||||
# Parse Options
|
||||
try:
|
||||
@@ -173,6 +176,12 @@ def main(sysArgs):
|
||||
confPath = inArg
|
||||
elif inOpt in ("--headless"):
|
||||
showGUI = False
|
||||
elif inOpt in ("-D","--debuggui"):
|
||||
debugGUI = True
|
||||
|
||||
# Set GUI options
|
||||
CONFIG.showGUI = showGUI
|
||||
CONFIG.debugGUI = debugGUI
|
||||
|
||||
# Set Logging
|
||||
if showTime: debugStr = timeStr+debugStr
|
||||
|
||||
@@ -30,6 +30,8 @@ class Config:
|
||||
# Set Application Variables
|
||||
self.appName = nw.__package__
|
||||
self.appHandle = nw.__package__.lower()
|
||||
self.showGUI = True
|
||||
self.debugGUI = False
|
||||
|
||||
# Set Paths
|
||||
self.confPath = user_config_dir(self.appHandle)
|
||||
|
||||
@@ -211,6 +211,12 @@ class GuiMain(QMainWindow):
|
||||
menuAbout.triggered.connect(self._showAbout)
|
||||
helpMenu.addAction(menuAbout)
|
||||
|
||||
if not self.mainConf.debugGUI:
|
||||
return
|
||||
|
||||
# Debug GUI
|
||||
debugMenu = menuBar.addMenu("&Debug")
|
||||
|
||||
return
|
||||
|
||||
def _buildTreeToolBar(self):
|
||||
@@ -234,6 +240,7 @@ class GuiMain(QMainWindow):
|
||||
|
||||
def _closeMain(self):
|
||||
logger.info("Exiting %s" % nw.__package__)
|
||||
self.mainConf.setWinSize(self.frameGeometry().width(), self.frameGeometry().height())
|
||||
self.mainConf.saveConfig()
|
||||
return
|
||||
|
||||
|
||||
@@ -146,4 +146,15 @@ class NWProject():
|
||||
self.bookAuthors.append(bookAuthor)
|
||||
return True
|
||||
|
||||
#
|
||||
# Internal Functions
|
||||
#
|
||||
|
||||
def _makeHandle(self,seed=""):
|
||||
itemHandle = sha256((str(time())+seed).encode()).hexdigest()[0:13]
|
||||
# if itemHandle in self.treeLookup.keys():
|
||||
# logger.warning("BookTree: Duplicate handle encountered! Retrying ...")
|
||||
# itemHandle = self.makeHandle(seed+"!")
|
||||
return itemHandle
|
||||
|
||||
# END Class NWProject
|
||||
|
||||
Reference in New Issue
Block a user