X-FeedAbuse: http://nntpfeed.proxad.net/abuse.pl feeded by 195.154.70.45 Path: csiph.com!usenet.pasdenom.info!nntpfeed.proxad.net!news.redatomik.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-announce-list@python.org Delivered-To: python-announce-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'url:pypi': 0.03; 'sys': 0.07; '__name__': 0.09; 'api': 0.11; 'python': 0.11; 'def': 0.12; '"""use': 0.16; "'__main__':": 0.16; '__future__': 0.16; 'blocking': 0.16; 'manner,': 0.16; 'to:addr:python-announce-list': 0.16; 'twisted': 0.16; 'library': 0.18; 'import': 0.22; 'setup,': 0.24; 'code:': 0.26; 'to:2**1': 0.27; 'code': 0.31; 'easier': 0.31; 'regular': 0.32; 'url:python': 0.33; 'received:10.20': 0.33; 'skip:d 20': 0.34; 'limitations': 0.36; 'url:org': 0.36; 'application': 0.37; 'received:10': 0.37; 'to:addr:python.org': 0.39; 'new': 0.61; 'name': 0.63; 'skip:r 30': 0.69; '3.4': 0.84 X-Virus-Scanned: amavisd-new at kolabsys.net X-Spam-Flag: NO X-Spam-Score: -1.001 X-Spam-Level: X-Spam-Status: No, score=-1.001 tagged_above=-10 required=6.31 tests=[ALL_TRUSTED=-1, BAYES_40=-0.001] autolearn=ham Date: Wed, 06 May 2015 21:03:11 -0400 From: Itamar Turner-Trauring To: Twisted general discussion , python-announce-list@python.org Subject: Crochet 1.4.0: use Twisted anywhere! Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Fri, 08 May 2015 09:59:28 +0200 X-BeenThere: python-announce-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: Announcement-only list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Approved: python-announce-list@python.org Newsgroups: comp.lang.python.announce Message-ID: Lines: 34 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1431071969 news.xs4all.nl 2844 [2001:888:2000:d::a6]:36387 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python.announce:1693 Crochet is an MIT-licensed library that makes it easier to use Twisted from regular blocking code: from __future__ import print_function from twisted.names import client from crochet import setup, wait_for setup() @wait_for(timeout=5.0) def gethostbyname(name): """Use the Twisted DNS library.""" d = client.lookupAddress(name) d.addCallback(lambda result: result[0][0].payload.dottedQuad()) return d if __name__ == '__main__': # Application code using the public API - notice it works in a normal # blocking manner, with no event loop visible: import sys name = sys.argv[1] ip = gethostbyname(name) print(name, "->", ip) New in 1.4.0 is Python 3.4 support as well as support for using Crochet with uWSGI, and additional documentation on workarounds for various limitations of Crochet. https://pypi.python.org/pypi/crochet for downloads. https://crochet.readthedocs.org/ for documentation. --Itamar Turner-Trauring