Home | Trees | Indices | Help |
---|
|
1 # -*- coding: utf-8 - 2 # 3 # This file is part of restkit released under the MIT license. 4 # See the NOTICE for more information. 5 6 from socketpool import ConnectionPool 7 from restkit.conn import Connection 8 9 10 _default_session = {} 1113 global _default_session 14 15 if not _default_session: 16 _default_session = {} 17 pool = ConnectionPool(factory=Connection, 18 backend=backend_name, **options) 19 _default_session[backend_name] = pool 20 else: 21 if backend_name not in _default_session: 22 pool = ConnectionPool(factory=Connection, 23 backend=backend_name, **options) 24 25 _default_session[backend_name] = pool 26 else: 27 pool = _default_session.get(backend_name) 28 return pool2931 32 global _default_session 33 34 if not _default_session: 35 _default_session = {} 36 37 if backend_name in _default_session: 38 pool = _default_session.get(backend_name) 39 else: 40 pool = ConnectionPool(factory=Connection, 41 backend=backend_name, **options) 42 _default_session[backend_name] = pool 43 return pool44
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Sat Feb 9 17:17:57 2013 | http://epydoc.sourceforge.net |