本文整理汇总了Python中Server.setAuthenticationType方法的典型用法代码示例。如果您正苦于以下问题:Python Server.setAuthenticationType方法的具体用法?Python Server.setAuthenticationType怎么用?Python Server.setAuthenticationType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server
的用法示例。
在下文中一共展示了Server.setAuthenticationType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: readServersData
# 需要导入模块: import Server [as 别名]
# 或者: from Server import setAuthenticationType [as 别名]
def readServersData(self):
config = self.getConfig()
if config.hasGroupImpl(CONFIG_SERVERS):
configServers = config.groupImpl(CONFIG_SERVERS)
list = configServers.groupList()
if (list.count() > 0):
for i in range(list.count()):
serverData = KConfigGroup(configServers, list.__getitem__(i))
server = Server()
server.setName(list.__getitem__(i))
server.setHostIP(serverData.readEntry(SERVER_DATA_HOST_IP))
server.setPort(serverData.readEntry(SERVER_DATA_PORT))
server.setLogin(serverData.readEntry(SERVER_DATA_LOGIN))
server.setSwitches(serverData.readEntry(SERVER_DATA_SWITCHES))
server.setAuthenticationType(serverData.readEntry(SERVER_DATA_AUTHENTICATION_TYPE))
if server.authenticationType == AUTH_TYPE_PRIVATE_KEY:
server.setKeyPath(serverData.readEntry(AUTH_TYPE_PRIVATE_KEY))
self.servers[server.name] = server
示例2: saveSettings
# 需要导入模块: import Server [as 别名]
# 或者: from Server import setAuthenticationType [as 别名]
def saveSettings(self):
server = Server()
server.setName(self.name.originalText())
server.setHostIP(self.hostIP.originalText())
server.setPort(str(self.port.value()))
server.setSwitches(str(self.switches.originalText()))
server.setLogin(self.login.originalText())
if (Qt.Checked == self.passCheckbox.checkState()):
server.setAuthenticationType(AUTH_TYPE_PASSWORD)
server.setPassword(self.password.originalText())
elif (Qt.Checked == self.keyCheckbox.checkState()):
server.setAuthenticationType(AUTH_TYPE_PRIVATE_KEY)
server.setKeyPath(self.keyFilePath.originalText())
else:
server.setAuthenticationType(AUTH_TYPE_NONE)
if self.isEdit:
self.parent.saveServer(self.oldName, server)
else:
self.parent.addServer(server)