Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: third_party/twisted_8_1/twisted/words/protocols/jabber/jstrports.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 # -*- test-case-name: twisted.words.test -*-
2 # Copyright (c) 2001-2005 Twisted Matrix Laboratories.
3 # See LICENSE for details.
4
5
6 """ A temporary placeholder for client-capable strports, until we
7 sufficient use cases get identified """
8
9 from twisted.application import strports
10
11 def _parseTCPSSL(factory, domain, port):
12 """ For the moment, parse TCP or SSL connections the same """
13 return (domain, int(port), factory), {}
14
15 def _parseUNIX(factory, address):
16 return (address, factory), {}
17
18
19 _funcs = { "tcp" : _parseTCPSSL,
20 "unix" : _parseUNIX,
21 "ssl" : _parseTCPSSL }
22
23
24 def parse(description, factory):
25 args, kw = strports._parse(description)
26 return (args[0].upper(),) + _funcs[args[0]](factory, *args[1:], **kw)
27
28 def client(description, factory):
29 from twisted.application import internet
30 name, args, kw = parse(description, factory)
31 return getattr(internet, name + 'Client')(*args, **kw)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698