diff options
Diffstat (limited to 'logilab/common/ureports/nodes.py')
-rw-r--r-- | logilab/common/ureports/nodes.py | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/logilab/common/ureports/nodes.py b/logilab/common/ureports/nodes.py index b90de74..d1267f5 100644 --- a/logilab/common/ureports/nodes.py +++ b/logilab/common/ureports/nodes.py @@ -3,18 +3,18 @@ # # This file is part of logilab-common. # -# logilab-common is free software: you can redistribute it and/or modify it under -# the terms of the GNU Lesser General Public License as published by the Free -# Software Foundation, either version 2.1 of the License, or (at your option) any -# later version. +# logilab-common is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by the +# Free Software Foundation, either version 2.1 of the License, +# or (at your option) any later version. # # logilab-common is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # details. # -# You should have received a copy of the GNU Lesser General Public License along -# with logilab-common. If not, see <http://www.gnu.org/licenses/>. +# You should have received a copy of the GNU Lesser General Public License +# along with logilab-common. If not, see <http://www.gnu.org/licenses/>. """Micro reports objects. A micro report is a tree of layout and content objects. @@ -23,6 +23,7 @@ __docformat__ = "restructuredtext en" from logilab.common.tree import VNode + class BaseComponent(VNode): """base report component @@ -34,6 +35,7 @@ class BaseComponent(VNode): VNode.__init__(self, id) self.klass = klass + class BaseLayout(BaseComponent): """base container node @@ -77,12 +79,13 @@ class Text(BaseComponent): """ def __init__(self, data, escaped=True, **kwargs): super(Text, self).__init__(**kwargs) - #if isinstance(data, unicode): - # data = data.encode('ascii') + # if isinstance(data, unicode): + # data = data.encode('ascii') assert isinstance(data, str), data.__class__ self.escaped = escaped self.data = data + class VerbatimText(Text): """a verbatim text, display the raw data @@ -91,6 +94,7 @@ class VerbatimText(Text): * data : the text value as an encoded or unicode string """ + class Link(BaseComponent): """a labelled link @@ -144,6 +148,7 @@ class Section(BaseLayout): if title: self.insert(0, Title(children=(title,))) + class Title(BaseLayout): """a title @@ -153,6 +158,7 @@ class Title(BaseLayout): A title must not contains a section nor a paragraph! """ + class Span(BaseLayout): """a title @@ -162,6 +168,7 @@ class Span(BaseLayout): A span should only contains Text and Link nodes (in-line elements) """ + class Paragraph(BaseLayout): """a simple text paragraph @@ -171,6 +178,7 @@ class Paragraph(BaseLayout): A paragraph must not contains a section ! """ + class Table(BaseLayout): """some tabular data @@ -193,6 +201,7 @@ class Table(BaseLayout): self.rrheaders = rrheaders self.rcheaders = rcheaders + class List(BaseLayout): """some list data |