Commit graph libervia-backend/frontends/src/jp/cmd_pubsub.py
Author SHA1 Message Date
Goffi
80ef13612b core, setup: huge cleaning:
- moved directories from src and frontends/src to sat and sat_frontends, which is the recommanded naming convention
- move twisted directory to root
- removed all hacks from setup.py, and added missing dependencies, it is now clean
- use https URL for website in setup.py
- removed "Environment :: X11 Applications :: GTK", as wix is deprecated and removed
- renamed sat.sh to sat and fixed its installation
- added python_requires to specify Python version needed
- replaced glib2reactor which use deprecated code by gtk3reactor

sat can now be installed directly from virtualenv without using --system-site-packages anymore \o/
2018-04-02 19:44:50 +02:00
Goffi
60eab27872 jp (base): new confirmOrQuit helper method to ask confirmation to user, and quit if he cancel 2018-03-31 18:21:56 +02:00
Goffi
d2dadbaf46 jp (base): add --max option:
when MULTI_ITEMS is set, --max options is automatically added, except if NO_MAX flag is set.
2018-03-29 08:59:38 +02:00
Goffi
6f8834f9da jp: pubsub options refactoring:
There is now only "use_pubsub", and specification are set using "pubsub_flags" argument when instantiating CommandBase.
Options are more Python Zen compliant by using explicit arguments for item, draft, url instead of trying to guess with magic keyword and type detection.
Pubsub node and item are now always using respecively "-n" and "-i" even when required, this way shell history can be used to change command more easily, and it's globally less confusing for user.
if --pubsub-url is used, elements can be overwritten with individual option (e.g. change item id with --item).
New "use_draft" argument in CommandBase, to re-use current draft or open a file path as draft.
Item can now be specified when using a draft. If it already exists, its content will be added to current draft (with a separator), to avoid loosing data.
common.BaseEdit.getItemPath could be simplified thanks to those changes.
Pubsub URI handling has been moved to base.py.
2018-03-21 19:13:22 +01:00
Goffi
387c10cc0d dates update 2018-01-26 11:14:13 +01:00
Goffi
1ae6d839ce jp (pubsub/search): fixed --item argument 2017-12-12 00:09:39 +01:00
Goffi
4df7673f64 plugin XEP-0060: added "options" argument to psSubscribe, and return subscription id if present 2017-11-19 16:41:59 +01:00
Goffi
b79a309250 jp (pubsub): added new "set" command tu publish or update an item in a non-interactive way (while "edit" do it interactively). 2017-11-18 18:37:21 +01:00
Goffi
d847301c70 jp (pubsub/node/create): fixed --field option 2017-11-04 22:11:01 +01:00
Goffi
f5f25e8ab5 misc: date update (yes it's a bit late :p ) 2017-11-03 14:31:42 +01:00
Goffi
bfc27d68dd jp (pubsub/delete): show deleted node + handle URIs 2017-10-27 08:33:48 +02:00
Goffi
c7ccdde0c9 jp (pubsub/node/schema): check that a schema exists before parsing it (fix issue on new schema edition) 2017-09-24 16:29:18 +02:00
Goffi
e33d68bcf1 jp (pubsub): added subscribe, unsubscribe and subscriptions methods:
those methods are added in pubsub directly instead of being subcommands of pubsub/subscription to make them more easy/natural to use. The node owner versions are in pubsub/node/subscriptions though.
2017-09-08 07:58:08 +02:00
Goffi
e9c0f5e127 jp (pubsub/node): added schema (set/edit/get) commands to manipulate PubSub node schema 2017-09-06 07:39:10 +02:00
Goffi
1d07c6bdd7 jp (pubsub/node): added subscriptions subcommand:
added subscriptions commands for node owner, with get/set subcommands (work in a similar way as affiliations)
2017-08-20 10:33:33 +02:00
Goffi
1d3680445d jp (pubsub/search): fixed encoding for stdin in external commands 2017-07-09 15:20:31 +02:00
Goffi
90550ef38b jp (pubsub/search): profile is transmited to subcommand for "exec" action 2017-07-08 22:50:25 +02:00
Goffi
23416b5d12 jp (arg_tools): args is not modified anymore in get_use_args + fixed args returned + parser_args are returned separatly (return is now a tuple) 2017-07-08 22:49:55 +02:00
Goffi
367bb66a01 jp (pubsub): new search command:
search is a kind of "grep for Pubsub". It's a powerful command which allows to look for specific data in a pubsub node, recurse sub nodes if requested, and execute an action on the result.

search allows to look for items with following filter:
    - simple text search
    - regex
    - xpath
    - python code

filters are read an applied in the order in which they appear on the command line.

Then flags can be used to modify behaviour, currently there are:
    - ignore-case to specify if search must be case sensitive or not
    - invert to invert result of the search (i.e. don't match instead of match)
    - dot-all which is specific for regex, cf. re module
    - only-matching which return the matching part instead of the full item

Once a item match filters, an action is applied to it, currenlty there are:
    - print, which do a simple output of the full item (default)
    - exec, which run a jp command, specifying the service, node and item corresponding to the match
    - exteral, which run a external command, sending the full item on stdin

By default search is only done on requested node, but if max-depth is more than 0, sub nodes will be searched too.
2017-07-08 21:54:24 +02:00
Goffi
73ed5094b9 jp (pubsub/hook): added create/delete/list hook command to handle new Pubsub hook feature 2017-07-05 15:05:49 +02:00
Goffi
7ea19a5ca6 jp (pubsub/node/affiliations/set): call checkURI 2017-06-30 00:54:37 +02:00
Goffi
1540936d12 jp (pubsub/node/set): added checkURI to handle xmpp: URIs 2017-06-30 00:02:16 +02:00
Goffi
2795935703 jp (pubsub/delete): delete command implementation (to delete an item) 2017-06-28 20:28:58 +02:00
Goffi
364130bcbe jp (pubsub, common): fixed last item edition (keep item id instead of creating a new one) 2017-06-28 20:28:24 +02:00
Goffi
c2ae6579c3 jp (cmd_pubsub): xmpp: uri handling, first draft 2017-06-28 19:19:08 +02:00
Goffi
be2bb0ff3f jp (common): added --last-item to take last item when no item id is found/given 2017-06-28 01:20:44 +02:00
Goffi
7f13ed15fd jp (pubsub/edit): new edit subcommand, which work in a same way as for blog 2017-06-27 19:38:22 +02:00
Goffi
5af5b344e5 jp (pubsub): psItemGet has been renamed to psItemsGet as several items are gotten 2017-06-27 19:38:22 +02:00
Goffi
4ea36624a2 jp (pubsub/uri): fixed URI generation 2017-05-19 12:33:54 +02:00
Goffi
e12e25d1bf jp: added use_pubsub and use_pubsub_node_req arguments to CommandBase
pubsub add --node and --service arguments
    pubsub_node_req add --service and a positional node argument (i.e. mandatory)
2017-04-27 01:01:43 +02:00
Goffi
f89b014caa jp (pubsub): added uri command to build pubsub URI 2017-04-16 17:59:54 +02:00
Goffi
55b6199997 jp (pubsub/node): added create and delete commands 2017-04-03 00:23:01 +02:00
Goffi
fce4b9fd1b jp (pubsub/get): --service is now optional argument, and sub_id now use "-S" short option 2017-03-29 19:42:44 +02:00
Goffi
3eb7074f26 jp (pubsub/node) added pubsub/node/affiliations/set command 2017-03-26 18:08:05 +02:00
Goffi
281c514ae4 jp (pubsub): added affiliations and node/affiliations/get:
affiliations allow to retrieve all node were a profile is affiliated on a service, or the affiliation on a specific node.

node/affiliations/get is for node owner and allow to retrieve who is affiliated with a node and which kind of affiliation.
2017-03-23 21:04:01 +01:00
Goffi
afef209d70 jp (pubsub/node): added set command 2017-03-14 00:21:20 +01:00
Goffi
b9db15510f jp (pubsub): added pubsub/node/info command to retrieve node configuration 2017-03-13 23:18:57 +01:00
Goffi
ba8534ee4f plugin XEP-0060: renamed psGet bridge method to psItemGet 2017-03-13 23:17:13 +01:00
Goffi
220042d6b1 jp(pubsub/get): pubsub/get command, first draft 2017-03-12 23:34:51 +01:00