summaryrefslogtreecommitdiff
path: root/python-html.spec
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-04-11 03:51:02 +0000
committerCoprDistGit <infra@openeuler.org>2023-04-11 03:51:02 +0000
commitf08f9b065ed5747e2e1041b8a2646657d43c0d5a (patch)
tree755201fccb8b1274fcbfb2277eafe87f57dfef00 /python-html.spec
parent3b002776ecccd5fdc0cb578b76a000e754219750 (diff)
automatic import of python-html
Diffstat (limited to 'python-html.spec')
-rw-r--r--python-html.spec270
1 files changed, 270 insertions, 0 deletions
diff --git a/python-html.spec b/python-html.spec
new file mode 100644
index 0000000..32d0ced
--- /dev/null
+++ b/python-html.spec
@@ -0,0 +1,270 @@
+%global _empty_manifest_terminate_build 0
+Name: python-html
+Version: 1.16
+Release: 1
+Summary: simple, elegant HTML, XHTML and XML generation
+License: UNKNOWN
+URL: http://pypi.python.org/pypi/html
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/4a/df/0e3d22d50ee43274eb5116f49972a164d853bb3ab305a69a0540b6292252/html-1.16.tar.gz
+BuildArch: noarch
+
+
+%description
+To construct HTML start with an instance of ``html.HTML()``. Add
+tags by accessing the tag's attribute on that object. For example:
+>>> from html import HTML
+>>> h = HTML()
+>>> h.p('Hello, world!')
+>>> print h # or print(h) in python 3+
+<p>Hello, world!</p>
+You may supply a tag name and some text contents when creating a HTML
+instance:
+>>> h = HTML('html', 'text')
+>>> print h
+<html>text</html>
+You may also append text content later using the tag's ``.text()`` method
+or using augmented addition ``+=``. Any HTML-specific characters (``<>&"``)
+in the text will be escaped for HTML safety as appropriate unless
+``escape=False`` is passed. Each of the following examples uses a new
+``HTML`` instance:
+>>> p = h.p('hello world!\n')
+>>> p.br
+>>> p.text('more &rarr; text', escape=False)
+>>> p += ' ... augmented'
+>>> h.p
+>>> print h
+<p>hello, world!<br>more &rarr; text ... augmented</p>
+<p>
+Note also that the top-level ``HTML`` object adds newlines between tags by
+default. Finally in the above you'll see an empty paragraph tag - tags with
+no contents get no closing tag.
+If the tag should have sub-tags you have two options. You may either add
+the sub-tags directly on the tag:
+>>> l = h.ol
+>>> l.li('item 1')
+>>> l.li.b('item 2 > 1')
+>>> print h
+<ol>
+<li>item 1</li>
+<li><b>item 2 &gt; 1</b></li>
+</ol>
+Note that the default behavior with lists (and tables) is to add newlines
+between sub-tags to generate a nicer output. You can also see in that
+example the chaining of tags in ``l.li.b``.
+Tag attributes may be passed in as well:
+>>> t = h.table(border='1')
+>>> for i in range(2):
+>>> r = t.tr
+>>> r.td('column 1')
+>>> r.td('column 2')
+>>> print t
+<table border="1">
+<tr><td>column 1</td><td>column 2</td></tr>
+<tr><td>column 1</td><td>column 2</td></tr>
+</table>
+A variation on the above is to use a tag as a context variable. The
+following is functionally identical to the first list construction but
+with a slightly different sytax emphasising the HTML structure:
+>>> with h.ol as l:
+You may turn off/on adding newlines by passing ``newlines=False`` or
+``True`` to the tag (or ``HTML`` instance) at creation time:
+>>> l = h.ol(newlines=False)
+>>> l.li('item 1')
+>>> l.li('item 2')
+>>> print h
+<ol><li>item 1</li><li>item 2</li></ol>
+Since we can't use ``class`` as a keyword, the library recognises ``klass``
+as a substitute:
+>>> print h.p(content, klass="styled")
+<p class="styled">content</p>
+
+%package -n python3-html
+Summary: simple, elegant HTML, XHTML and XML generation
+Provides: python-html
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-html
+To construct HTML start with an instance of ``html.HTML()``. Add
+tags by accessing the tag's attribute on that object. For example:
+>>> from html import HTML
+>>> h = HTML()
+>>> h.p('Hello, world!')
+>>> print h # or print(h) in python 3+
+<p>Hello, world!</p>
+You may supply a tag name and some text contents when creating a HTML
+instance:
+>>> h = HTML('html', 'text')
+>>> print h
+<html>text</html>
+You may also append text content later using the tag's ``.text()`` method
+or using augmented addition ``+=``. Any HTML-specific characters (``<>&"``)
+in the text will be escaped for HTML safety as appropriate unless
+``escape=False`` is passed. Each of the following examples uses a new
+``HTML`` instance:
+>>> p = h.p('hello world!\n')
+>>> p.br
+>>> p.text('more &rarr; text', escape=False)
+>>> p += ' ... augmented'
+>>> h.p
+>>> print h
+<p>hello, world!<br>more &rarr; text ... augmented</p>
+<p>
+Note also that the top-level ``HTML`` object adds newlines between tags by
+default. Finally in the above you'll see an empty paragraph tag - tags with
+no contents get no closing tag.
+If the tag should have sub-tags you have two options. You may either add
+the sub-tags directly on the tag:
+>>> l = h.ol
+>>> l.li('item 1')
+>>> l.li.b('item 2 > 1')
+>>> print h
+<ol>
+<li>item 1</li>
+<li><b>item 2 &gt; 1</b></li>
+</ol>
+Note that the default behavior with lists (and tables) is to add newlines
+between sub-tags to generate a nicer output. You can also see in that
+example the chaining of tags in ``l.li.b``.
+Tag attributes may be passed in as well:
+>>> t = h.table(border='1')
+>>> for i in range(2):
+>>> r = t.tr
+>>> r.td('column 1')
+>>> r.td('column 2')
+>>> print t
+<table border="1">
+<tr><td>column 1</td><td>column 2</td></tr>
+<tr><td>column 1</td><td>column 2</td></tr>
+</table>
+A variation on the above is to use a tag as a context variable. The
+following is functionally identical to the first list construction but
+with a slightly different sytax emphasising the HTML structure:
+>>> with h.ol as l:
+You may turn off/on adding newlines by passing ``newlines=False`` or
+``True`` to the tag (or ``HTML`` instance) at creation time:
+>>> l = h.ol(newlines=False)
+>>> l.li('item 1')
+>>> l.li('item 2')
+>>> print h
+<ol><li>item 1</li><li>item 2</li></ol>
+Since we can't use ``class`` as a keyword, the library recognises ``klass``
+as a substitute:
+>>> print h.p(content, klass="styled")
+<p class="styled">content</p>
+
+%package help
+Summary: Development documents and examples for html
+Provides: python3-html-doc
+%description help
+To construct HTML start with an instance of ``html.HTML()``. Add
+tags by accessing the tag's attribute on that object. For example:
+>>> from html import HTML
+>>> h = HTML()
+>>> h.p('Hello, world!')
+>>> print h # or print(h) in python 3+
+<p>Hello, world!</p>
+You may supply a tag name and some text contents when creating a HTML
+instance:
+>>> h = HTML('html', 'text')
+>>> print h
+<html>text</html>
+You may also append text content later using the tag's ``.text()`` method
+or using augmented addition ``+=``. Any HTML-specific characters (``<>&"``)
+in the text will be escaped for HTML safety as appropriate unless
+``escape=False`` is passed. Each of the following examples uses a new
+``HTML`` instance:
+>>> p = h.p('hello world!\n')
+>>> p.br
+>>> p.text('more &rarr; text', escape=False)
+>>> p += ' ... augmented'
+>>> h.p
+>>> print h
+<p>hello, world!<br>more &rarr; text ... augmented</p>
+<p>
+Note also that the top-level ``HTML`` object adds newlines between tags by
+default. Finally in the above you'll see an empty paragraph tag - tags with
+no contents get no closing tag.
+If the tag should have sub-tags you have two options. You may either add
+the sub-tags directly on the tag:
+>>> l = h.ol
+>>> l.li('item 1')
+>>> l.li.b('item 2 > 1')
+>>> print h
+<ol>
+<li>item 1</li>
+<li><b>item 2 &gt; 1</b></li>
+</ol>
+Note that the default behavior with lists (and tables) is to add newlines
+between sub-tags to generate a nicer output. You can also see in that
+example the chaining of tags in ``l.li.b``.
+Tag attributes may be passed in as well:
+>>> t = h.table(border='1')
+>>> for i in range(2):
+>>> r = t.tr
+>>> r.td('column 1')
+>>> r.td('column 2')
+>>> print t
+<table border="1">
+<tr><td>column 1</td><td>column 2</td></tr>
+<tr><td>column 1</td><td>column 2</td></tr>
+</table>
+A variation on the above is to use a tag as a context variable. The
+following is functionally identical to the first list construction but
+with a slightly different sytax emphasising the HTML structure:
+>>> with h.ol as l:
+You may turn off/on adding newlines by passing ``newlines=False`` or
+``True`` to the tag (or ``HTML`` instance) at creation time:
+>>> l = h.ol(newlines=False)
+>>> l.li('item 1')
+>>> l.li('item 2')
+>>> print h
+<ol><li>item 1</li><li>item 2</li></ol>
+Since we can't use ``class`` as a keyword, the library recognises ``klass``
+as a substitute:
+>>> print h.p(content, klass="styled")
+<p class="styled">content</p>
+
+%prep
+%autosetup -n html-1.16
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-html -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Tue Apr 11 2023 Python_Bot <Python_Bot@openeuler.org> - 1.16-1
+- Package Spec generated