Mercurial > libervia-backend
comparison 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 |
comparison
equal
deleted
inserted
replaced
3865:59fbb66b2923 | 3866:915fb230cb28 |
---|---|
32 import inspect | 32 import inspect |
33 import tty | 33 import tty |
34 import termios | 34 import termios |
35 from pathlib import Path | 35 from pathlib import Path |
36 from glob import iglob | 36 from glob import iglob |
37 from typing import Optional | 37 from typing import Optional, Set |
38 from importlib import import_module | 38 from importlib import import_module |
39 from sat_frontends.tools.jid import JID | 39 from sat_frontends.tools.jid import JID |
40 from sat.tools import config | 40 from sat.tools import config |
41 from sat.tools.common import dynamic_import | 41 from sat.tools.common import dynamic_import |
42 from sat.tools.common import uri | 42 from sat.tools.common import uri |
1317 | 1317 |
1318 # now we add subcommands to ourself | 1318 # now we add subcommands to ourself |
1319 for cls in subcommands: | 1319 for cls in subcommands: |
1320 cls(self) | 1320 cls(self) |
1321 | 1321 |
1322 def overridePubsubFlags(self, new_flags: Set[str]) -> None: | |
1323 """Replace pubsub_flags given in __init__ | |
1324 | |
1325 useful when a command is extending an other command (e.g. blog command which does | |
1326 the same as pubsub command, but with a default node) | |
1327 """ | |
1328 self._pubsub_flags = new_flags | |
1329 | |
1322 async def run(self): | 1330 async def run(self): |
1323 """this method is called when a command is actually run | 1331 """this method is called when a command is actually run |
1324 | 1332 |
1325 It set stuff like progression callbacks and profile connection | 1333 It set stuff like progression callbacks and profile connection |
1326 You should not overide this method: you should call self.start instead | 1334 You should not overide this method: you should call self.start instead |