diff --git a/sat/plugins/plugin_misc_merge_requests.py b/sat/plugins/plugin_misc_merge_requests.py index 2d7ccee4..f85db12c 100644 --- a/sat/plugins/plugin_misc_merge_requests.py +++ b/sat/plugins/plugin_misc_merge_requests.py @@ -36,7 +36,7 @@ PLUGIN_INFO = { C.PI_IMPORT_NAME: "MERGE_REQUESTS", C.PI_TYPE: "EXP", C.PI_PROTOCOLS: [], - C.PI_DEPENDENCIES: ["XEP-0060", "XEP-0346", "LISTS", "TEXT_SYNTAXES"], + C.PI_DEPENDENCIES: ["XEP-0060", "XEP-0346", "TICKETS", "TEXT_SYNTAXES"], C.PI_MAIN: "MergeRequests", C.PI_HANDLER: "no", C.PI_DESCRIPTION: _("""Merge requests management plugin""") diff --git a/sat/plugins/plugin_misc_lists.py b/sat/plugins/plugin_misc_tickets.py similarity index 92% rename from sat/plugins/plugin_misc_lists.py rename to sat/plugins/plugin_misc_tickets.py index 5abb66d3..1a8e42fa 100644 --- a/sat/plugins/plugin_misc_lists.py +++ b/sat/plugins/plugin_misc_tickets.py @@ -15,7 +15,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from sat.core.i18n import _, D_ +from sat.core.i18n import _ from sat.core.constants import Const as C from twisted.internet import defer from sat.tools.common import uri @@ -24,26 +24,24 @@ from sat.core.log import getLogger log = getLogger(__name__) -# XXX: this plugin was formely named "tickets", thus the namespace keeps this -# name APP_NS_TICKETS = "org.salut-a-toi.tickets:0" PLUGIN_INFO = { - C.PI_NAME: _("Pubsub Lists"), - C.PI_IMPORT_NAME: "LISTS", + C.PI_NAME: _("Tickets management"), + C.PI_IMPORT_NAME: "TICKETS", C.PI_TYPE: "EXP", C.PI_PROTOCOLS: [], C.PI_DEPENDENCIES: ["XEP-0060", "XEP-0346", "XEP-0277", "IDENTITY"], - C.PI_MAIN: "PubsubLists", + C.PI_MAIN: "Tickets", C.PI_HANDLER: "no", - C.PI_DESCRIPTION: _("""Pubsub lists management plugin"""), + C.PI_DESCRIPTION: _("""Tickets management plugin"""), } -class PubsubLists: +class Tickets: def __init__(self, host): - log.info(_("Pubsub lists plugin initialization")) + log.info(_("Tickets plugin initialization")) self.host = host self._s = self.host.plugins["XEP-0346"] self.namespace = self._s.getSubmittedNS(APP_NS_TICKETS) @@ -51,7 +49,7 @@ class PubsubLists: self._p = self.host.plugins["XEP-0060"] self._m = self.host.plugins["XEP-0277"] host.bridge.addMethod( - "listGet", + "ticketsGet", ".plugin", in_sign="ssiassa{ss}s", out_sign="s", @@ -74,7 +72,7 @@ class PubsubLists: async_=True, ) host.bridge.addMethod( - "listSet", + "ticketSet", ".plugin", in_sign="ssa{sas}ssss", out_sign="s", @@ -82,7 +80,7 @@ class PubsubLists: async_=True, ) host.bridge.addMethod( - "listSchemaGet", + "ticketsSchemaGet", ".plugin", in_sign="sss", out_sign="s", diff --git a/sat_frontends/jp/cmd_list.py b/sat_frontends/jp/cmd_ticket.py similarity index 94% rename from sat_frontends/jp/cmd_list.py rename to sat_frontends/jp/cmd_ticket.py index 176db8c7..2e5e6772 100644 --- a/sat_frontends/jp/cmd_list.py +++ b/sat_frontends/jp/cmd_ticket.py @@ -26,7 +26,7 @@ from sat_frontends.jp import common from sat_frontends.jp.constants import Const as C from . import base -__commands__ = ["List"] +__commands__ = ["Ticket"] FIELDS_MAP = "mapping" @@ -42,7 +42,7 @@ class Get(base.CommandBase): pubsub_flags={C.MULTI_ITEMS}, pubsub_defaults={"service": _("auto"), "node": _("auto")}, use_output=C.OUTPUT_LIST_XMLUI, - help=_("get lists"), + help=_("get tickets"), ) def add_parser_options(self): @@ -51,8 +51,8 @@ class Get(base.CommandBase): async def start(self): await common.fill_well_known_uri(self, os.getcwd(), "tickets", meta_map={}) try: - lists_data = data_format.deserialise( - await self.host.bridge.listGet( + tickets_data = data_format.deserialise( + await self.host.bridge.ticketsGet( self.args.service, self.args.node, self.args.max, @@ -64,10 +64,10 @@ class Get(base.CommandBase): type_check=list ) except Exception as e: - self.disp(f"can't get lists: {e}", error=True) + self.disp(f"can't get tickets: {e}", error=True) self.host.quit(C.EXIT_BRIDGE_ERRBACK) else: - await self.output(lists_data[0]) + await self.output(tickets_data[0]) self.host.quit(C.EXIT_OK) @@ -211,10 +211,10 @@ class Import(base.CommandBase): await self.set_progress_id(progress_id) -class List(base.CommandBase): +class Ticket(base.CommandBase): subcommands = (Get, Import) def __init__(self, host): - super(List, self).__init__( - host, "list", use_profile=False, help=_("pubsub lists handling") + super(Ticket, self).__init__( + host, "ticket", use_profile=False, help=_("tickets handling") )