Created
February 26, 2019 07:38
-
-
Save basith374/263dc0644856b7a65c8ed4913700619b to your computer and use it in GitHub Desktop.
construct code, pre tags for sending email error logs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def error_msg(msg): | |
styles = { | |
'background': '#f4f4f4', | |
'border': '1px solid #ddd', | |
'border-left': '3px solid #f36d33', | |
'color': '#666', | |
'page-break-inside': 'avoid', | |
'font-family': 'monospace', | |
'font-size': '13px', | |
'line-height': '1.6', | |
'margin-bottom': '1.6em', | |
'max-width': '100%', | |
'overflow': 'auto', | |
'padding': '1em 1.5em', | |
'display': 'block', | |
'word-wrap': 'break-word', | |
'border-radius': '4px', | |
} | |
styles = ';'.join(['{}:{}'.format(x, styles[x]) for x in styles]) | |
return '<code><pre style="{}">{}</pre></code>'.format(styles, msg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment