diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8afb23b..cecefd8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,15 +12,7 @@ jobs: with: fetch-depth: 0 - name: 'Build' - run: | - docker run \ - --user $(id -u):$(id -g) \ - -v "/var/run/docker.sock":"/var/run/docker.sock" \ - -v ${{ github.workspace }}:/work \ - -w /work \ - --entrypoint bash \ - python:2.7.18 \ - -c /work/render.sh + run: ./render.sh - name: 'Deploy' if: ${{ (github.repository == 'jacoco/www.eclemma.org' && github.ref == 'refs/heads/master') }} env: diff --git a/generator/eclemmasite.py b/generator/eclemmasite.py index bbe3c76..0439955 100644 --- a/generator/eclemmasite.py +++ b/generator/eclemmasite.py @@ -1,7 +1,4 @@ -"""EclEmma's site structure at SourceForge - -$LastChangedDate$ -$Revision$ +"""EclEmma's web site structure """ import sys diff --git a/generator/genshi/__init__.py b/generator/genshi/__init__.py deleted file mode 100644 index 50e01ce..0000000 --- a/generator/genshi/__init__.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2006 Edgewall Software -# All rights reserved. -# -# This software is licensed as described in the file COPYING, which -# you should have received as part of this distribution. The terms -# are also available at http://genshi.edgewall.org/wiki/License. -# -# This software consists of voluntary contributions made by many -# individuals. For the exact contribution history, see the revision -# history and logs, available at http://genshi.edgewall.org/log/. - -"""This package provides various means for generating and processing web markup -(XML or HTML). - -The design is centered around the concept of streams of markup events (similar -in concept to SAX parsing events) which can be processed in a uniform manner -independently of where or how they are produced. -""" - -__docformat__ = 'restructuredtext en' -#try: -# __version__ = __import__('pkg_resources').get_distribution('Genshi').version -#except ImportError: -# pass - -from genshi.core import * -from genshi.input import ParseError, XML, HTML diff --git a/generator/genshi/builder.py b/generator/genshi/builder.py deleted file mode 100644 index 38ca3f9..0000000 --- a/generator/genshi/builder.py +++ /dev/null @@ -1,338 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2006-2007 Edgewall Software -# All rights reserved. -# -# This software is licensed as described in the file COPYING, which -# you should have received as part of this distribution. The terms -# are also available at http://genshi.edgewall.org/wiki/License. -# -# This software consists of voluntary contributions made by many -# individuals. For the exact contribution history, see the revision -# history and logs, available at http://genshi.edgewall.org/log/. - -"""Support for programmatically generating markup streams from Python code using -a very simple syntax. The main entry point to this module is the `tag` object -(which is actually an instance of the ``ElementFactory`` class). You should -rarely (if ever) need to directly import and use any of the other classes in -this module. - -Elements can be created using the `tag` object using attribute access. For -example: - ->>> doc = tag.p('Some text and ', tag.a('a link', href='http://example.org/'), '.') ->>> doc - - -This produces an `Element` instance which can be further modified to add child -nodes and attributes. This is done by "calling" the element: positional -arguments are added as child nodes (alternatively, the `Element.append` method -can be used for that purpose), whereas keywords arguments are added as -attributes: - ->>> doc(tag.br) - ->>> print doc -

Some text and a link.

- -If an attribute name collides with a Python keyword, simply append an underscore -to the name: - ->>> doc(class_='intro') - ->>> print doc -

Some text and a link.

- -As shown above, an `Element` can easily be directly rendered to XML text by -printing it or using the Python ``str()`` function. This is basically a -shortcut for converting the `Element` to a stream and serializing that -stream: - ->>> stream = doc.generate() ->>> stream #doctest: +ELLIPSIS - ->>> print stream -

Some text and a link.

- - -The `tag` object also allows creating "fragments", which are basically lists -of nodes (elements or text) that don't have a parent element. This can be useful -for creating snippets of markup that are attached to a parent element later (for -example in a template). Fragments are created by calling the `tag` object, which -returns an object of type `Fragment`: - ->>> fragment = tag('Hello, ', tag.em('world'), '!') ->>> fragment - ->>> print fragment -Hello, world! -""" - -from genshi.core import Attrs, Namespace, QName, Stream, START, END, TEXT - -__all__ = ['Fragment', 'Element', 'ElementFactory', 'tag'] -__docformat__ = 'restructuredtext en' - - -class Fragment(object): - """Represents a markup fragment, which is basically just a list of element - or text nodes. - """ - __slots__ = ['children'] - - def __init__(self): - """Create a new fragment.""" - self.children = [] - - def __add__(self, other): - return Fragment()(self, other) - - def __call__(self, *args): - """Append any positional arguments as child nodes. - - :see: `append` - """ - map(self.append, args) - return self - - def __iter__(self): - return self._generate() - - def __repr__(self): - return '<%s>' % self.__class__.__name__ - - def __str__(self): - return str(self.generate()) - - def __unicode__(self): - return unicode(self.generate()) - - def append(self, node): - """Append an element or string as child node. - - :param node: the node to append; can be an `Element`, `Fragment`, or a - `Stream`, or a Python string or number - """ - if isinstance(node, (Stream, Element, basestring, int, float, long)): - # For objects of a known/primitive type, we avoid the check for - # whether it is iterable for better performance - self.children.append(node) - elif isinstance(node, Fragment): - self.children.extend(node.children) - elif node is not None: - try: - map(self.append, iter(node)) - except TypeError: - self.children.append(node) - - def _generate(self): - for child in self.children: - if isinstance(child, Fragment): - for event in child._generate(): - yield event - elif isinstance(child, Stream): - for event in child: - yield event - else: - if not isinstance(child, basestring): - child = unicode(child) - yield TEXT, child, (None, -1, -1) - - def generate(self): - """Return a markup event stream for the fragment.""" - return Stream(self._generate()) - - -def _value_to_unicode(value): - if isinstance(value, unicode): - return value - return unicode(value) - -def _kwargs_to_attrs(kwargs): - return [(QName(k.rstrip('_').replace('_', '-')), _value_to_unicode(v)) - for k, v in kwargs.items() if v is not None] - - -class Element(Fragment): - """Simple XML output generator based on the builder pattern. - - Construct XML elements by passing the tag name to the constructor: - - >>> print Element('strong') - - - Attributes can be specified using keyword arguments. The values of the - arguments will be converted to strings and any special XML characters - escaped: - - >>> print Element('textarea', rows=10, cols=60) -