fix seafapi.ping
This commit is contained in:
parent
5a4fbed69f
commit
2c32e74fd3
@ -16,7 +16,7 @@ class SeafileClient:
|
||||
|
||||
def ping(self):
|
||||
try:
|
||||
return self.session.get("%s/ping" % self.api_endpoint()).text == "pong"
|
||||
return self.session.get("%s/ping" % self.api_endpoint()).text == "\"pong\""
|
||||
except:
|
||||
return False
|
||||
|
||||
|
12
main.py
12
main.py
@ -25,6 +25,7 @@ class SeafileUploader():
|
||||
|
||||
def showSettingsUI(self, parentWidget):
|
||||
self.parentWidget = parentWidget
|
||||
#self.processor.configure(parentWidget)
|
||||
self.settingsDialog = self.uil.load(QFile(workingDir + "/settings.ui"), parentWidget)
|
||||
self.settingsDialog.group_account.widget_loggedIn.loginButton.connect("clicked()", self.startAuthenticationProcess)
|
||||
#self.settingsDialog.group_name.input_name.connect("textChanged(QString)", self.nameFormatEdited)
|
||||
@ -86,11 +87,12 @@ class SeafileUploader():
|
||||
settings.endGroup()
|
||||
if self.seaf_url and self.access_token:
|
||||
self.seaf_client = SeafileClient(self.seaf_url,self.access_token.username,token=self.access_token)
|
||||
for lib in self.seaf_client.libraries():
|
||||
if lib.id == self.lib_id:
|
||||
self.seaf_lib = lib
|
||||
if self.seaf_lib and self.seaf_path:
|
||||
self.processor = EncryptedProcessor(self.seaf_lib,self.lib_path)#DefaultProcessor(self.seaf_lib,self.lib_path)
|
||||
if self.seaf_client.ping():
|
||||
for lib in self.seaf_client.libraries():
|
||||
if lib.id == self.lib_id:
|
||||
self.seaf_lib = lib
|
||||
if self.seaf_lib and self.seaf_path:
|
||||
self.processor = EncryptedProcessor(self.seaf_lib,self.lib_path)#DefaultProcessor(self.seaf_lib,self.lib_path)
|
||||
|
||||
|
||||
def saveSettings(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user