本文整理匯總了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)