From 2d8c5e4bf5fa368fa9063d5168c7400e22faa9d4 Mon Sep 17 00:00:00 2001 From: JHCD Date: Fri, 5 Jun 2015 10:19:49 +0200 Subject: [PATCH] some small documentation --- boswatch.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/boswatch.py b/boswatch.py index 257fb25..0203e8e 100755 --- a/boswatch.py +++ b/boswatch.py @@ -22,8 +22,6 @@ import os #for log mkdir import time #timestamp import subprocess -import sys - from includes import globals # Global variables ## @@ -62,11 +60,10 @@ def freqToHz(freq): # -# Manage args parsing +# ArgParser # try: # With -h or --help you get the Args help - # ArgsParser parser = argparse.ArgumentParser(prog="boswatch.py", description="BOSWatch is a Python Script to recive and decode german BOS information with rtl_fm and multimon-NG", epilog="More options you can find in the extern config.ini file in the folder /config") @@ -80,16 +77,17 @@ try: parser.add_argument("-q", "--quiet", help="Shows no information. Only logfiles", action="store_true") args = parser.parse_args() except SystemExit: - # -h or --help called, exit now + # -h or --help called, exit right now exit(0) except: - print "Unexpected error parsing the arguments" + print "cannot parsing the arguments" # -# Programm +# Main Programm # try: + # initialization try: # # Script-pathes @@ -126,6 +124,7 @@ try: except: logging.exception("cannot create logger") else: + # initialization of the logging was fine, continue... try: # @@ -195,6 +194,7 @@ try: except: logging.exception("cannot read config file") else: + # initialization of was fine, continue with main program... try: # @@ -233,6 +233,7 @@ try: except: logging.exception("cannot start rtl_fm") else: + # rtl_fm started, continue... try: # @@ -247,6 +248,7 @@ try: except: logging.exception("cannot start multimon-ng") else: + # multimon-ng started, continue... logging.debug("start decoding") @@ -295,4 +297,4 @@ finally: logging.shutdown() fh.close() ch.close() - exit(0) + exit(0) \ No newline at end of file