diff sat_frontends/jp/base.py @ 3866:915fb230cb28

cli (blog, pubsub): new `attachments` subcommands: `pubsub/attachments` subcommands has a `get` and a `set` subcommand to manage attachments of a pubsub item. `blog` has the same subcommands, the only difference is that if `--node` is not specified, the default blog namespace will be used. rel 370
author Goffi <goffi@goffi.org>
date Wed, 20 Jul 2022 17:55:11 +0200
parents 3260401fdb98
children 045af0eeda3f
line wrap: on
line diff
--- a/sat_frontends/jp/base.py	Wed Jul 20 17:53:12 2022 +0200
+++ b/sat_frontends/jp/base.py	Wed Jul 20 17:55:11 2022 +0200
@@ -34,7 +34,7 @@
 import termios
 from pathlib import Path
 from glob import iglob
-from typing import Optional
+from typing import Optional, Set
 from importlib import import_module
 from sat_frontends.tools.jid import JID
 from sat.tools import config
@@ -1319,6 +1319,14 @@
         for cls in subcommands:
             cls(self)
 
+    def overridePubsubFlags(self, new_flags: Set[str]) -> None:
+        """Replace pubsub_flags given in __init__
+
+        useful when a command is extending an other command (e.g. blog command which does
+        the same as pubsub command, but with a default node)
+        """
+        self._pubsub_flags = new_flags
+
     async def run(self):
         """this method is called when a command is actually run