mirror of
https://github.com/gryf/slack-backup.git
synced 2025-12-17 11:30:25 +01:00
Added implementation for url_file_attachment option.
Using url_file_attachment user can specify if he like to change objects like 'file_share' marked as external (in Slack servers point of view) to attachments, so the only value would be remembered URL for the "uploaded" document as an attachment. Or, treat it as is, and let the slack-backup to produce file which contain the URLs and corresponding local file names for such files.
This commit is contained in:
@@ -24,10 +24,12 @@ def makedirs(path):
|
||||
raise
|
||||
|
||||
|
||||
def get_temp_name():
|
||||
def get_temp_name(suffix='', prefix='tmp', dir=None, unlink=False):
|
||||
"""Return temporary file name"""
|
||||
fdesc, fname = tempfile.mkstemp()
|
||||
fdesc, fname = tempfile.mkstemp(suffix=suffix, prefix=prefix, dir=dir)
|
||||
os.close(fdesc)
|
||||
if unlink:
|
||||
os.unlink(fname)
|
||||
return fname
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user