How to use the chameleon.utils.Markup function in Chameleon

To help you get started, we’ve selected a few Chameleon examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pilgun / acvtool / smiler / reporter.py View on Github external
a.reload()
            ins_buf[0:0] = [span_tab_tag(d) for d in a.buf]
        for p in reversed(m.parameters):
            p.reload()
            ins_buf[0:0] = [span_tab_tag(d) for d in p.buf]
        ins_buf.insert(0, span_tab_tag(m.get_registers_line()))
        html_method_line = span_tag(cgi.escape(m.get_method_line()), COV_CLASS) if m.called else m.get_method_line()
        ins_buf.insert(0, html_method_line)
        ins_buf.append(LI_TAG(".end method"))
        buf.append(LI_TAG(''))
        buf.extend(ins_buf)
    slash_num = cl.name.count('/')
    respath = ''
    for i in range(slash_num):
        respath += '../'
    html = class_template(code=Markup("\n".join(buf)), appname=app_name, title=cl.file_name, 
                          package=Utils2.get_standart_package_name(cl.name), respath=respath,
                          granularity=Granularity.get(granularity))
    with open(class_path, 'w') as f:
        f.write(html)
github pilgun / acvtool / smiler / reporter.py View on Github external
rows = []
    total_coverage_data = CoverageData()
    for g in groups:
        (package, path, coverage_data) = save_package_indexhtml(g, templates, output_dir, app_name, granularity)
        coverage = coverage_data.get_formatted_coverage(granularity)
        row = init_row(elementlink=path, type='package', elementname=package,
                  coverage=coverage,
                  respath='', coverage_data=coverage_data,
                  is_instruction_level=Granularity.is_instruction(granularity),
                  progress_covered=coverage_data.covered(granularity),
                  progress_missed=coverage_data.missed(granularity))
        rows.append(Markup(row))
        total_coverage_data.add_data(coverage_data)
    total_coverage = total_coverage_data.get_formatted_coverage(granularity)
    table = init_table(rows=Markup("\n".join(rows)),
                        total_coverage=total_coverage,
                        total_coverage_data=total_coverage_data,
                        is_instruction_level=Granularity.is_instruction(granularity),
                        progress_covered=total_coverage_data.covered(granularity),
                        progress_all=total_coverage_data.coverable(granularity))
    root_path = ''
    html = index_template(table=Markup(table), appname=app_name, title=app_name, package=None, 
                          respath=root_path, file_name=None, granularity=Granularity.get(granularity))
    path = os.path.join(output_dir, 'index.html')
    with open(path, 'w') as f:
        f.write(html)
github Pylons / deform / deform / field.py View on Github external
def start_mapping(self, name=None):
        """ Create a start-mapping tag (a literal).  If ``name`` is ``None``,
        the name of this node will be used to generate the name in the tag.
        See the :term:`Peppercorn` documentation for more information.
        """
        if name is None:
            name = self.name
        tag = '<input value="%s:mapping" name="__start__" type="hidden">'
        return Markup(tag % (name,))
github Pylons / deform / deform / form.py View on Github external
autocomplete = "on"
        elif autocomplete is not None:
            autocomplete = "off"
        self.autocomplete = autocomplete
        field.Field.__init__(self, schema, **kw)
        _buttons = []
        for button in buttons:
            if isinstance(button, compat.string_types):
                button = Button(button)
            _buttons.append(button)
        self.action = action
        self.method = method
        self.buttons = _buttons
        self.formid = formid
        self.use_ajax = use_ajax
        self.ajax_options = Markup(ajax_options.strip())
        form_widget = getattr(schema, "widget", None)
        if form_widget is None:
            form_widget = widget.FormWidget()
        self.widget = form_widget
github pilgun / acvtool / smiler / reporter.py View on Github external
coverage=coverage,
                  respath='', coverage_data=coverage_data,
                  is_instruction_level=Granularity.is_instruction(granularity),
                  progress_covered=coverage_data.covered(granularity),
                  progress_missed=coverage_data.missed(granularity))
        rows.append(Markup(row))
        total_coverage_data.add_data(coverage_data)
    total_coverage = total_coverage_data.get_formatted_coverage(granularity)
    table = init_table(rows=Markup("\n".join(rows)),
                        total_coverage=total_coverage,
                        total_coverage_data=total_coverage_data,
                        is_instruction_level=Granularity.is_instruction(granularity),
                        progress_covered=total_coverage_data.covered(granularity),
                        progress_all=total_coverage_data.coverable(granularity))
    root_path = ''
    html = index_template(table=Markup(table), appname=app_name, title=app_name, package=None, 
                          respath=root_path, file_name=None, granularity=Granularity.get(granularity))
    path = os.path.join(output_dir, 'index.html')
    with open(path, 'w') as f:
        f.write(html)
github Pylons / deform / deform / field.py View on Github external
def start_rename(self, name=None):
        """ Create a start-rename tag (a literal).  If ``name`` is ``None``,
        the name of this node will be used to generate the name in the tag.
        See the :term:`Peppercorn` documentation for more information.
        """
        if name is None:
            name = self.name
        tag = '<input value="%s:rename" name="__start__" type="hidden">'
        return Markup(tag % (name,))
github Pylons / deform / deform / field.py View on Github external
def end_mapping(self, name=None):
        """ Create an end-mapping tag (a literal).  If ``name`` is ``None``,
        the name of this node will be used to generate the name in the tag.
        See the :term:`Peppercorn` documentation for more information.
        """
        if name is None:
            name = self.name
        tag = '<input value="%s:mapping" name="__end__" type="hidden">'
        return Markup(tag % (name,))
github Pylons / deform / deform / field.py View on Github external
def start_sequence(self, name=None):
        """ Create a start-sequence tag (a literal).  If ``name`` is ``None``,
        the name of this node will be used to generate the name in the tag.
        See the :term:`Peppercorn` documentation for more information.
        """
        if name is None:
            name = self.name
        tag = '<input value="%s:sequence" name="__start__" type="hidden">'
        return Markup(tag % (name,))
github pilgun / acvtool / smiler / reporter.py View on Github external
row = init_row(elementlink=elementlink, type='class', elementname=elementname, 
                       coverage=coverage_data.format_coverage(coverage),
                       respath=root_path, coverage_data=coverage_data,
                       is_instruction_level=Granularity.is_instruction(granularity),
                       progress_missed=coverage_data.missed(granularity),
                       progress_covered=coverage_data.covered(granularity))
        rows.append(Markup(row))
        total_coverage_data.add_data(coverage_data)
    total_coverage = total_coverage_data.get_formatted_coverage(granularity)
    table = init_table(rows=Markup("\n".join(rows)),
                        total_coverage=total_coverage,
                        is_instruction_level=Granularity.is_instruction(granularity),
                        total_coverage_data=total_coverage_data,
                        progress_covered=total_coverage_data.covered(granularity),
                        progress_all=total_coverage_data.coverable(granularity))
    html = index_template(table=Markup(table), appname=app_name, title=folder, package=package_name, 
                          respath=root_path, file_name=None, granularity=Granularity.get(granularity))
    rel_path = os.path.join(folder, 'index.html').replace('\\', '/')
    path = os.path.join(output_dir, rel_path).replace('\\', '/')
    with open(path, 'w') as f:
        f.write(html)
    return (package_name, rel_path, total_coverage_data)
github Pylons / deform / deform / field.py View on Github external
def end_rename(self, name=None):
        """ Create a start-rename tag (a literal).  If ``name`` is ``None``,
        the name of this node will be used to generate the name in the tag.
        See the :term:`Peppercorn` documentation for more information.
        """
        if name is None:
            name = self.name
        tag = '<input value="%s:rename" name="__end__" type="hidden">'
        return Markup(tag % (name,))