Skip to content

Commit 75c189f

Browse files
committed
v0.6.1 edit
1 parent 56dd00b commit 75c189f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Code/uet.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22
#
3-
# uet.py v0.6.1 - Python and Unix Epoch Time
3+
# uet.py - Python and Unix Epoch Time
44
#
55
# Casspop Codelette: A short, useful, educational utility.
66
#
@@ -21,10 +21,14 @@
2121
#
2222
import time,os,logging,argparse,traceback,signal,sys
2323
from time import sleep
24-
24+
#
25+
## VERSION NUMBER
26+
uetVer = 'v0.6.1'
27+
#
2528
parserET = argparse.ArgumentParser()
2629
parserET.add_argument('-d', '--debug', help="Turn on debugging output to et.log file.", action="store_true")
27-
parserET.add_argument('-uet', help="Unix Epoch Time value. Example: ./et.py -uet 1606352895.032772", action="store")
30+
parserET.add_argument('--version', help="Display version.", action="version", version='%(prog) s ' + uetVer)
31+
parserET.add_argument('-uet', help="Unix Epoch Time value. Example: ./uet.py -uet 1606352895.032772", action="store")
2832
UETHome = os.getcwd()
2933
logger = logging.getLogger(__name__)
3034
argsET = parserET.parse_args()
@@ -62,6 +66,8 @@ def main(input):
6266
sleep(3)
6367
print(' GMT: ' + str(gmtTime) + ' - Pausing for 3 seconds.')
6468
sleep(3)
69+
if not argsET.debug: # If not in debug mode, drop results into the log.
70+
logger.info(str(epoch) + ' = ' + str(locTime))
6571
logger.debug('Local time: ' + str(locTime))
6672
logger.debug(' GMT: ' + str(gmtTime))
6773
return gmtTime,locTime

0 commit comments

Comments
 (0)