Comment
This commit is contained in:
parent
f7a43edb16
commit
1a349e3126
1 changed files with 12 additions and 4 deletions
16
mega/mega.py
16
mega/mega.py
|
@ -326,24 +326,32 @@ class Mega(object):
|
||||||
##########################################################################
|
##########################################################################
|
||||||
# DELETE
|
# DELETE
|
||||||
def delete(self, public_handle):
|
def delete(self, public_handle):
|
||||||
#straight delete by id
|
"""
|
||||||
|
Delete a file by its public handle
|
||||||
|
"""
|
||||||
return self.move(public_handle, 4)
|
return self.move(public_handle, 4)
|
||||||
|
|
||||||
def delete_url(self, url):
|
def delete_url(self, url):
|
||||||
#delete a file via it's url
|
"""
|
||||||
|
Delete a file by its url
|
||||||
|
"""
|
||||||
path = self.parse_url(url).split('!')
|
path = self.parse_url(url).split('!')
|
||||||
public_handle = path[0]
|
public_handle = path[0]
|
||||||
file_id = self.get_id_from_public_handle(public_handle)
|
file_id = self.get_id_from_public_handle(public_handle)
|
||||||
return self.move(file_id, 4)
|
return self.move(file_id, 4)
|
||||||
|
|
||||||
def destroy(self, file_id):
|
def destroy(self, file_id):
|
||||||
#delete forever by private id
|
"""
|
||||||
|
Destroy a file by its private id
|
||||||
|
"""
|
||||||
return self.api_request({'a': 'd',
|
return self.api_request({'a': 'd',
|
||||||
'n': file_id,
|
'n': file_id,
|
||||||
'i': self.request_id})
|
'i': self.request_id})
|
||||||
|
|
||||||
def destroy_url(self, url):
|
def destroy_url(self, url):
|
||||||
#delete a file via it's url
|
"""
|
||||||
|
Destroy a file by its url
|
||||||
|
"""
|
||||||
path = self.parse_url(url).split('!')
|
path = self.parse_url(url).split('!')
|
||||||
public_handle = path[0]
|
public_handle = path[0]
|
||||||
file_id = self.get_id_from_public_handle(public_handle)
|
file_id = self.get_id_from_public_handle(public_handle)
|
||||||
|
|
Loading…
Reference in a new issue