-- -- --- --- --- --- --- --- ------- ------- ------- |
"""
-- -- --- --- --- --- --- --- ------- ------- ------- |
Wily.
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- -- --- --- --- --- --- --- ------- ------- ------- |
A Python application for tracking, reporting on timing and complexity in tests and applications.
-- -- --- --- --- --- --- --- ------- ------- ------- |
"""
-- -- --- --- --- --- --- --- ------- ------- ------- |
import colorlog
-- -- --- --- --- --- --- --- ------- ------- ------- |
import datetime
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- -- --- --- --- --- --- --- ------- ------- ------- |
__version__ = "1.14.0"
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- -- --- --- --- --- --- --- ------- ------- ------- |
_handler = colorlog.StreamHandler()
-- -- --- --- --- --- --- --- ------- ------- ------- |
_handler.setFormatter(colorlog.ColoredFormatter("%(log_color)s%(message)s"))
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- -- --- --- --- --- --- --- ------- ------- ------- |
logger = colorlog.getLogger(__name__)
-- -- --- --- --- --- --- --- ------- ------- ------- |
logger.addHandler(_handler)
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- -- --- --- --- --- --- --- ------- ------- ------- |
""" Max number of characters of the Git commit to print """
-- -- --- --- --- --- --- --- ------- ------- ------- |
MAX_MESSAGE_WIDTH = 50
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- 01 000 000 000 000 000 000 0000.00 0000.00 0000.00 |
def format_date(timestamp):
-- 01 000 000 000 000 000 000 0000.00 0000.00 0000.00 |
"""Reusable timestamp -> date."""
-- 01 000 000 000 000 000 000 0000.00 0000.00 0000.00 |
return datetime.date.fromtimestamp(timestamp).isoformat()
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- 01 000 000 000 000 000 000 0000.00 0000.00 0000.00 |
def format_datetime(timestamp):
-- 01 000 000 000 000 000 000 0000.00 0000.00 0000.00 |
"""Reusable timestamp -> datetime."""
-- 01 000 000 000 000 000 000 0000.00 0000.00 0000.00 |
return datetime.datetime.fromtimestamp(timestamp).isoformat()
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- -- --- --- --- --- --- --- ------- ------- ------- |
-- 01 000 000 000 000 000 000 0000.00 0000.00 0000.00 |
def format_revision(sha):
-- 01 000 000 000 000 000 000 0000.00 0000.00 0000.00 |
"""Return a shorter git sha."""
-- 01 000 000 000 000 000 000 0000.00 0000.00 0000.00 |
return sha[:7]