Added --info flag and modified logging output a bit
This commit is contained in:
+5
-1
@@ -77,10 +77,11 @@ def main(sysArgs=None):
|
|||||||
sysArgs = sys.argv[1:]
|
sysArgs = sys.argv[1:]
|
||||||
|
|
||||||
# Valid Input Options
|
# Valid Input Options
|
||||||
shortOpt = "hdDqtl:v"
|
shortOpt = "hdiqtl:v"
|
||||||
longOpt = [
|
longOpt = [
|
||||||
"help",
|
"help",
|
||||||
"debug",
|
"debug",
|
||||||
|
"info",
|
||||||
"verbose",
|
"verbose",
|
||||||
"quiet",
|
"quiet",
|
||||||
"time",
|
"time",
|
||||||
@@ -99,6 +100,7 @@ def main(sysArgs=None):
|
|||||||
"Usage:\n"
|
"Usage:\n"
|
||||||
" -h, --help Print this message.\n"
|
" -h, --help Print this message.\n"
|
||||||
" -v, --version Print program version and exit.\n"
|
" -v, --version Print program version and exit.\n"
|
||||||
|
" -i, --info Print additional runtime information.\n"
|
||||||
" -d, --debug Print debug output.\n"
|
" -d, --debug Print debug output.\n"
|
||||||
" --verbose Increase verbosity of debug output.\n"
|
" --verbose Increase verbosity of debug output.\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"
|
||||||
@@ -141,6 +143,8 @@ def main(sysArgs=None):
|
|||||||
elif inOpt in ("-v", "--version"):
|
elif inOpt in ("-v", "--version"):
|
||||||
print("%s %s Version %s" % (__package__,__status__,__version__))
|
print("%s %s Version %s" % (__package__,__status__,__version__))
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
elif inOpt in ("-i", "--info"):
|
||||||
|
debugLevel = logging.INFO
|
||||||
elif inOpt in ("-d", "--debug"):
|
elif inOpt in ("-d", "--debug"):
|
||||||
debugLevel = logging.DEBUG
|
debugLevel = logging.DEBUG
|
||||||
debugStr = "{name:>30}:{lineno:<4d} {levelname:8} {message:}"
|
debugStr = "{name:>30}:{lineno:<4d} {levelname:8} {message:}"
|
||||||
|
|||||||
@@ -531,7 +531,7 @@ class GuiDocEditor(QTextEdit):
|
|||||||
|
|
||||||
def _addWord(self, theCursor):
|
def _addWord(self, theCursor):
|
||||||
theWord = theCursor.selectedText().strip()
|
theWord = theCursor.selectedText().strip()
|
||||||
logger.info("Added '%s' to project dictionary" % theWord)
|
logger.debug("Added '%s' to project dictionary" % theWord)
|
||||||
self.theDict.addWord(theWord)
|
self.theDict.addWord(theWord)
|
||||||
self.hLight.setDict(self.theDict)
|
self.hLight.setDict(self.theDict)
|
||||||
self.hLight.rehighlightBlock(theCursor.block())
|
self.hLight.rehighlightBlock(theCursor.block())
|
||||||
|
|||||||
+1
-1
@@ -40,7 +40,7 @@ logger = logging.getLogger(__name__)
|
|||||||
class GuiMain(QMainWindow):
|
class GuiMain(QMainWindow):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
QWidget.__init__(self)
|
QMainWindow.__init__(self)
|
||||||
|
|
||||||
logger.info("Starting %s" % nw.__package__)
|
logger.info("Starting %s" % nw.__package__)
|
||||||
logger.debug("Initialising GUI ...")
|
logger.debug("Initialising GUI ...")
|
||||||
|
|||||||
@@ -598,7 +598,7 @@ class NWProject():
|
|||||||
if not path.isdir(thePath):
|
if not path.isdir(thePath):
|
||||||
try:
|
try:
|
||||||
mkdir(thePath)
|
mkdir(thePath)
|
||||||
logger.info("Created folder %s" % thePath)
|
logger.debug("Created folder %s" % thePath)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.makeAlert(["Could not create folder.",str(e)], nwAlert.ERROR)
|
self.makeAlert(["Could not create folder.",str(e)], nwAlert.ERROR)
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user