本文整理汇总了Python中twisted.conch.avatar.ConchUser.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python ConchUser.__init__方法的具体用法?Python ConchUser.__init__怎么用?Python ConchUser.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twisted.conch.avatar.ConchUser
的用法示例。
在下文中一共展示了ConchUser.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from twisted.conch.avatar import ConchUser [as 别名]
# 或者: from twisted.conch.avatar.ConchUser import __init__ [as 别名]
def __init__(self, avatarId):
assert self.protocolFactory is not None, (
"When subclassing SSHBaseAvatar, set the "
"`protocolFactory` attribute to a protocol factory`. "
"E.g. `SSHDemoProtocolFactory`")
ConchUser.__init__(self)
self.avatarId = avatarId
self.channelLookup.update({'session': SSHSession})
示例2: __init__
# 需要导入模块: from twisted.conch.avatar import ConchUser [as 别名]
# 或者: from twisted.conch.avatar.ConchUser import __init__ [as 别名]
def __init__(self, username, root):
ConchUser.__init__(self)
self.username = username
self.filesystem = pathutils.FileSystem(root)
self.listeners = {} # dict mapping (interface, port) -> listener
self.channelLookup.update(
{"session": session.SSHSession})
self.subsystemLookup.update(
{"sftp": FileTransferServer})
示例3: __init__
# 需要导入模块: from twisted.conch.avatar import ConchUser [as 别名]
# 或者: from twisted.conch.avatar.ConchUser import __init__ [as 别名]
def __init__(self, siteId, cwd, uid):
ConchUser.__init__(self)
# Allow the user to open a channel of type session. This implementation
# will look up the ISession adapter for this site and use the resulting
# object to authorize any SSH actions.
self.channelLookup['session'] = SSHSession
self.siteId = siteId
self.cwd = cwd
self.uid = uid
示例4: __init__
# 需要导入模块: from twisted.conch.avatar import ConchUser [as 别名]
# 或者: from twisted.conch.avatar.ConchUser import __init__ [as 别名]
def __init__(self, username, authnz, vcs_config):
ConchUser.__init__(self)
self.username = username
self.authnz = authnz
self.vcs_config = vcs_config
self.channelLookup.update({"session": VCSSession})
self.shell = {}
# Find git-shell path.
# Adapted from http://bugs.python.org/file15381/shutil_which.patch
self.path = os.environ.get("PATH", os.defpath)
self.shell['git'] = self._shells_find('git-shell')
# self.shell['hd'] = self._shells_find('hg')
self.shell['hg'] = '/usr/local/bin/hg'
示例5: __init__
# 需要导入模块: from twisted.conch.avatar import ConchUser [as 别名]
# 或者: from twisted.conch.avatar.ConchUser import __init__ [as 别名]
def __init__(self, username):
ConchUser.__init__(self)
self.username = username
self.pwdData = pwd.getpwnam(self.username)
l = [self.pwdData[3]]
for groupname, password, gid, userlist in grp.getgrall():
if username in userlist:
l.append(gid)
self.otherGroups = l
self.listeners = {} # Dict mapping (interface, port) -> listener
self.channelLookup.update(
{"session": session.SSHSession,
"direct-tcpip": forwarding.openConnectForwardingClient})
self.subsystemLookup.update(
{"sftp": filetransfer.FileTransferServer})
示例6: __init__
# 需要导入模块: from twisted.conch.avatar import ConchUser [as 别名]
# 或者: from twisted.conch.avatar.ConchUser import __init__ [as 别名]
def __init__(self, settings, username, api_key):
ConchUser.__init__(self)
self.settings = settings
self.username = username
self.api_key = api_key
self.channelLookup['session'] = SSHSession
示例7: __init__
# 需要导入模块: from twisted.conch.avatar import ConchUser [as 别名]
# 或者: from twisted.conch.avatar.ConchUser import __init__ [as 别名]
def __init__(self, username, meta):
ConchUser.__init__(self)
self.username = username
self.channelLookup.update({"session": SSHSession})
self.meta = meta
示例8: __init__
# 需要导入模块: from twisted.conch.avatar import ConchUser [as 别名]
# 或者: from twisted.conch.avatar.ConchUser import __init__ [as 别名]
def __init__(self, username):
ConchUser.__init__(self)
self.username = username
self.channelLookup.update({"session": GitProcessProtocolSession})
示例9: __init__
# 需要导入模块: from twisted.conch.avatar import ConchUser [as 别名]
# 或者: from twisted.conch.avatar.ConchUser import __init__ [as 别名]
def __init__(self, key):
ConchUser.__init__(self)
# django, authentication model instance for logged in avatar
self.user = key.user
self.project = key.project
self.channelLookup['session'] = GatewaySession
示例10: __init__
# 需要导入模块: from twisted.conch.avatar import ConchUser [as 别名]
# 或者: from twisted.conch.avatar.ConchUser import __init__ [as 别名]
def __init__(self, username, datapath):
ConchUser.__init__(self)
self.username = username
self.datapath = datapath
self.channelLookup["session"] = SSHSession
示例11: __init__
# 需要导入模块: from twisted.conch.avatar import ConchUser [as 别名]
# 或者: from twisted.conch.avatar.ConchUser import __init__ [as 别名]
def __init__(self, avatarId):
ConchUser.__init__(self)
self.email, self.pydas, self.url = avatarId
self.channelLookup['session'] = SSHSession
self.subsystemLookup.update(
{'sftp': MidasFileTransferServer})
示例12: __init__
# 需要导入模块: from twisted.conch.avatar import ConchUser [as 别名]
# 或者: from twisted.conch.avatar.ConchUser import __init__ [as 别名]
def __init__(self, root=None):
ConchUser.__init__(self)
self.channelLookup["session"] = ShelllessSession
示例13: __init__
# 需要导入模块: from twisted.conch.avatar import ConchUser [as 别名]
# 或者: from twisted.conch.avatar.ConchUser import __init__ [as 别名]
def __init__(self):
ConchUser.__init__(self)
self.channelLookup.update({ 'session': SSHSession })
示例14: __init__
# 需要导入模块: from twisted.conch.avatar import ConchUser [as 别名]
# 或者: from twisted.conch.avatar.ConchUser import __init__ [as 别名]
def __init__(self, original, username):
components.Adapter.__init__(self, original)
ConchUser.__init__(self)
self.username = username
self.channelLookup.update({'session': FixedSSHSession})
self.subsystemLookup.update({'sftp': FileTransferServer})
示例15: __init__
# 需要导入模块: from twisted.conch.avatar import ConchUser [as 别名]
# 或者: from twisted.conch.avatar.ConchUser import __init__ [as 别名]
def __init__(self):
ConchUser.__init__(self)
self.channelLookup['session'] = SSHSession