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

Side by Side Diff: third_party/twisted_8_1/twisted/conch/avatar.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.conch.test.test_conch -*-
2 from interfaces import IConchUser
3 from error import ConchError
4 from ssh.connection import OPEN_UNKNOWN_CHANNEL_TYPE
5 from twisted.python import log
6 from zope import interface
7
8 class ConchUser:
9 interface.implements(IConchUser)
10
11 def __init__(self):
12 self.channelLookup = {}
13 self.subsystemLookup = {}
14
15 def lookupChannel(self, channelType, windowSize, maxPacket, data):
16 klass = self.channelLookup.get(channelType, None)
17 if not klass:
18 raise ConchError(OPEN_UNKNOWN_CHANNEL_TYPE, "unknown channel")
19 else:
20 return klass(remoteWindow = windowSize,
21 remoteMaxPacket = maxPacket,
22 data=data, avatar=self)
23
24 def lookupSubsystem(self, subsystem, data):
25 log.msg(repr(self.subsystemLookup))
26 klass = self.subsystemLookup.get(subsystem, None)
27 if not klass:
28 return False
29 return klass(data, avatar=self)
30
31 def gotGlobalRequest(self, requestType, data):
32 # XXX should this use method dispatch?
33 requestType = requestType.replace('-','_')
34 f = getattr(self, "global_%s" % requestType, None)
35 if not f:
36 return 0
37 return f(data)
OLDNEW
« no previous file with comments | « third_party/twisted_8_1/twisted/conch/_version.py ('k') | third_party/twisted_8_1/twisted/conch/checkers.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698