Hackfut Security File Manager
Current Path:
/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/testing
opt
/
alt
/
python27
/
lib64
/
python2.7
/
site-packages
/
sqlalchemy
/
testing
/
📁
..
📄
__init__.py
(1.12 KB)
📄
__init__.pyc
(1.84 KB)
📄
__init__.pyo
(1.84 KB)
📄
assertions.py
(16.64 KB)
📄
assertions.pyc
(20.71 KB)
📄
assertions.pyo
(19.03 KB)
📄
assertsql.py
(12.29 KB)
📄
assertsql.pyc
(14.05 KB)
📄
assertsql.pyo
(13.78 KB)
📄
config.py
(2.67 KB)
📄
config.pyc
(4.1 KB)
📄
config.pyo
(4.01 KB)
📄
engines.py
(9.29 KB)
📄
engines.pyc
(14.47 KB)
📄
engines.pyo
(14.38 KB)
📄
entities.py
(2.92 KB)
📄
entities.pyc
(3.12 KB)
📄
entities.pyo
(3.12 KB)
📄
exclusions.py
(12.35 KB)
📄
exclusions.pyc
(19.3 KB)
📄
exclusions.pyo
(19.13 KB)
📄
fixtures.py
(10.47 KB)
📄
fixtures.pyc
(16.16 KB)
📄
fixtures.pyo
(16.08 KB)
📄
mock.py
(630 B)
📄
mock.pyc
(664 B)
📄
mock.pyo
(664 B)
📄
pickleable.py
(2.58 KB)
📄
pickleable.pyc
(7.7 KB)
📄
pickleable.pyo
(7.7 KB)
📁
plugin
📄
profiling.py
(8.2 KB)
📄
profiling.pyc
(8.5 KB)
📄
profiling.pyo
(8.5 KB)
📄
provision.py
(10.13 KB)
📄
provision.pyc
(13.72 KB)
📄
provision.pyo
(13.72 KB)
📄
replay_fixture.py
(5.3 KB)
📄
replay_fixture.pyc
(7.5 KB)
📄
replay_fixture.pyo
(7.5 KB)
📄
requirements.py
(22.16 KB)
📄
requirements.pyc
(37.59 KB)
📄
requirements.pyo
(37.59 KB)
📄
runner.py
(1.55 KB)
📄
runner.pyc
(1.84 KB)
📄
runner.pyo
(1.84 KB)
📄
schema.py
(3.47 KB)
📄
schema.pyc
(3.18 KB)
📄
schema.pyo
(3.18 KB)
📁
suite
📄
util.py
(7.36 KB)
📄
util.pyc
(10.67 KB)
📄
util.pyo
(10.63 KB)
📄
warnings.py
(1.27 KB)
📄
warnings.pyc
(1.37 KB)
📄
warnings.pyo
(1.37 KB)
Editing: entities.py
# testing/entities.py # Copyright (C) 2005-2017 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import sqlalchemy as sa from sqlalchemy import exc as sa_exc _repr_stack = set() class BasicEntity(object): def __init__(self, **kw): for key, value in kw.items(): setattr(self, key, value) def __repr__(self): if id(self) in _repr_stack: return object.__repr__(self) _repr_stack.add(id(self)) try: return "%s(%s)" % ( (self.__class__.__name__), ', '.join(["%s=%r" % (key, getattr(self, key)) for key in sorted(self.__dict__.keys()) if not key.startswith('_')])) finally: _repr_stack.remove(id(self)) _recursion_stack = set() class ComparableEntity(BasicEntity): def __hash__(self): return hash(self.__class__) def __ne__(self, other): return not self.__eq__(other) def __eq__(self, other): """'Deep, sparse compare. Deeply compare two entities, following the non-None attributes of the non-persisted object, if possible. """ if other is self: return True elif not self.__class__ == other.__class__: return False if id(self) in _recursion_stack: return True _recursion_stack.add(id(self)) try: # pick the entity that's not SA persisted as the source try: self_key = sa.orm.attributes.instance_state(self).key except sa.orm.exc.NO_STATE: self_key = None if other is None: a = self b = other elif self_key is not None: a = other b = self else: a = self b = other for attr in list(a.__dict__): if attr.startswith('_'): continue value = getattr(a, attr) try: # handle lazy loader errors battr = getattr(b, attr) except (AttributeError, sa_exc.UnboundExecutionError): return False if hasattr(value, '__iter__'): if hasattr(value, '__getitem__') and not hasattr( value, 'keys'): if list(value) != list(battr): return False else: if set(value) != set(battr): return False else: if value is not None and value != battr: return False return True finally: _recursion_stack.remove(id(self))
Upload File
Create Folder