Print program duration information.
(started, stream=sys.stdout)
| 134 | return ['st', 'nd', 'rd'][day % 10 - 1] |
| 135 | |
| 136 | def printProgramStatus(started, stream=sys.stdout): |
| 137 | """Print program duration information.""" |
| 138 | |
| 139 | NEW_LINE = '\n' |
| 140 | DATE_TIME_FORMAT = '%Y-%m-%d %H:%M:%S.%f (%a %d{0} %b %Y)' |
| 141 | finished = datetime.datetime.now() |
| 142 | delta = finished - started |
| 143 | dateTimeStr = started.strftime(DATE_TIME_FORMAT.format(getDaySuffix(started.day))) |
| 144 | msg = '{1}Started: {0}{1}'.format(dateTimeStr, NEW_LINE) |
| 145 | dateTimeStr = finished.strftime(DATE_TIME_FORMAT.format(getDaySuffix(finished.day))) |
| 146 | msg += 'Finished: {0}{1}'.format(dateTimeStr, NEW_LINE) |
| 147 | msg += 'Duration: {0} (days hh:mm:ss:ms)'.format(delta) |
| 148 | print(msg, file=stream) |
| 149 | |
| 150 | def getFileContentsOrParameterValue(filePathOrValue): |
| 151 | """Return list of file contents if parameter is file path, otherwise |
no test coverage detected