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

Side by Side Diff: third_party/twisted_8_1/twisted/protocols/finger.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 # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
2 # See LICENSE for details.
3
4
5 """The Finger User Information Protocol (RFC 1288)"""
6
7 from twisted.protocols import basic
8 import string
9
10 class Finger(basic.LineReceiver):
11
12 def lineReceived(self, line):
13 parts = string.split(line)
14 if not parts:
15 parts = ['']
16 if len(parts) == 1:
17 slash_w = 0
18 else:
19 slash_w = 1
20 user = parts[-1]
21 if '@' in user:
22 host_place = string.rfind(user, '@')
23 user = user[:host_place]
24 host = user[host_place+1:]
25 return self.forwardQuery(slash_w, user, host)
26 if user:
27 return self.getUser(slash_w, user)
28 else:
29 return self.getDomain(slash_w)
30
31 def _refuseMessage(self, message):
32 self.transport.write(message+"\n")
33 self.transport.loseConnection()
34
35 def forwardQuery(self, slash_w, user, host):
36 self._refuseMessage('Finger forwarding service denied')
37
38 def getDomain(self, slash_w):
39 self._refuseMessage('Finger online list denied')
40
41 def getUser(self, slash_w, user):
42 self.transport.write('Login: '+user+'\n')
43 self._refuseMessage('No such user')
OLDNEW
« no previous file with comments | « third_party/twisted_8_1/twisted/protocols/ethernet.py ('k') | third_party/twisted_8_1/twisted/protocols/ftp.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698