Hello community,

here is the log from the commit of package python-moretools for 
openSUSE:Factory checked in at 2019-07-31 14:29:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-moretools (Old)
 and      /work/SRC/openSUSE:Factory/.python-moretools.new.4126 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-moretools"

Wed Jul 31 14:29:11 2019 rev:4 rq:719834 version:0.1.10

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-moretools/python-moretools.changes        
2019-05-22 15:42:24.654426956 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-moretools.new.4126/python-moretools.changes  
    2019-07-31 14:29:25.974079730 +0200
@@ -1,0 +2,6 @@
+Tue Jul 23 14:04:27 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 0.1.10:
+  * no upstream changelog
+
+-------------------------------------------------------------------

Old:
----
  moretools-0.1.9.tar.gz

New:
----
  moretools-0.1.10.tar.gz

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

Other differences:
------------------
++++++ python-moretools.spec ++++++
--- /var/tmp/diff_new_pack.HVSHAo/_old  2019-07-31 14:29:26.934078953 +0200
+++ /var/tmp/diff_new_pack.HVSHAo/_new  2019-07-31 14:29:26.934078953 +0200
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-moretools
-Version:        0.1.9
+Version:        0.1.10
 Release:        0
 Summary:        MORE Overly Reusable Essentials for Python
 License:        LGPL-3.0-only

++++++ moretools-0.1.9.tar.gz -> moretools-0.1.10.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/moretools-0.1.9/PKG-INFO 
new/moretools-0.1.10/PKG-INFO
--- old/moretools-0.1.9/PKG-INFO        2019-04-03 05:20:46.000000000 +0200
+++ new/moretools-0.1.10/PKG-INFO       2019-06-04 13:59:00.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: moretools
-Version: 0.1.9
+Version: 0.1.10
 Summary: MORE Overly Reusable Essentials for python
 Home-page: https://github.com/zimmermanncode/moretools
 Author: Stefan Zimmermann
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/moretools-0.1.9/VERSION new/moretools-0.1.10/VERSION
--- old/moretools-0.1.9/VERSION 2019-04-03 05:20:42.000000000 +0200
+++ new/moretools-0.1.10/VERSION        2019-06-04 13:58:54.000000000 +0200
@@ -1 +1 @@
-0.1.9
\ No newline at end of file
+0.1.10
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/moretools-0.1.9/moretools/_simpletree.py 
new/moretools-0.1.10/moretools/_simpletree.py
--- old/moretools-0.1.9/moretools/_simpletree.py        2019-04-02 
22:44:40.000000000 +0200
+++ new/moretools-0.1.10/moretools/_simpletree.py       2019-06-04 
13:44:02.000000000 +0200
@@ -3,14 +3,48 @@
 from abc import ABCMeta, abstractmethod, abstractproperty
 from inspect import isclass
 
-from six import reraise, with_metaclass
+from six import PY2, reraise, with_metaclass
 import zetup
 
 import moretools
+from moretools import qualname
+
+from ._cached import cached
 
 __all__ = ('SimpleTree', )
 
 
+class ContextStack(zetup.object):
+
+    def __init__(self, _type):
+        self._list = []
+        self._type = _type
+
+    def __contains__(self, tree):
+        if not isinstance(tree, self._type):
+            raise TypeError(
+                "{!r} is for instances of {!r}, not {!r}"
+                .format(self, self._type, type(tree)))
+
+        for item in self._list:
+            if item is tree:
+                return True
+
+        return False
+
+    def __iter__(self):
+        return iter(self._list)
+
+    def __bool__(self):
+        return bool(self._list)
+
+    if PY2:
+        __nonzero__ = __bool__
+
+    def __repr__(self):
+        return repr(self._list)
+
+
 class SimpleTreeMeta(zetup.meta, ABCMeta):
     """
     Metaclass for abstract :class:`moretools.SimpleTree`.
@@ -30,11 +64,26 @@
         if mcs.context_stack is None:
 
             class meta(mcs):
-                context_stack = []
+                pass
 
         else:
             meta = mcs
-        return ABCMeta.__new__(meta, clsname, bases, clsattrs)
+        cls = ABCMeta.__new__(meta, clsname, bases, clsattrs)
+        if meta.context_stack is None:
+            meta.context_stack = ContextStack(cls)
+        return cls
+
+    @property
+    @cached
+    def root(cls):
+        class root(cls):
+
+            __module__ = cls.__module__
+            __qualname__ = "{}.root".format(qualname(cls))
+
+            _is_simpletree_root = True
+
+        return root
 
 
 class SimpleTree(with_metaclass(SimpleTreeMeta, zetup.object)):
@@ -105,15 +154,17 @@
     __package__ = moretools
 
     def __init__(self, parent=None):
-        if parent is None:
-            meta = type(type(self))
+        cls = type(self)
+        if parent is None and not getattr(
+                cls, '_is_simpletree_root', False):
+            meta = type(cls)
             if meta.context_stack:
-                parent = meta.context_stack[-1]
-        self.parent = parent
+                parent = meta.context_stack._list[-1]
 
-        cls = type(self)
+        self.parent = parent
         if isclass(cls.sub):
-            self.sub = cls.sub(owner=self)
+            self.sub = cls.sub(  # pylint: disable=no-value-for-parameter
+                owner=self)
 
     def root(self):
         """
@@ -127,7 +178,7 @@
         return tree
 
     @abstractproperty
-    def parent(self):
+    def parent(self):  # pylint: disable=method-hidden
         """
         Get and set parent tree of this sub-tree.
 
@@ -157,15 +208,19 @@
 
     def __enter__(self):
         meta = type(type(self))
-        meta.context_stack.append(self)
+        assert self not in meta.context_stack, (
+            "Attempt to put same instance twice into .context_stack of {!r}"
+            .format(meta))
+
+        meta.context_stack._list.append(self)
         return self
 
     def __exit__(self, *exc_info):
         meta = type(type(self))
         stack = meta.context_stack
-        assert stack and stack[-1] is self, (
+        assert stack and stack._list[-1] is self, (
             "Corrupted .context_stack of {!r}".format(meta))
 
-        meta.context_stack.pop(-1)
+        meta.context_stack._list.pop(-1)
         if exc_info[0] is not None:
             reraise(*exc_info)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/moretools-0.1.9/moretools/zetup_config.py 
new/moretools-0.1.10/moretools/zetup_config.py
--- old/moretools-0.1.9/moretools/zetup_config.py       2019-04-03 
05:20:42.000000000 +0200
+++ new/moretools-0.1.10/moretools/zetup_config.py      2019-06-04 
13:58:54.000000000 +0200
@@ -106,7 +106,7 @@
 
 SETUP_HOOKS = []
 
-VERSION = Version('0.1.9')
+VERSION = Version('0.1.10')
 
 KEEP_MADE = []
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/moretools-0.1.9/moretools.egg-info/PKG-INFO 
new/moretools-0.1.10/moretools.egg-info/PKG-INFO
--- old/moretools-0.1.9/moretools.egg-info/PKG-INFO     2019-04-03 
05:20:44.000000000 +0200
+++ new/moretools-0.1.10/moretools.egg-info/PKG-INFO    2019-06-04 
13:58:57.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: moretools
-Version: 0.1.9
+Version: 0.1.10
 Summary: MORE Overly Reusable Essentials for python
 Home-page: https://github.com/zimmermanncode/moretools
 Author: Stefan Zimmermann


Reply via email to