Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-jsonpointer for 
openSUSE:Factory checked in at 2021-12-09 19:45:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-jsonpointer (Old)
 and      /work/SRC/openSUSE:Factory/.python-jsonpointer.new.2520 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-jsonpointer"

Thu Dec  9 19:45:16 2021 rev:17 rq:936092 version:2.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-jsonpointer/python-jsonpointer.changes    
2021-11-09 23:54:05.715936870 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-jsonpointer.new.2520/python-jsonpointer.changes
  2021-12-09 19:45:30.081130138 +0100
@@ -1,0 +2,7 @@
+Mon Dec  6 18:00:47 UTC 2021 - Dirk M??ller <dmuel...@suse.com>
+
+- update to 2.2:
+  * Add method and add classmethod tag
+  * Add test for get_parts 
+
+-------------------------------------------------------------------

Old:
----
  jsonpointer-2.1.tar.gz

New:
----
  jsonpointer-2.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-jsonpointer.spec ++++++
--- /var/tmp/diff_new_pack.kK1S6u/_old  2021-12-09 19:45:30.717130444 +0100
+++ /var/tmp/diff_new_pack.kK1S6u/_new  2021-12-09 19:45:30.721130446 +0100
@@ -24,7 +24,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-jsonpointer
-Version:        2.1
+Version:        2.2
 Release:        0
 Summary:        Module to identify specific nodes in a JSON document
 License:        BSD-3-Clause
@@ -39,7 +39,7 @@
 BuildRequires:  alts
 %else
 Requires(post): update-alternatives
-Requires(preun): update-alternatives
+Requires(preun):update-alternatives
 %endif
 BuildArch:      noarch
 %python_subpackages

++++++ jsonpointer-2.1.tar.gz -> jsonpointer-2.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-2.1/PKG-INFO new/jsonpointer-2.2/PKG-INFO
--- old/jsonpointer-2.1/PKG-INFO        2021-03-13 19:56:06.000000000 +0100
+++ new/jsonpointer-2.2/PKG-INFO        2021-11-04 14:24:48.000000000 +0100
@@ -1,34 +1,11 @@
 Metadata-Version: 2.1
 Name: jsonpointer
-Version: 2.1
+Version: 2.2
 Summary:  Identify specific nodes in a JSON document (RFC 6901) 
 Home-page: https://github.com/stefankoegl/python-json-pointer
 Author: Stefan K??gl
 Author-email: ste...@skoegl.net
 License: Modified BSD License
-Description: python-json-pointer
-        ===================
-        
-        [![PyPI 
version](https://img.shields.io/pypi/v/jsonpointer.svg)](https://pypi.python.org/pypi/jsonpointer/)
-        [![Supported Python 
versions](https://img.shields.io/pypi/pyversions/jsonpointer.svg)](https://pypi.python.org/pypi/jsonpointer/)
-        [![Build 
Status](https://travis-ci.org/stefankoegl/python-json-pointer.svg?branch=master)](https://travis-ci.org/stefankoegl/python-json-pointer)
-        [![Coverage 
Status](https://coveralls.io/repos/stefankoegl/python-json-pointer/badge.svg?branch=master)](https://coveralls.io/r/stefankoegl/python-json-pointer?branch=master)
-        
-        
-        Resolve JSON Pointers in Python
-        -------------------------------
-        
-        Library to resolve JSON Pointers according to
-        [RFC 6901](http://tools.ietf.org/html/rfc6901)
-        
-        See source code for examples
-        * Website: https://github.com/stefankoegl/python-json-pointer
-        * Repository: https://github.com/stefankoegl/python-json-pointer.git
-        * Documentation: https://python-json-pointer.readthedocs.org/
-        * PyPI: https://pypi.python.org/pypi/jsonpointer
-        * Travis CI: https://travis-ci.org/stefankoegl/python-json-pointer
-        * Coveralls: https://coveralls.io/r/stefankoegl/python-json-pointer
-        
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Console
@@ -50,3 +27,30 @@
 Classifier: Topic :: Utilities
 Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
 Description-Content-Type: text/markdown
+License-File: LICENSE.txt
+License-File: AUTHORS
+
+python-json-pointer
+===================
+
+[![PyPI 
version](https://img.shields.io/pypi/v/jsonpointer.svg)](https://pypi.python.org/pypi/jsonpointer/)
+[![Supported Python 
versions](https://img.shields.io/pypi/pyversions/jsonpointer.svg)](https://pypi.python.org/pypi/jsonpointer/)
+[![Build 
Status](https://travis-ci.org/stefankoegl/python-json-pointer.svg?branch=master)](https://travis-ci.org/stefankoegl/python-json-pointer)
+[![Coverage 
Status](https://coveralls.io/repos/stefankoegl/python-json-pointer/badge.svg?branch=master)](https://coveralls.io/r/stefankoegl/python-json-pointer?branch=master)
+
+
+Resolve JSON Pointers in Python
+-------------------------------
+
+Library to resolve JSON Pointers according to
+[RFC 6901](http://tools.ietf.org/html/rfc6901)
+
+See source code for examples
+* Website: https://github.com/stefankoegl/python-json-pointer
+* Repository: https://github.com/stefankoegl/python-json-pointer.git
+* Documentation: https://python-json-pointer.readthedocs.org/
+* PyPI: https://pypi.python.org/pypi/jsonpointer
+* Travis CI: https://travis-ci.org/stefankoegl/python-json-pointer
+* Coveralls: https://coveralls.io/r/stefankoegl/python-json-pointer
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-2.1/jsonpointer.egg-info/PKG-INFO 
new/jsonpointer-2.2/jsonpointer.egg-info/PKG-INFO
--- old/jsonpointer-2.1/jsonpointer.egg-info/PKG-INFO   2021-03-13 
19:56:05.000000000 +0100
+++ new/jsonpointer-2.2/jsonpointer.egg-info/PKG-INFO   2021-11-04 
14:24:48.000000000 +0100
@@ -1,34 +1,11 @@
 Metadata-Version: 2.1
 Name: jsonpointer
-Version: 2.1
+Version: 2.2
 Summary:  Identify specific nodes in a JSON document (RFC 6901) 
 Home-page: https://github.com/stefankoegl/python-json-pointer
 Author: Stefan K??gl
 Author-email: ste...@skoegl.net
 License: Modified BSD License
-Description: python-json-pointer
-        ===================
-        
-        [![PyPI 
version](https://img.shields.io/pypi/v/jsonpointer.svg)](https://pypi.python.org/pypi/jsonpointer/)
-        [![Supported Python 
versions](https://img.shields.io/pypi/pyversions/jsonpointer.svg)](https://pypi.python.org/pypi/jsonpointer/)
-        [![Build 
Status](https://travis-ci.org/stefankoegl/python-json-pointer.svg?branch=master)](https://travis-ci.org/stefankoegl/python-json-pointer)
-        [![Coverage 
Status](https://coveralls.io/repos/stefankoegl/python-json-pointer/badge.svg?branch=master)](https://coveralls.io/r/stefankoegl/python-json-pointer?branch=master)
-        
-        
-        Resolve JSON Pointers in Python
-        -------------------------------
-        
-        Library to resolve JSON Pointers according to
-        [RFC 6901](http://tools.ietf.org/html/rfc6901)
-        
-        See source code for examples
-        * Website: https://github.com/stefankoegl/python-json-pointer
-        * Repository: https://github.com/stefankoegl/python-json-pointer.git
-        * Documentation: https://python-json-pointer.readthedocs.org/
-        * PyPI: https://pypi.python.org/pypi/jsonpointer
-        * Travis CI: https://travis-ci.org/stefankoegl/python-json-pointer
-        * Coveralls: https://coveralls.io/r/stefankoegl/python-json-pointer
-        
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Console
@@ -50,3 +27,30 @@
 Classifier: Topic :: Utilities
 Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
 Description-Content-Type: text/markdown
+License-File: LICENSE.txt
+License-File: AUTHORS
+
+python-json-pointer
+===================
+
+[![PyPI 
version](https://img.shields.io/pypi/v/jsonpointer.svg)](https://pypi.python.org/pypi/jsonpointer/)
+[![Supported Python 
versions](https://img.shields.io/pypi/pyversions/jsonpointer.svg)](https://pypi.python.org/pypi/jsonpointer/)
+[![Build 
Status](https://travis-ci.org/stefankoegl/python-json-pointer.svg?branch=master)](https://travis-ci.org/stefankoegl/python-json-pointer)
+[![Coverage 
Status](https://coveralls.io/repos/stefankoegl/python-json-pointer/badge.svg?branch=master)](https://coveralls.io/r/stefankoegl/python-json-pointer?branch=master)
+
+
+Resolve JSON Pointers in Python
+-------------------------------
+
+Library to resolve JSON Pointers according to
+[RFC 6901](http://tools.ietf.org/html/rfc6901)
+
+See source code for examples
+* Website: https://github.com/stefankoegl/python-json-pointer
+* Repository: https://github.com/stefankoegl/python-json-pointer.git
+* Documentation: https://python-json-pointer.readthedocs.org/
+* PyPI: https://pypi.python.org/pypi/jsonpointer
+* Travis CI: https://travis-ci.org/stefankoegl/python-json-pointer
+* Coveralls: https://coveralls.io/r/stefankoegl/python-json-pointer
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-2.1/jsonpointer.py 
new/jsonpointer-2.2/jsonpointer.py
--- old/jsonpointer-2.1/jsonpointer.py  2021-03-13 19:55:42.000000000 +0100
+++ new/jsonpointer-2.2/jsonpointer.py  2021-11-04 14:24:26.000000000 +0100
@@ -36,7 +36,7 @@
 
 # Will be parsed by setup.py to determine package metadata
 __author__ = 'Stefan K??gl <ste...@skoegl.net>'
-__version__ = '2.1'
+__version__ = '2.2'
 __website__ = 'https://github.com/stefankoegl/python-json-pointer'
 __license__ = 'Modified BSD License'
 
@@ -193,7 +193,7 @@
         for part in self.parts[:-1]:
             doc = self.walk(doc, part)
 
-        return doc, self.get_part(doc, self.parts[-1])
+        return doc, JsonPointer.get_part(doc, self.parts[-1])
 
     def resolve(self, doc, default=_nothing):
         """Resolves the pointer against doc and returns the referenced 
object"""
@@ -228,7 +228,8 @@
         parent[part] = value
         return doc
 
-    def get_part(self, doc, part):
+    @classmethod
+    def get_part(cls, doc, part):
         """Returns the next step in the correct type"""
 
         if isinstance(doc, Mapping):
@@ -239,7 +240,7 @@
             if part == '-':
                 return part
 
-            if not self._RE_ARRAY_INDEX.match(str(part)):
+            if not JsonPointer._RE_ARRAY_INDEX.match(str(part)):
                 raise JsonPointerException("'%s' is not a valid sequence 
index" % part)
 
             return int(part)
@@ -252,12 +253,17 @@
         else:
             raise JsonPointerException("Document '%s' does not support 
indexing, "
                                        "must be mapping/sequence or support 
__getitem__" % type(doc))
+            
+    def get_parts(self):
+        """Returns the list of the parts. For example, 
JsonPointer('/a/b').get_parts() == ['a', 'b']"""
+        
+        return self.parts
 
 
     def walk(self, doc, part):
         """ Walks one step in doc and returns the referenced part """
 
-        part = self.get_part(doc, part)
+        part = JsonPointer.get_part(doc, part)
 
         assert hasattr(doc, '__getitem__'), "invalid document type %s" % 
(type(doc),)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jsonpointer-2.1/tests.py new/jsonpointer-2.2/tests.py
--- old/jsonpointer-2.1/tests.py        2021-03-13 19:55:42.000000000 +0100
+++ new/jsonpointer-2.2/tests.py        2021-11-04 14:24:26.000000000 +0100
@@ -70,10 +70,31 @@
             ptr = JsonPointer(path)
             self.assertEqual(path, ptr.path)
 
-            parts = ptr.parts
+            parts = ptr.get_parts()
+            self.assertEqual(parts, ptr.parts)
             new_ptr = JsonPointer.from_parts(parts)
             self.assertEqual(ptr, new_ptr)
 
+    def test_parts(self):
+        paths = [
+            ("", []),
+            ("/foo", ['foo']),
+            ("/foo/0", ['foo', '0']),
+            ("/", ['']),
+            ("/a~1b", ['a/b']),
+            ("/c%d", ['c%d']),
+            ("/e^f", ['e^f']),
+            ("/g|h", ['g|h']),
+            ("/i\\j", ['i\j']),
+            ("/k\"l", ['k"l']),
+            ("/ ", [' ']),
+            ("/m~0n", ['m~n']),
+            ('/\xee', ['\xee']),
+        ]
+        for path in paths:
+            ptr = JsonPointer(path[0])
+            self.assertEqual(ptr.get_parts(), path[1])
+
 
 class ComparisonTests(unittest.TestCase):
 

Reply via email to