-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTooltip.py
More file actions
11 lines (9 loc) · 753 Bytes
/
Tooltip.py
File metadata and controls
11 lines (9 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
from string import Template
def get_str(has_matched):
matched_icon = ''
if has_matched:
matched_icon = '<span class="check-icon">✓</span>'
matched_version = '<span class="version"> $version</span>'
else:
matched_version = '<a href="" class="version"> $version</a>'
return Template('<style>html { background-color: $background; margin: 0px; } body { margin: 5px; } div { margin: 0px; word-wrap:break-word; } .line { margin: 4px 5px; font-size: 13px; } .package { color: $package_color; } .version { color: $version_color; text-decoration: none; } .check-icon { color: #B9DE82; padding-left: 5px; }</style><div><p class="line"><span class="package">$package: </span>' + matched_version + matched_icon + '</p></div>')