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