Mercurial > libervia-backend
diff sat/plugins/plugin_comp_file_sharing_management.py @ 3531:a8259a1f89b2
component file sharing (management): add values of `quota` and `used` size on result form
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 05 May 2021 15:37:33 +0200 |
parents | 698579bedd6f |
children | 888109774673 |
line wrap: on
line diff
--- a/sat/plugins/plugin_comp_file_sharing_management.py Wed May 05 15:37:33 2021 +0200 +++ b/sat/plugins/plugin_comp_file_sharing_management.py Wed May 05 15:37:33 2021 +0200 @@ -1,7 +1,6 @@ #!/usr/bin/env python3 - -# SAT plugin to detect language (experimental) +# Libervia plugin to manage file sharing component through ad-hoc commands # Copyright (C) 2009-2021 Jérôme Poisson (goffi@goffi.org) # This program is free software: you can redistribute it and/or modify @@ -19,14 +18,14 @@ import os.path from functools import partial +from wokkel import data_form +from twisted.internet import defer +from twisted.words.protocols.jabber import jid from sat.core.i18n import _, D_ from sat.core import exceptions from sat.core.constants import Const as C from sat.core.log import getLogger from sat.tools.common import utils -from wokkel import data_form -from twisted.internet import defer -from twisted.words.protocols.jabber import jid log = getLogger(__name__) @@ -474,7 +473,9 @@ except exceptions.PermissionError: raise WorkflowError(self._err(_("forbidden"))) status = self._c.STATUS.COMPLETED - payload = None + form = data_form.Form("result") + form.makeFields({"quota": quota, "user": size_used}) + payload = form.toElement() note = ( self._c.NOTE.INFO, _("You are currently using {size_used} on {size_quota}").format(