Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-dominate for openSUSE:Factory checked in at 2022-09-28 17:51:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-dominate (Old) and /work/SRC/openSUSE:Factory/.python-dominate.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-dominate" Wed Sep 28 17:51:16 2022 rev:7 rq:1006495 version:2.7.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-dominate/python-dominate.changes 2021-03-12 13:33:29.950340937 +0100 +++ /work/SRC/openSUSE:Factory/.python-dominate.new.2275/python-dominate.changes 2022-09-28 17:51:18.471178524 +0200 @@ -1,0 +2,11 @@ +Tue Sep 27 18:38:32 UTC 2022 - Yogalakshmi Arunachalam <yarunacha...@suse.com> + +- Update to 2.7.0: + Fixes (#160) + * fix #153 + * fix #144 + * fix #139 + * bump version + * remove dead code + +------------------------------------------------------------------- Old: ---- dominate-2.6.0.tar.gz New: ---- dominate-2.7.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-dominate.spec ++++++ --- /var/tmp/diff_new_pack.CGbivh/_old 2022-09-28 17:51:18.939179465 +0200 +++ /var/tmp/diff_new_pack.CGbivh/_new 2022-09-28 17:51:18.943179473 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-dominate # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-dominate -Version: 2.6.0 +Version: 2.7.0 Release: 0 Summary: Python library for creating and manipulating HTML documents License: GPL-3.0-only ++++++ dominate-2.6.0.tar.gz -> dominate-2.7.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.6.0/PKG-INFO new/dominate-2.7.0/PKG-INFO --- old/dominate-2.6.0/PKG-INFO 2020-10-21 09:01:29.000000000 +0200 +++ new/dominate-2.7.0/PKG-INFO 2022-07-25 08:44:59.670655500 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: dominate -Version: 2.6.0 +Version: 2.7.0 Summary: Dominate is a Python library for creating and manipulating HTML documents using an elegant DOM API. Home-page: https://github.com/Knio/dominate/ Author: Tom Flanagan and Jake Wharton @@ -78,7 +78,7 @@ The recommended way to install `dominate` is with [`pip`](http://pypi.python.org/pypi/pip/): - sudo pip install dominate + pip install dominate [](https://pypi.org/project/dominate/) [](https://pypi.org/project/dominate/) @@ -604,6 +604,8 @@ Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content Classifier: Topic :: Software Development :: Libraries :: Python Modules diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.6.0/README.md new/dominate-2.7.0/README.md --- old/dominate-2.6.0/README.md 2019-08-04 06:52:29.000000000 +0200 +++ new/dominate-2.7.0/README.md 2022-07-25 08:39:55.000000000 +0200 @@ -70,7 +70,7 @@ The recommended way to install `dominate` is with [`pip`](http://pypi.python.org/pypi/pip/): - sudo pip install dominate + pip install dominate [](https://pypi.org/project/dominate/) [](https://pypi.org/project/dominate/) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.6.0/dominate/_version.py new/dominate-2.7.0/dominate/_version.py --- old/dominate-2.6.0/dominate/_version.py 2020-10-21 08:57:28.000000000 +0200 +++ new/dominate-2.7.0/dominate/_version.py 2022-07-25 08:39:55.000000000 +0200 @@ -1 +1 @@ -__version__ = '2.6.0' +__version__ = '2.7.0' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.6.0/dominate/document.py new/dominate-2.7.0/dominate/document.py --- old/dominate-2.6.0/dominate/document.py 2018-09-25 04:45:41.000000000 +0200 +++ new/dominate-2.7.0/dominate/document.py 2022-07-25 08:39:55.000000000 +0200 @@ -17,6 +17,7 @@ ''' from . import tags +from . import util try: basestring = basestring @@ -26,16 +27,21 @@ class document(tags.html): tagname = 'html' - def __init__(self, title='Dominate', doctype='<!DOCTYPE html>', request=None): + def __init__(self, title='Dominate', doctype='<!DOCTYPE html>', *a, **kw): ''' - Creates a new document instance. Accepts `title`, `doctype`, and `request` keyword arguments. + Creates a new document instance. Accepts `title` and `doctype` ''' - super(document, self).__init__() + super(document, self).__init__(*a, **kw) self.doctype = doctype self.head = super(document, self).add(tags.head()) self.body = super(document, self).add(tags.body()) - self.title_node = self.head.add(tags.title(title)) - self._entry = self.body + if title is not None: + self.title_node = self.head.add(tags.title(title)) + with self.body: + self.header = util.container() + self.main = util.container() + self.footer = util.container() + self._entry = self.main def get_title(self): return self.title_node.text @@ -56,20 +62,15 @@ ''' return self._entry.add(*args) - def render(self, *args, **kwargs): + def _render(self, sb, *args, **kwargs): ''' - Creates a <title> tag if not present and renders the DOCTYPE and tag tree. + Renders the DOCTYPE and tag tree. ''' - r = [] - - #Validates the tag tree and adds the doctype if one was set + # adds the doctype if one was set if self.doctype: - r.append(self.doctype) - r.append('\n') - r.append(super(document, self).render(*args, **kwargs)) - - return u''.join(r) - __str__ = __unicode__ = render + sb.append(self.doctype) + sb.append('\n') + return super(document, self)._render(sb, *args, **kwargs) def __repr__(self): return '<dominate.document "%s">' % self.title diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.6.0/dominate/dom1core.py new/dominate-2.7.0/dominate/dom1core.py --- old/dominate-2.6.0/dominate/dom1core.py 2018-09-25 04:45:41.000000000 +0200 +++ new/dominate-2.7.0/dominate/dom1core.py 2022-07-25 08:39:55.000000000 +0200 @@ -46,8 +46,7 @@ raise ValueError('Multiple tags with id "%s".' % id) elif results: return results[0] - else: - return None + return None def getElementsByTagName(self, name): ''' @@ -55,8 +54,7 @@ ''' if isinstance(name, basestring): return self.get(name.lower()) - else: - return None + return None def appendChild(self, obj): ''' @@ -64,5 +62,3 @@ ''' self.add(obj) return self - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.6.0/dominate/dom_tag.py new/dominate-2.7.0/dominate/dom_tag.py --- old/dominate-2.6.0/dominate/dom_tag.py 2020-10-21 08:57:28.000000000 +0200 +++ new/dominate-2.7.0/dominate/dom_tag.py 2022-07-25 08:39:55.000000000 +0200 @@ -91,7 +91,6 @@ self.attributes = {} self.children = [] self.parent = None - self.document = None # Does not insert newlines on all children if True (recursive attribute) self.is_inline = kwargs.pop('__inline', self.is_inline) @@ -169,6 +168,7 @@ 'child tags and attributes, respectively.') __setitem__ = set_attribute + def delete_attribute(self, key): if isinstance(key, int): del self.children[key:key+1] @@ -176,18 +176,6 @@ del self.attributes[key] __delitem__ = delete_attribute - def setdocument(self, doc): - ''' - Creates a reference to the parent document to allow for partial-tree - validation. - ''' - # assume that a document is correct in the subtree - if self.document != doc: - self.document = doc - for i in self.children: - if not isinstance(i, dom_tag): return - i.setdocument(doc) - def add(self, *args): ''' @@ -199,7 +187,7 @@ obj = str(obj) if isinstance(obj, basestring): - obj = escape(obj) + obj = util.escape(obj) self.children.append(obj) elif isinstance(obj, dom_tag): @@ -208,7 +196,6 @@ stack[-1].used.add(obj) self.children.append(obj) obj.parent = self - obj.setdocument(self.document) elif isinstance(obj, dict): for attr, value in obj.items(): @@ -355,22 +342,25 @@ sb.append(name) for attribute, value in sorted(self.attributes.items()): - if value is not False: # False values must be omitted completely - sb.append(' %s="%s"' % (attribute, escape(unicode(value), True))) + if value in (False, None): + continue + val = unicode(value) if isinstance(value, util.text) and not value.escape else util.escape(unicode(value), True) + sb.append(' %s="%s"' % (attribute, val)) sb.append(' />' if self.is_single and xhtml else '>') - if not self.is_single: - inline = self._render_children(sb, indent_level + 1, indent_str, pretty, xhtml) + if self.is_single: + return sb + + inline = self._render_children(sb, indent_level + 1, indent_str, pretty, xhtml) + if pretty and not inline: + sb.append('\n') + sb.append(indent_str * indent_level) - if pretty and not inline: - sb.append('\n') - sb.append(indent_str * indent_level) - - # close tag - sb.append('</') - sb.append(name) - sb.append('>') + # close tag + sb.append('</') + sb.append(name) + sb.append('>') return sb @@ -415,9 +405,11 @@ 'cls': 'class', 'className': 'class', 'class_name': 'class', + 'klass': 'class', 'fr': 'for', 'html_for': 'for', 'htmlFor': 'for', + 'phor': 'for', }.get(attribute, attribute) # Workaround for Python's reserved words @@ -482,5 +474,4 @@ c.set_attribute(*dom_tag.clean_pair(attr, value)) -# escape() is used in render -from .util import escape +from . import util diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.6.0/dominate/svg.py new/dominate-2.7.0/dominate/svg.py --- old/dominate-2.6.0/dominate/svg.py 2020-08-22 21:18:41.000000000 +0200 +++ new/dominate-2.7.0/dominate/svg.py 2022-07-25 08:39:55.000000000 +0200 @@ -213,14 +213,6 @@ pass -class tspan(svg_tag): - ''' - The SVG <tspan> element define a subtext within a <text> element or another <tspan> element. - It allows to adjust the style and/or position of that subtext as needed. - ''' - pass - - class path(svg_tag): ''' A path element for svg containers diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.6.0/dominate/tags.py new/dominate-2.7.0/dominate/tags.py --- old/dominate-2.6.0/dominate/tags.py 2020-10-21 08:57:28.000000000 +0200 +++ new/dominate-2.7.0/dominate/tags.py 2022-07-25 08:39:55.000000000 +0200 @@ -596,6 +596,7 @@ class i(html_tag): + is_inline = True ''' The i element represents a span of text in an alternate voice or mood, or otherwise offset from the normal prose in a manner indicating a different diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.6.0/dominate/util.py new/dominate-2.7.0/dominate/util.py --- old/dominate-2.6.0/dominate/util.py 2020-10-21 08:57:28.000000000 +0200 +++ new/dominate-2.7.0/dominate/util.py 2022-07-25 08:39:55.000000000 +0200 @@ -120,6 +120,19 @@ lambda m: unichr(int(m.group(1), 16)), data) +class container(dom_tag): + ''' + Contains multiple elements, but does not add a level + ''' + is_inline = True + def _render(self, sb, indent_level, indent_str, pretty, xhtml): + inline = self._render_children(sb, indent_level, indent_str, pretty, xhtml) + if pretty and not inline: + sb.append('\n') + sb.append(indent_str * (indent_level - 1)) + return sb + + class lazy(dom_tag): ''' delays function execution until rendered @@ -146,16 +159,16 @@ sb.append(str(r)) -# TODO rename this to raw? class text(dom_tag): ''' - Just a string. useful for inside context managers + Just a string. Useful for inside context managers ''' is_pretty = False is_inline = True def __init__(self, _text, escape=True): super(text, self).__init__() + self.escape = escape if escape: self.text = str_escape(_text) else: @@ -168,6 +181,6 @@ def raw(s): ''' - Inserts a raw string into the DOM. Unsafe. + Inserts a raw string into the DOM. Unsafe. Alias for text(x, escape=False) ''' return text(s, escape=False) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.6.0/dominate.egg-info/PKG-INFO new/dominate-2.7.0/dominate.egg-info/PKG-INFO --- old/dominate-2.6.0/dominate.egg-info/PKG-INFO 2020-10-21 09:01:29.000000000 +0200 +++ new/dominate-2.7.0/dominate.egg-info/PKG-INFO 2022-07-25 08:44:59.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: dominate -Version: 2.6.0 +Version: 2.7.0 Summary: Dominate is a Python library for creating and manipulating HTML documents using an elegant DOM API. Home-page: https://github.com/Knio/dominate/ Author: Tom Flanagan and Jake Wharton @@ -78,7 +78,7 @@ The recommended way to install `dominate` is with [`pip`](http://pypi.python.org/pypi/pip/): - sudo pip install dominate + pip install dominate [](https://pypi.org/project/dominate/) [](https://pypi.org/project/dominate/) @@ -604,6 +604,8 @@ Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content Classifier: Topic :: Software Development :: Libraries :: Python Modules diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.6.0/setup.py new/dominate-2.7.0/setup.py --- old/dominate-2.6.0/setup.py 2020-03-07 06:09:56.000000000 +0100 +++ new/dominate-2.7.0/setup.py 2022-07-25 08:39:55.000000000 +0200 @@ -50,6 +50,8 @@ 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development :: Libraries :: Python Modules', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.6.0/tests/test_document.py new/dominate-2.7.0/tests/test_document.py --- old/dominate-2.6.0/tests/test_document.py 2018-09-25 04:45:41.000000000 +0200 +++ new/dominate-2.7.0/tests/test_document.py 2022-07-25 08:39:55.000000000 +0200 @@ -70,6 +70,46 @@ <body></body> </html>''' +def test_containers(): + d = document() + with d.footer: + div('footer') + with d: + div('main1') + with d.main: + div('main2') + print(d.header) + print(d) + print(d.body.children) + with d.header: + div('header1') + div('header2') + assert d.render() == \ +'''<!DOCTYPE html> +<html> + <head> + <title>Dominate</title> + </head> + <body> + <div>header1</div> + <div>header2</div> + '''''' + <div>main1</div> + <div>main2</div> + '''''' + <div>footer</div> + </body> +</html>''' + + +def test_attributes(): + d = document(title=None, doctype=None, lang='en') + assert d.render() == \ +'''<html lang="en"> + <head></head> + <body></body> +</html>''' + if __name__ == '__main__': # test_doc() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.6.0/tests/test_dom1core.py new/dominate-2.7.0/tests/test_dom1core.py --- old/dominate-2.6.0/tests/test_dom1core.py 2018-09-25 04:45:41.000000000 +0200 +++ new/dominate-2.7.0/tests/test_dom1core.py 2022-07-25 08:39:55.000000000 +0200 @@ -1,3 +1,5 @@ +import pytest + from dominate.tags import * def test_dom(): @@ -5,12 +7,21 @@ with container.add(div(id='base')) as dom: s1 = span('Hello', id='span1') s2 = span('World', id='span2') - + s3 = span('foobar', id='span3') dom.appendChild(s3) - - assert container.getElementById('base') is dom + assert container.getElementById('base') is dom assert container.getElementById('span1') is s1 assert container.getElementById('span3') is s3 assert container.getElementsByTagName('span') == [s1, s2, s3] assert container.getElementsByTagName('SPAN') == [s1, s2, s3] + + +def test_element(): + d = div( + span(id='a'), + span(id='a'), + ) + with pytest.raises(ValueError): + d.getElementById('a') + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.6.0/tests/test_dominate.py new/dominate-2.7.0/tests/test_dominate.py --- old/dominate-2.6.0/tests/test_dominate.py 2020-10-21 08:57:28.000000000 +0200 +++ new/dominate-2.7.0/tests/test_dominate.py 2022-07-25 08:39:55.000000000 +0200 @@ -6,7 +6,7 @@ def test_version(): import dominate - version = '2.6.0' + version = '2.7.0' assert dominate.version == version assert dominate.__version__ == version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.6.0/tests/test_html.py new/dominate-2.7.0/tests/test_html.py --- old/dominate-2.6.0/tests/test_html.py 2020-10-21 08:57:28.000000000 +0200 +++ new/dominate-2.7.0/tests/test_html.py 2022-07-25 08:39:55.000000000 +0200 @@ -1,6 +1,7 @@ import dominate from dominate.tags import * import pytest +from dominate.util import raw try: xrange = xrange @@ -216,9 +217,15 @@ assert d['data-test'] with pytest.raises(ValueError): + # not in a tag context attr(id='moo') +def test_attribute_none(): + d = div(foo=1, bar=None) + assert d.render() == '<div foo="1"></div>' + + def test_attribute_dashes(): # fix issue #118 (https://github.com/Knio/dominate/issues/118) expected = '<div aria-foo="bar" data-a-b-c="foo" data-page-size="123"></div>' @@ -320,6 +327,9 @@ assert span('hi', br(__inline=False), 'there').render() == \ '''<span>hi\n <br>there\n</span>''' + assert p('goodbye ', i('cruel'), ' world').render() == \ + '''<p>goodbye <i>cruel</i> world</p>''' + def test_xhtml(): assert head(script('foo'), style('bar')).render(xhtml=True) == '''<head> @@ -335,3 +345,10 @@ assert span('hi', br(), 'there').render(xhtml=False) == \ '''<span>hi<br>there</span>''' + + +def test_verbatim_attributes(): + assert div(attr = '{<div></div>}').render() == \ + '''<div attr="{<div></div>}"></div>''' + assert div(attr = raw('{<div></div>}')).render() == \ + '''<div attr="{<div></div>}"></div>''' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.6.0/tests/test_utils.py new/dominate-2.7.0/tests/test_utils.py --- old/dominate-2.6.0/tests/test_utils.py 2020-10-21 08:57:28.000000000 +0200 +++ new/dominate-2.7.0/tests/test_utils.py 2022-07-25 08:39:55.000000000 +0200 @@ -35,3 +35,22 @@ def test_url(): assert util.url_escape('hi there?') == 'hi%20there%3F' assert util.url_unescape('hi%20there%3f') == 'hi there?' + + +def test_container(): + d = div() + with d: + with util.container(): + pass + assert d.render() == '<div></div>' + + + d = div() + with d: + with util.container(): + h1('a') + assert d.render() == \ +'''<div> + <h1>a</h1> +</div>''' +