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 2023-05-28 19:23:32 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-dominate (Old) and /work/SRC/openSUSE:Factory/.python-dominate.new.1533 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-dominate" Sun May 28 19:23:32 2023 rev:9 rq:1089352 version:2.8.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-dominate/python-dominate.changes 2022-10-14 15:42:19.935897656 +0200 +++ /work/SRC/openSUSE:Factory/.python-dominate.new.1533/python-dominate.changes 2023-05-28 19:23:48.925309460 +0200 @@ -1,0 +2,7 @@ +Sat May 27 21:13:05 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 2.8.0: + * Fix incorrect context handling when a tag is used 2+ levels + deeper than it was created + +------------------------------------------------------------------- Old: ---- dominate-2.7.0.tar.gz New: ---- dominate-2.8.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-dominate.spec ++++++ --- /var/tmp/diff_new_pack.rg1ito/_old 2023-05-28 19:23:50.265317434 +0200 +++ /var/tmp/diff_new_pack.rg1ito/_new 2023-05-28 19:23:50.273317482 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-dominate # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 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.7.0 +Version: 2.8.0 Release: 0 Summary: Python library for creating and manipulating HTML documents License: GPL-3.0-only ++++++ dominate-2.7.0.tar.gz -> dominate-2.8.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.7.0/PKG-INFO new/dominate-2.8.0/PKG-INFO --- old/dominate-2.7.0/PKG-INFO 2022-07-25 08:44:59.670655500 +0200 +++ new/dominate-2.8.0/PKG-INFO 2023-05-21 21:32:52.816259100 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: dominate -Version: 2.7.0 +Version: 2.8.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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.7.0/dominate/_version.py new/dominate-2.8.0/dominate/_version.py --- old/dominate-2.7.0/dominate/_version.py 2022-07-25 08:39:55.000000000 +0200 +++ new/dominate-2.8.0/dominate/_version.py 2023-05-21 21:32:15.000000000 +0200 @@ -1 +1 @@ -__version__ = '2.7.0' +__version__ = '2.8.0' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.7.0/dominate/dom_tag.py new/dominate-2.8.0/dominate/dom_tag.py --- old/dominate-2.7.0/dominate/dom_tag.py 2022-07-25 08:39:55.000000000 +0200 +++ new/dominate-2.8.0/dominate/dom_tag.py 2023-05-21 21:32:15.000000000 +0200 @@ -27,13 +27,13 @@ try: # Python 3 from collections.abc import Callable -except ImportError: +except ImportError: # pragma: no cover # Python 2.7 from collections import Callable try: basestring = basestring -except NameError: # py3 +except NameError: # py3 # pragma: no cover basestring = str unicode = str @@ -191,9 +191,9 @@ self.children.append(obj) elif isinstance(obj, dom_tag): - stack = dom_tag._with_contexts.get(_get_thread_context()) - if stack: - stack[-1].used.add(obj) + stack = dom_tag._with_contexts.get(_get_thread_context(), []) + for s in stack: + s.used.add(obj) self.children.append(obj) obj.parent = self @@ -265,7 +265,7 @@ # Children are accessed using integers try: return object.__getattribute__(self, 'children')[key] - except KeyError: + except IndexError: raise IndexError('Child with index "%s" does not exist.' % key) elif isinstance(key, basestring): # Attributes are accessed using strings diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.7.0/dominate.egg-info/PKG-INFO new/dominate-2.8.0/dominate.egg-info/PKG-INFO --- old/dominate-2.7.0/dominate.egg-info/PKG-INFO 2022-07-25 08:44:59.000000000 +0200 +++ new/dominate-2.8.0/dominate.egg-info/PKG-INFO 2023-05-21 21:32:52.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: dominate -Version: 2.7.0 +Version: 2.8.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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.7.0/dominate.egg-info/SOURCES.txt new/dominate-2.8.0/dominate.egg-info/SOURCES.txt --- old/dominate-2.7.0/dominate.egg-info/SOURCES.txt 2022-07-25 08:44:59.000000000 +0200 +++ new/dominate-2.8.0/dominate.egg-info/SOURCES.txt 2023-05-21 21:32:52.000000000 +0200 @@ -17,6 +17,7 @@ dominate.egg-info/top_level.txt tests/test_document.py tests/test_dom1core.py +tests/test_dom_tag.py tests/test_dominate.py tests/test_html.py tests/test_svg.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.7.0/tests/test_document.py new/dominate-2.8.0/tests/test_document.py --- old/dominate-2.7.0/tests/test_document.py 2022-07-25 08:39:55.000000000 +0200 +++ new/dominate-2.8.0/tests/test_document.py 2023-03-05 22:15:17.000000000 +0100 @@ -110,6 +110,9 @@ <body></body> </html>''' +def test_repr(): + d = document(title='foo') + assert d.__repr__() == '<dominate.document "foo">' if __name__ == '__main__': # test_doc() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.7.0/tests/test_dom1core.py new/dominate-2.8.0/tests/test_dom1core.py --- old/dominate-2.7.0/tests/test_dom1core.py 2022-07-25 08:39:55.000000000 +0200 +++ new/dominate-2.8.0/tests/test_dom1core.py 2023-03-05 22:15:17.000000000 +0100 @@ -13,9 +13,10 @@ assert container.getElementById('base') is dom assert container.getElementById('span1') is s1 assert container.getElementById('span3') is s3 + assert container.getElementById('foo') is None assert container.getElementsByTagName('span') == [s1, s2, s3] assert container.getElementsByTagName('SPAN') == [s1, s2, s3] - + assert container.getElementsByTagName(1234) is None def test_element(): d = div( @@ -25,3 +26,9 @@ with pytest.raises(ValueError): d.getElementById('a') +def test_parent_node(): + parent = div(id='parent') + child = div(id='child') + parent.add(child) + + assert child.parentNode is parent diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.7.0/tests/test_dom_tag.py new/dominate-2.8.0/tests/test_dom_tag.py --- old/dominate-2.7.0/tests/test_dom_tag.py 1970-01-01 01:00:00.000000000 +0100 +++ new/dominate-2.8.0/tests/test_dom_tag.py 2023-05-21 21:32:15.000000000 +0200 @@ -0,0 +1,81 @@ +import pytest +try: + import mock +except ImportError: + import unittest.mock as mock + +from dominate.tags import * + +from dominate import dom_tag as sut + +def test___get_thread_context(monkeypatch): + greenlet = mock.Mock() + greenlet.getcurrent.return_value = 100 + monkeypatch.setattr(sut, 'greenlet', greenlet) + + threading = mock.Mock() + threading.current_thread.return_value = 200 + monkeypatch.setattr(sut, 'threading', threading) + + assert sut._get_thread_context() in [ + -6805948436281256182, # Python >= 3.9 + 3713141171098444831, # Python < 3.9 + ] + +def test_add_raw_string(): + container = div() + container.add_raw_string('foo') + assert container.children == ['foo'] + +def test_clear(): + container = div() + child = div() + container.add(child) + + assert container.children == [child] + assert child.parent == container + + container.clear() + + assert container.children == [] + assert child.parent is None + +def test_set_attribute(): + container = div() + container.add_raw_string('foo') + container.set_attribute(0, 'bar') + + assert container.children == ['bar'] + +def test_set_attribute_error(): + container = div() + with pytest.raises(TypeError, match=( + 'Only integer and string types are valid for assigning ' + 'child tags and attributes, respectively.' + )): + container.set_attribute(1.0, 'foo') + +def test___get_item___child_index_error(): + d = div() + with pytest.raises(IndexError, match='Child with index "10" does not exist.'): + d[10] + +def test___contains__(): + container = div() + container.add(div()) + assert 'div' in container + +def test_nested_context(): + def sub(*args): + with div('B') as B: + B.add(*args) + + with div('A') as A: + sub(div('C')) + + assert str(A) == \ +'''<div>A + <div>B + <div>C</div> + </div> +</div>''' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dominate-2.7.0/tests/test_dominate.py new/dominate-2.8.0/tests/test_dominate.py --- old/dominate-2.7.0/tests/test_dominate.py 2022-07-25 08:39:55.000000000 +0200 +++ new/dominate-2.8.0/tests/test_dominate.py 2023-05-21 21:32:15.000000000 +0200 @@ -6,7 +6,7 @@ def test_version(): import dominate - version = '2.7.0' + version = '2.8.0' assert dominate.version == version assert dominate.__version__ == version