Trololio-1.0/0000755000175000017500000000000013324661544012527 5ustar sergiosergioTrololio-1.0/PKG-INFO0000666000175000017500000000345012431503100013607 0ustar sergiosergioMetadata-Version: 1.1 Name: Trololio Version: 1.0 Summary: Trollius and asyncio compatibility library Home-page: http://github.com/ThinkChaos/Trololio/ Author: ThinkChaos Author-email: ThinkChaos@users.noreply.github.com License: MIT Description: #################################################### Trololio: Trollius and asyncio compatibility library #################################################### Trololio provides a compatibility layer for Trollius and asyncio (aka Tulip). It addresses the differences listed in `Trollius and Tulip `_: * Allows the use of Trollius' syntax with asyncio. * Provides missing objects and aliases for the others. * Synchronizes debug environnement variables. ***** Links ***** * `Trololio documentation `_ * `Trollius documentation `_ * `asyncio documentation `_ Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: Natural Language :: English Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 Classifier: Topic :: Software Development :: Libraries :: Python Modules Trololio-1.0/trololio.py0000666000175000017500000000760312427753460014760 0ustar sergiosergiofrom imp import find_module, load_module import os __all__ = [ 'ASYNCIO', 'TROLLIUS', 'asyncio', 'coroutine', 'From', 'Return', # OSError and socket.error exceptions 'BlockingIOError', 'BrokenPipeError', 'ChildProcessError', 'ConnectionAbortedError', 'ConnectionRefusedError', 'ConnectionResetError', 'FileNotFoundError', 'InterruptedError', 'PermissionError', # SSLError 'BACKPORT_SSL_ERRORS', 'SSLEOFError', 'SSLWantReadError', 'SSLWantWriteError', # SSLContext 'BACKPORT_SSL_CONTEXT', 'SSLContext' ] for _mod_name in ['trollius', 'asyncio']: try: _mod_file, _mod_pathname, _mod_description = find_module(_mod_name) except ImportError: asyncio = None else: ASYNCIO = _mod_name == 'asyncio' TROLLIUS = not ASYNCIO asyncio = load_module( 'trololio.asyncio', _mod_file, _mod_pathname, _mod_description ) if _mod_file is not None: _mod_file.close() break if asyncio is None: # Generate a nice traceback import trollius _asyncio_debug = os.environ.get('PYTHONASYNCIODEBUG') in ['0', '1'] _trollius_debug = os.environ.get('TROLLIUSDEBUG') in ['0', '1'] if _asyncio_debug and not _trollius_debug: os.environ['TROLLIUSDEBUG'] = os.environ['PYTHONASYNCIODEBUG'] elif _trollius_debug and not _asyncio_debug: os.environ['PYTHONASYNCIODEBUG'] = os.environ['TROLLIUSDEBUG'] if TROLLIUS: from trololio.asyncio import ( coroutine, From, Return, # OSError and socket.error exceptions BlockingIOError, BrokenPipeError, ChildProcessError, ConnectionAbortedError, ConnectionRefusedError, ConnectionResetError, FileNotFoundError, InterruptedError, PermissionError, # SSLError BACKPORT_SSL_ERRORS, SSLEOFError, SSLWantReadError, SSLWantWriteError, # SSLContext BACKPORT_SSL_CONTEXT, SSLContext ) else: # trollius/coroutines.py def From(obj): return obj class Return(Exception): def __init__(self, *args): if not args: self.value = None elif len(args) == 1: self.value = args[0] else: self.value = args from builtins import ( # OSError and socket.error exceptions BlockingIOError, BrokenPipeError, ChildProcessError, ConnectionAbortedError, ConnectionRefusedError, ConnectionResetError, FileNotFoundError, InterruptedError, PermissionError, ) BACKPORT_SSL_CONTEXT = False BACKPORT_SSL_ERRORS = False from ssl import ( # SSLError SSLEOFError, SSLWantReadError, SSLWantWriteError, # SSLContext SSLContext ) from textwrap import dedent # exec is required because of `yield from` SyntaxError in Py2 # exec on definition instead of on every yield for less overhead exec(dedent( """ from functools import wraps from inspect import isgeneratorfunction def coroutine(func): if not isgeneratorfunction(func): coro = asyncio.coroutine(func) else: @wraps(func) def coro(*args, **kwargs): gen = func(*args, **kwargs) for coro_or_fut in gen: res = yield from coro_or_fut gen.send(res) @wraps(coro) def return_handler(*args, **kwargs): try: res = yield from coro(*args, **kwargs) except Return as res: return res.value else: return res return asyncio.coroutine(return_handler) """ )) del dedent del ( find_module, load_module, os, _mod_description, _mod_file, _mod_name, _mod_pathname, _asyncio_debug, _trollius_debug ) Trololio-1.0/README.rst0000666000175000017500000000132212403145756014217 0ustar sergiosergio#################################################### Trololio: Trollius and asyncio compatibility library #################################################### Trololio provides a compatibility layer for Trollius and asyncio (aka Tulip). It addresses the differences listed in `Trollius and Tulip `_: * Allows the use of Trollius' syntax with asyncio. * Provides missing objects and aliases for the others. * Synchronizes debug environnement variables. ***** Links ***** * `Trololio documentation `_ * `Trollius documentation `_ * `asyncio documentation `_ Trololio-1.0/setup.cfg0000666000175000017500000000014012431503100014324 0ustar sergiosergio[bdist_wheel] universal = 1 [egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 Trololio-1.0/setup.py0000666000175000017500000000220512427754230014242 0ustar sergiosergioimport os from setuptools import setup def read(*paths): with open(os.path.join(*paths), 'r') as f: return f.read() setup( name='Trololio', version='1.0', description='Trollius and asyncio compatibility library', long_description=read('README.rst'), url='http://github.com/ThinkChaos/Trololio/', license='MIT', author='ThinkChaos', author_email='ThinkChaos@users.noreply.github.com', py_modules=['trololio'], include_package_data=True, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Natural Language :: English', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Topic :: Software Development :: Libraries :: Python Modules', ], ) Trololio-1.0/Trololio.egg-info/0000755000175000017500000000000013324661544016024 5ustar sergiosergioTrololio-1.0/Trololio.egg-info/PKG-INFO0000666000175000017500000000345012431503100017104 0ustar sergiosergioMetadata-Version: 1.1 Name: Trololio Version: 1.0 Summary: Trollius and asyncio compatibility library Home-page: http://github.com/ThinkChaos/Trololio/ Author: ThinkChaos Author-email: ThinkChaos@users.noreply.github.com License: MIT Description: #################################################### Trololio: Trollius and asyncio compatibility library #################################################### Trololio provides a compatibility layer for Trollius and asyncio (aka Tulip). It addresses the differences listed in `Trollius and Tulip `_: * Allows the use of Trollius' syntax with asyncio. * Provides missing objects and aliases for the others. * Synchronizes debug environnement variables. ***** Links ***** * `Trololio documentation `_ * `Trollius documentation `_ * `asyncio documentation `_ Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: Natural Language :: English Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 Classifier: Topic :: Software Development :: Libraries :: Python Modules Trololio-1.0/Trololio.egg-info/dependency_links.txt0000666000175000017500000000000112431503100022053 0ustar sergiosergio Trololio-1.0/Trololio.egg-info/SOURCES.txt0000666000175000017500000000025112431503100017667 0ustar sergiosergioREADME.rst setup.cfg setup.py trololio.py Trololio.egg-info/PKG-INFO Trololio.egg-info/SOURCES.txt Trololio.egg-info/dependency_links.txt Trololio.egg-info/top_level.txtTrololio-1.0/Trololio.egg-info/top_level.txt0000666000175000017500000000001112431503100020527 0ustar sergiosergiotrololio