Commit 0f5f3833 authored by Daniel Armbruster's avatar Daniel Armbruster Committed by thomas.forbriger
Browse files

correction in help function

This is a legacy commit from before 2015-05-18.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.

SVN Path:
SVN Revision: 4357
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent a5130a0e
......@@ -106,7 +106,8 @@ def help():
-H|--host ARG Hostname of the SMTP server.
-u|--username ARG Username for SMTP server login.
-p|--password ARG Password for SMTP server login.
PATH Path(s) to the logfile(s) to check.
PATH Path(s) of the logfile(s) to check. If not specified the
logfiles in ~/.csback/log/ were investigated.
......@@ -163,7 +164,7 @@ def main(argv=None):
elif opt in ("-p", "--password"):
password = arg
raise Usage(166,"Unhandled option chosen.")
raise Usage(167,"Unhandled option chosen.")
if verbose or debugMode:
......@@ -180,20 +181,20 @@ def main(argv=None):
if None != re.match('csback\.log|csback\.log\.[1-5]', logfile)]
raise Usage(183,"Invalid argument(s).")
raise Usage(184,"Invalid argument(s).")
logger.getLogger().debug("Checking email addresses.")
if 0 == len(sender):
raise Usage(187, "Email address of sender missing.")
raise Usage(188, "Email address of sender missing.")
if None == re.match( \
'^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$', sender):
raise Error(190, "Email address of sender not valid.")
raise Error(191, "Email address of sender not valid.")
if 0 == len(receivers):
raise Usage(192, "Email address of receiver missing.")
raise Usage(193, "Email address of receiver missing.")
for add in receivers:
if None == re.match( \
'^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$', add):
raise Error(196, "Email address of receiver not valid.")
raise Error(197, "Email address of receiver not valid.")
infoDequeue = deque(maxlen=10)
warningDequeue = deque(maxlen=10)
......@@ -215,7 +216,7 @@ def main(argv=None):
logger.getLogger().info("Illegal line in logfile found.")
except IOError as err:
raise Error(218, "Error while reading logfiles.")
raise Error(219, "Error while reading logfiles.")
logger.getLogger().debug("Finished reading logfile(s).")
# prepare email
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment