def __init__(self, item, parent=None): super(Preview, self).__init__(parent) self._tmp = tempdir() self.setContentsMargins(0, 0, 0, 0) html = html_header html += html_summary(item, icon_path=qicon_path(item, self._tmp)) html += html_footer self.setText(html) self.setReadOnly(True)
def html_project_summary(project): args = dict( image=qicon_path(project, project.path, paths=[project.path], packages=[openalea.core, openalea.oalab], default=DEFAULT_PROJECT_ICON), label=project.label, name=project.name) html = '<div class="summary"><p class="title"><img style="vertical-align:middle;" src="%(image)s" width="128" />' % args html += '%(label)s</p>' % args html += '\n<hr>' html += html_metainfo_summary(project) html += html_item_summary(project) html += '</div>' return html
def html_project_summary(project): args = dict(image=qicon_path(project, project.path, paths=[project.path], packages=[openalea.core, openalea.oalab], default=DEFAULT_PROJECT_ICON), label=project.label, name=project.name) html = '<div class="summary"><p class="title"><img style="vertical-align:middle;" src="%(image)s" width="128" />' % args html += '%(label)s</p>' % args html += '\n<hr>' html += html_metainfo_summary(project) html += html_item_summary(project) html += '</div>' return html