From 75c189f8c2151d9bf87002086d7db7b9b7fa18ee Mon Sep 17 00:00:00 2001 From: Gregory Sanders <46494738+casspop@users.noreply.github.com> Date: Sun, 29 Nov 2020 11:43:40 -0600 Subject: [PATCH] v0.6.1 edit --- Code/uet.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Code/uet.py b/Code/uet.py index cb892cf..7f8a324 100644 --- a/Code/uet.py +++ b/Code/uet.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# uet.py v0.6.1 - Python and Unix Epoch Time +# uet.py - Python and Unix Epoch Time # # Casspop Codelette: A short, useful, educational utility. # @@ -21,10 +21,14 @@ # import time,os,logging,argparse,traceback,signal,sys from time import sleep - +# +## VERSION NUMBER +uetVer = 'v0.6.1' +# parserET = argparse.ArgumentParser() parserET.add_argument('-d', '--debug', help="Turn on debugging output to et.log file.", action="store_true") -parserET.add_argument('-uet', help="Unix Epoch Time value. Example: ./et.py -uet 1606352895.032772", action="store") +parserET.add_argument('--version', help="Display version.", action="version", version='%(prog) s ' + uetVer) +parserET.add_argument('-uet', help="Unix Epoch Time value. Example: ./uet.py -uet 1606352895.032772", action="store") UETHome = os.getcwd() logger = logging.getLogger(__name__) argsET = parserET.parse_args() @@ -62,6 +66,8 @@ def main(input): sleep(3) print(' GMT: ' + str(gmtTime) + ' - Pausing for 3 seconds.') sleep(3) + if not argsET.debug: # If not in debug mode, drop results into the log. + logger.info(str(epoch) + ' = ' + str(locTime)) logger.debug('Local time: ' + str(locTime)) logger.debug(' GMT: ' + str(gmtTime)) return gmtTime,locTime