Ejemplo n.º 1
0
 def dump_html(self, lines):
     lines.append('<h2>%s</h2>' % html.escape(self._section))
     lines.append('<ul>')
     for atoms in self.serialize().values():
         for v in atoms:
             lines.append('<li>%s</li>' % html.escape(v))
     lines.append('</ul>')
Ejemplo n.º 2
0
 def dump_html(self, lines):
     lines.append('<h2>%s</h2>' % html.escape(self._section))
     lines.append('<ul>')
     for atoms in self.serialize().values():
         for v in atoms:
             lines.append('<li>%s</li>' % html.escape(v))
     lines.append('</ul>')
Ejemplo n.º 3
0
    def dump_metrics_html(self, lines, metrics_dict):
        lines.append('<h2>Metrics</h2>')
        lines.append('Note: This meta data is also included with the submission.')

        lines.append('<table border="1" cellspacing="1" cellpadding="4">')
        lines.append('<tr>')
        for i in _PRIVACY_METRICS_COLUMN_HEADERS:
            lines.append('<th>%s</th>' % html.escape(i))
        lines.append('</tr>')
        for k, v in sorted(metrics_dict.items()):
            lines.append('<tr>')
            published, count_private, count_non_private = v
            for i in (_data_class_key_to_label(k), ):
                lines.append('<td>%s</td>' % html.escape(i))
            for i in (published, ):
                lines.append('<td align="center">%s</td>' % (i and 'yes' or 'no'))
            for i in (count_private, count_non_private):
                lines.append('<td align="right">%s</td>' % html.escape(str(i)))
            lines.append('</tr>')
        lines.append('</table>')

        lines.append('<br>')
        lines.append('<br>')
        lines.append('Legend:')
        lines.append('<ul>')
        lines.append('<li>Data class: Label of the class of data</li>')
        lines.append('<li>Publish: Flag if data of this class will be submitted</li>')
        lines.append('<li>Count private: Number of entries not to be submitted</li>')
        lines.append('<li>Count non-private: Number of entries to be submitted</li>')
        lines.append('</ul>')
Ejemplo n.º 4
0
 def dump_html(self, lines):
     lines.append('<h2>Compile flags</h2>')
     for group, values in sorted(self.serialize().items()):
         lines.append('<h3>%s</h3>' % html.escape(group))
         lines.append('<ul>')
         for v in values:
             lines.append('<li>%s</li>' % html.escape(v))
         lines.append('</ul>')
Ejemplo n.º 5
0
 def dump_html(self, lines):
     lines.append('<h2>Compile flags</h2>')
     for group, values in sorted(self.serialize().items()):
         lines.append('<h3>%s</h3>' % html.escape(group))
         lines.append('<ul>')
         for v in values:
             lines.append('<li>%s</li>' % html.escape(v))
         lines.append('</ul>')
Ejemplo n.º 6
0
    def dump_html(self, lines):
        lines.append("<h2>Mirrors</h2>")

        lines.append("<h3>Sync</h3>")
        lines.append("<ul>")
        lines.append("<li>%s</li>" % html.escape(self._sync_url))
        lines.append("</ul>")

        lines.append("<h3>Distfiles</h3>")
        lines.append("<ul>")
        for url in self._mirror_urls:
            lines.append('<li><a href="%(url)s">%(url)s</a></li>' % {"url": html.escape(url)})
        lines.append("</ul>")
Ejemplo n.º 7
0
    def dump_html(self, lines):
        lines.append('<h2>Mirrors</h2>')

        lines.append('<h3>Sync</h3>')
        lines.append('<ul>')
        lines.append('<li>%s</li>' % html.escape(self._sync_url))
        lines.append('</ul>')

        lines.append('<h3>Distfiles</h3>')
        lines.append('<ul>')
        for url in self._mirror_urls:
            lines.append('<li><a href="%(url)s">%(url)s</a></li>' %
                         {'url': html.escape(url)})
        lines.append('</ul>')
Ejemplo n.º 8
0
 def dump_html(self, lines):
     serialized = self.serialize()
     lines.append('<h2>Global use flags</h2>')
     lines.append('<h3>From make.conf</h3>')
     lines.append('<p>')
     lines.append(html.escape(', '.join(compress_use_flags(serialized['make_conf']))))
     lines.append('</p>')
     lines.append('<h3>From system profile</h3>')
     lines.append('<p>')
     lines.append(html.escape(', '.join(compress_use_flags(serialized['profile']))))
     lines.append('</p>')
     lines.append('<h3>Combined</h3>')
     lines.append('<p>')
     lines.append(html.escape(', '.join(compress_use_flags(serialized['final']))))
     lines.append('</p>')
Ejemplo n.º 9
0
 def dump_html(self, lines):
     lines.append('<h2>Repositories</h2>')
     lines.append('<ul>')
     for name in self.serialize():
         lines.append(
             '<li><a href="http://gentoo-overlays.zugaina.org/%(name)s/">%(name)s</a></li>'
             % {'name': html.escape(name)})
     lines.append('</ul>')
Ejemplo n.º 10
0
 def dump_html(self, lines):
     lines.append("<h2>General</h2>")
     key_data = {
         "arch": "ARCH",
         "chost": "CHOST",
         "accept_keywords": "ACCEPT_KEYWORDS",
         "system_profile": "System Profile",
     }
     for k, label in sorted(key_data.items()):
         v = self._trivials[k]
         lines.append("<dl>")
         lines.append("<dt>%s</dt>" % html.escape(label))
         if type(v).__name__ == "list":
             lines.append("<dd>%s</dd>" % html.escape(", ".join(v)))
         else:
             lines.append("<dd>%s</dd>" % html.escape(v))
         lines.append("</dl>")
Ejemplo n.º 11
0
 def dump_html(self, lines):
     lines.append('<h2>General</h2>')
     key_data = {
         'arch': 'ARCH',
         'chost': 'CHOST',
         'accept_keywords': 'ACCEPT_KEYWORDS',
         'system_profile': 'System Profile',
     }
     for k, label in sorted(key_data.items()):
         v = self._trivials[k]
         lines.append('<dl>')
         lines.append('<dt>%s</dt>' % html.escape(label))
         if type(v).__name__ == 'list':
             lines.append('<dd>%s</dd>' % html.escape(', '.join(v)))
         else:
             lines.append('<dd>%s</dd>' % html.escape(v))
         lines.append('</dl>')
Ejemplo n.º 12
0
 def dump_html(self, lines):
     serialized = self.serialize()
     lines.append('<h2>Global use flags</h2>')
     lines.append('<h3>From make.conf</h3>')
     lines.append('<p>')
     lines.append(
         html.escape(', '.join(compress_use_flags(
             serialized['make_conf']))))
     lines.append('</p>')
     lines.append('<h3>From system profile</h3>')
     lines.append('<p>')
     lines.append(
         html.escape(', '.join(compress_use_flags(serialized['profile']))))
     lines.append('</p>')
     lines.append('<h3>Combined</h3>')
     lines.append('<p>')
     lines.append(
         html.escape(', '.join(compress_use_flags(serialized['final']))))
     lines.append('</p>')
Ejemplo n.º 13
0
    def dump_html(self, lines):
        def fix_empty(text):
            if text == '':
                return '&nbsp;'
            else:
                return text

        lines.append('<h2>Installed packages</h2>')
        lines.append('<table border="1" cellspacing="1" cellpadding="4">')
        lines.append('<tr>')
        for i in ('Package', 'Version', 'Slot', 'Keyword', 'Masked', 'Unmasked', 'World', 'Tree', 'Use flags'):
            lines.append('<th>%s</th>' % i)
        lines.append('</tr>')
        for list in self._cpv_flag_list:
            package_name, version_revision, SLOT, keyword_status, \
                masked, unmasked, is_in_world, repo, sorted_flags_list = \
                list

            lines.append('<tr>')
            for i in (package_name, version_revision):
                lines.append('<td>%s</td>' % html.escape(i))
            for i in (SLOT, ):
                if i == '0':  # Hide default slot
                    v = '&nbsp;'
                else:
                    v = html.escape(i)
                lines.append('<td>%s</td>' % v)
            for i in (keyword_status, ):
                lines.append('<td>%s</td>' % fix_empty(html.escape(i)))
            for i in (masked, unmasked, is_in_world):
                v = i and 'X' or '&nbsp;'  # Hide False
                lines.append('<td>%s</td>' % v)
            for i in (repo, ):
                lines.append('<td>%s</td>' % fix_empty(html.escape(i)))
            final_flag_list = [x.startswith('-') and \
                    '<s>%s</s>' % html.escape(x.lstrip('-')) or \
                    html.escape(x) for x in \
                    compress_use_flags(sorted_flags_list)]
            lines.append('<td>%s</td>' % fix_empty(', '.join(final_flag_list)))
            lines.append('</tr>')
        lines.append('</table>')
Ejemplo n.º 14
0
 def _dump_html_section(self, lines, title, data, line_break=True):
     lines.append('<h3>%s</h3>' % html.escape(title))
     lines.append('<ul>')
     for i in sorted(data):
         lines.append('<li>%s</li>' % html.escape(i))
     lines.append('</ul>')
Ejemplo n.º 15
0
 def dump_html(self, lines):
     lines.append('<h2>Repositories</h2>')
     lines.append('<ul>')
     for name in self.serialize():
         lines.append('<li><a href="http://gentoo-overlays.zugaina.org/%(name)s/">%(name)s</a></li>' % {'name':html.escape(name)})
     lines.append('</ul>')
Ejemplo n.º 16
0
 def _dump_html_section(self, lines, title, data, line_break=True):
     lines.append('<h3>%s</h3>' % html.escape(title))
     lines.append('<ul>')
     for i in sorted(data):
         lines.append('<li>%s</li>' % html.escape(i))
     lines.append('</ul>')