X7ROOT File Manager
Current Path:
/usr/lib64/python2.7/site-packages/zope/interface
usr
/
lib64
/
python2.7
/
site-packages
/
zope
/
interface
/
📁
..
📄
__init__.py
(3.29 KB)
📄
__init__.pyc
(2.64 KB)
📄
__init__.pyo
(2.64 KB)
📄
_compat.py
(1.82 KB)
📄
_compat.pyc
(2.21 KB)
📄
_compat.pyo
(2.21 KB)
📄
_flatten.py
(1.03 KB)
📄
_flatten.pyc
(698 B)
📄
_flatten.pyo
(698 B)
📄
_zope_interface_coptimizations.so
(31.73 KB)
📄
adapter.py
(22.51 KB)
📄
adapter.pyc
(18.89 KB)
📄
adapter.pyo
(18.89 KB)
📄
advice.py
(7.37 KB)
📄
advice.pyc
(5.42 KB)
📄
advice.pyo
(5.38 KB)
📁
common
📄
declarations.py
(27.17 KB)
📄
declarations.pyc
(24.34 KB)
📄
declarations.pyo
(24.34 KB)
📄
document.py
(3.38 KB)
📄
document.pyc
(2.72 KB)
📄
document.pyo
(2.72 KB)
📄
exceptions.py
(1.95 KB)
📄
exceptions.pyc
(3.21 KB)
📄
exceptions.pyo
(3.21 KB)
📄
interface.py
(20.63 KB)
📄
interface.pyc
(22.51 KB)
📄
interface.pyo
(22.51 KB)
📄
interfaces.py
(42.1 KB)
📄
interfaces.pyc
(54.78 KB)
📄
interfaces.pyo
(54.78 KB)
📄
registry.py
(18.18 KB)
📄
registry.pyc
(19.77 KB)
📄
registry.pyo
(19.72 KB)
📄
ro.py
(2.07 KB)
📄
ro.pyc
(1.59 KB)
📄
ro.pyo
(1.59 KB)
📄
verify.py
(4.62 KB)
📄
verify.pyc
(3.17 KB)
📄
verify.pyo
(3.17 KB)
Editing: ro.py
############################################################################## # # Copyright (c) 2003 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Compute a resolution order for an object and its bases """ __docformat__ = 'restructuredtext' def ro(object): """Compute a "resolution order" for an object """ return mergeOrderings([_flatten(object)]) def mergeOrderings(orderings, seen=None): """Merge multiple orderings so that within-ordering order is preserved Orderings are constrained in such a way that if an object appears in two or more orderings, then the suffix that begins with the object must be in both orderings. For example: >>> mergeOrderings([ ... ['x', 'y', 'z'], ... ['q', 'z'], ... [1, 3, 5], ... ['z'] ... ]) ['x', 'y', 'q', 1, 3, 5, 'z'] """ if seen is None: seen = {} result = [] orderings.reverse() for ordering in orderings: ordering = list(ordering) ordering.reverse() for o in ordering: if o not in seen: seen[o] = 1 result.append(o) result.reverse() return result def _flatten(ob): result = [ob] i = 0 for ob in iter(result): i += 1 # The recursive calls can be avoided by inserting the base classes # into the dynamically growing list directly after the currently # considered object; the iterator makes sure this will keep working # in the future, since it cannot rely on the length of the list # by definition. result[i:i] = ob.__bases__ return result
Upload File
Create Folder