Compare commits
No commits in common. "py3" and "0.2" have entirely different histories.
@ -98,15 +98,10 @@ class SeafileFile:
|
||||
self.size = size
|
||||
|
||||
#curl -v -X PUT -d "p=/foo.md" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/afc3b694-7d4c-4b8a-86a4-89c9f3261b12/file/shared-link/
|
||||
def share(self,expire=None,password=None):
|
||||
parameters = {'p': self.path }
|
||||
if expiry:
|
||||
parameters['expire'] = int(expire)
|
||||
if password:
|
||||
parameters['password'] = str(password)
|
||||
def share(self):
|
||||
resp = self.session.put("%s/repos/%s/file/shared-link/" % (self.library.client.api_endpoint(),self.library.id),
|
||||
headers = {'Authorization': "Token %s" % self.library.client.token.token, 'Accept': 'application/json; indent=4'},
|
||||
data = parameters
|
||||
data = {'p': self.path}
|
||||
)
|
||||
return resp.headers.get("location")
|
||||
|
||||
|
4
main.py
4
main.py
@ -23,7 +23,6 @@ class SeafileUploader():
|
||||
self.loadSettings()
|
||||
self.pool = Pool(2)
|
||||
self.seaf_client = None
|
||||
self.link_expiry = None
|
||||
|
||||
def showSettingsUI(self, parentWidget):
|
||||
self.parentWidget = parentWidget
|
||||
@ -79,7 +78,6 @@ class SeafileUploader():
|
||||
(self.lib_id,self.lib_name) = str(settings.value("library", "/")).split("/")
|
||||
self.lib_path = settings.value("library-path", "")
|
||||
self.copyLink = settings.value("copy-link", "true") in ['true', True]
|
||||
self.link_expiry = settings.value("link-expiry", None)
|
||||
if settings.value("auth-token", False) and settings.value("auth-username", False):
|
||||
self.access_token = SeafileToken(settings.value("auth-username", False),settings.value("auth-token", False))
|
||||
else:
|
||||
@ -107,8 +105,6 @@ class SeafileUploader():
|
||||
except:
|
||||
pass
|
||||
settings.setValue("copy-link", self.copyLink)
|
||||
if self.link_expiry:
|
||||
settings.setValue("link-expiry", self.link_expiry)
|
||||
if self.access_token is not None:
|
||||
settings.setValue("auth-username", self.access_token.username )
|
||||
settings.setValue("auth-token", self.access_token.token)
|
||||
|
Loading…
x
Reference in New Issue
Block a user