Mercurial > libervia-backend
diff sat/plugins/plugin_misc_file.py @ 3182:f2bb57348587
plugin attach, XEP-0363: progress id can now be specified:
progress id can be specified in options, using the "progress_id" option, this can be
more handy for frontends to keep track of attachments progresses.
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 23 Feb 2020 17:48:26 +0100 |
parents | 559a625a236b |
children | 404d4b29de52 |
line wrap: on
line diff
--- a/sat/plugins/plugin_misc_file.py Sun Feb 23 17:48:26 2020 +0100 +++ b/sat/plugins/plugin_misc_file.py Sun Feb 23 17:48:26 2020 +0100 @@ -48,7 +48,8 @@ SENDING = D_("Please select a file to send to {peer}") SENDING_TITLE = D_("File sending") CONFIRM = D_( - '{peer} wants to send the file "{name}" to you:\n{desc}\n\nThe file has a size of {size_human}\n\nDo you accept ?' + '{peer} wants to send the file "{name}" to you:\n{desc}\n\nThe file has a size of ' + '{size_human}\n\nDo you accept ?' ) CONFIRM_TITLE = D_("Confirm file transfer") CONFIRM_OVERWRITE = D_("File {} already exists, are you sure you want to overwrite ?") @@ -58,7 +59,7 @@ PROGRESS_ID_KEY = "progress_id" -class FilePlugin(object): +class FilePlugin: File = stream.SatFile def __init__(self, host): @@ -99,7 +100,8 @@ @param filename(unicode, None): name to use, or None to find it from filepath @param file_desc(unicode, None): description of the file @param profile: %(doc_profile)s - @return (dict): action dictionary, with progress id in case of success, else xmlui message + @return (dict): action dictionary, with progress id in case of success, else + xmlui message """ if not os.path.isfile(filepath): raise exceptions.DataError("The given path doesn't link to a file")