Commit graph

2,331 commits

Author SHA1 Message Date
Goffi
60700377b8 jp (blog/edit): avoid call to syntaxConvert if syntax is already XHTML 2017-07-13 22:49:37 +02:00
Goffi
bd6ac76b45 jp (blog/edit): pretty format XHTML before editing it 2017-07-13 21:54:15 +02:00
Goffi
5c7d273ebc jp (common): fixed encoding issue in URLs 2017-07-13 21:45:26 +02:00
Goffi
d5908b6ee6 tools(common/uri): fixed encoding in buildXMPPUri 2017-07-13 21:23:36 +02:00
Goffi
c05a0028b6 jp (blog/get): added "url" key, which compute xmpp: URL of items 2017-07-13 21:13:35 +02:00
Goffi
da75f58453 tools (common/uri): buildXMPPUri: use XEP-0277 namespace as node if node is empty or None for microblog subtype 2017-07-13 21:12:46 +02:00
Goffi
da6bf7123a jp (blog/edit): syntax modifications:
- adapted to new behaviour (keys which are names in lower case en stripped are now used)
    - added --syntax so force a specific syntax. If not used, profile's default syntax will be used
2017-07-13 20:55:35 +02:00
Goffi
85d58f902b plugin text syntaxes: various improvments:
- syntaxes and default_syntax are now class attribute instead of members of params_data
    - removed local exception UnknownSyntax in favor of exceptions.NotFound
    - syntaxes are now saved with a key which is name in lower case and stripped, unmodified name is put in syntax's data
    - new getSyntax (syntaxGet in bridge) method to get syntax key and raise an error if not found. Can be used by frontends to check that a syntax is known.
2017-07-13 20:53:51 +02:00
Goffi
d8080c8ad2 template: print warning message and use DEFAULT_LOCALE on bad locale 2017-07-12 19:06:28 +02:00
Goffi
ef6c0c30f5 plugins invitation, XEP-0277: strip language, we don't want spaces 2017-07-12 19:05:33 +02:00
Goffi
72ba9316f2 jp (event/attendee/list): added --missing to show missing people (ones who didn't replied) and --no-rsvp to hide ones who answered 2017-07-09 16:17:16 +02:00
Goffi
1d3680445d jp (pubsub/search): fixed encoding for stdin in external commands 2017-07-09 15:20:31 +02:00
Goffi
4ec04b1fb0 plugin XEP-0060: remove max_items when item_ids is set on getItems 2017-07-08 23:21:01 +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
4331a03562 jp (arg_tools): moved get_cmd_choices, get_use_args and escape to a new arg_tools module, so they can be used in other commands than shell 2017-07-08 21:45:14 +02:00
Goffi
c5149909be plugin XEP-0060: fixed service in metadata for PEP 2017-07-08 21:43:36 +02:00
Goffi
62c17395bd jp (shell): use of subprocess instead of running commands in the same process:
when a command is calling host.quit() in a D-Bus callback, GLib mainloop is exiting and quit the whole process without (apparently?) any way to block it. Couldn't find a good way to avoid that, so subprocess are now used as a workaround, instead of launching commands in the same process. When we'll get rid of python-dbus, there may be an other way.

Execuring external commands is now possible through the shell/! command.
2017-07-07 22:33:55 +02:00
Goffi
783d14bfc7 jp (base): typo 2017-07-07 12:45:28 +02:00
Goffi
04b274a87b jp (shell): added "whoami" command to print currently used profile 2017-07-06 20:35:21 +02:00
Goffi
cee44aadbf jp (shell): don't print header if a command is specified in help 2017-07-06 20:31:31 +02:00
Goffi
6672bfc57b jp (shell): shell command (REPL mode), first draft:
This command launch jp in REPL mode, allowing do normal jp commands with some facilities.
Command can be selected with "cmd" (e.g. "cmd blog").
An argument can be fixed with "use" (e.g. "use output fancy").
Command is launched with "do", or directly with its name if it doesn't conflict with a shell command.
Arguments completion is still TODO (only shell commands are completed so far).
2017-07-06 20:28:25 +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
05f0764d2f plugin Pubsub Hook: first draft:
This new plugin allow to attach an external action to a Pubsub event (i.e. notification).
Hook can be persitent accross restarts, or temporary (will be deleted on profile disconnection).

Only Python files are handled for now.

In the future, it may make sense to move hooks in a generic plugin which could be used by ad-hoc commands, messages, pubsub, etc.
2017-07-05 15:05:47 +02:00
Goffi
702c5e78e9 jp (common): fixed the use of --last-item when "-n [node]" is used 2017-07-05 15:04:45 +02:00
Goffi
c56d3fc759 plugin XEP-0060: addManagedNode callbacks now use client syntax instead of profile 2017-07-05 15:04:43 +02:00
Goffi
359b3a1b43 core (tools/email): an unicode "to" email (instead of a list) can now be used 2017-07-05 15:02:52 +02:00
Goffi
5ef5fc36f1 plugin events: changed import names to EVENTS uppercase for consistency with other plugins 2017-07-05 14:50:45 +02:00
Goffi
3d7e11cd8f core (memory/persistent): fixed calls to delPrivateValue 2017-07-05 14:50:39 +02:00
Goffi
3b8aa22931 jp (event/invitee/list): don't add a space after nick and jid when a table is displayed 2017-07-05 14:50:13 +02:00
Goffi
eaa420fb03 jp (event/invitee): added list command to get R.S.V.P. :
RSVP are gotten for invitees node, and R.S.V.P. are displayed. Then a summary display the number of yes, maybe and no, and the expected number of guests.
2017-07-02 20:09:25 +02:00
Goffi
40220c3d7d jp (event): added checkURI to InviteeGet and InviteeSet 2017-07-02 20:09:24 +02:00
Goffi
3cc90179b5 jp (common): new ansi_ljust, ansi_rjust and ansi_center command + table:
- ansi_ljust, ansi_rjust and ansi_center are equivalent to string.ljust, rjust and center, but handle strings with ANSI escape codes
    - new Table class to handle tabular data and display them with ASCII borders/separations.
    - Table is quite flexible, filters can be applied to data, header can be shown or not, columns/headers can be left/right aligned.
    - table can be displayed without decoration to align text data, using display_blank helping method
2017-07-02 20:09:21 +02:00
Goffi
828d1564fb core (tools/common/regex): new ansiRemove method to remove ANSI escape codes from a string 2017-07-02 19:53:44 +02:00
Goffi
09c40742d1 jp (standard output): added simple, json and json_raw for OUTPUT_DICT_DICT 2017-07-02 19:52:21 +02:00
Goffi
178a8311ca jp (constants): added OUTPUT_DICT_DICT for dictionaries of nested dictionaries 2017-07-02 19:51:00 +02:00
Goffi
8b21f69945 plugin events: added eventInviteesList method to get all R.S.V.P. at once. 2017-07-02 19:47:25 +02:00
Goffi
394f7b85c2 jp (input/csv): fixed encoding issue in debug mode 2017-06-30 01:08:13 +02:00
Goffi
7ea19a5ca6 jp (pubsub/node/affiliations/set): call checkURI 2017-06-30 00:54:37 +02:00
Goffi
d07083bff6 plugin events, invitations + jp (event/create, invitation/invitee/invite): several emails addresses can now be specified for a single invitation:
if several addresses are specified, the same invitation (same ID and data) is sent to all the addresses
2017-06-30 00:04:47 +02:00
Goffi
1540936d12 jp (pubsub/node/set): added checkURI to handle xmpp: URIs 2017-06-30 00:02:16 +02:00
Goffi
cbeb350bd5 plugin XEP-0277: max_items fix (last "fix" about it was actually bad) 2017-06-29 23:40:12 +02:00
Goffi
4c82adce82 jp (event/invitee/invite): command to use new eventInvite backend method 2017-06-29 20:57:14 +02:00
Goffi
b1b39a636e plugin events: added eventInvite command as a helper for the complex invitation workflow:
when this command is used:
    - an email invitation is sent with the event node set
    - invitee's jid is affiliated to event
    - invitee's jid is affiliated to invitee's node as a publisher
    - invitee's jid is affiliated to blog's node as a member
    - invitee's jid is affiliated to every blog's item's comments node as a publisher
last affiliation complex operation is currently needed because of the way blogs and comments are handled, but this need to be changed in the future with XEP proposal.
2017-06-29 20:57:12 +02:00
Goffi
80afa4654c plugin XEP-0277: change affiliations for comments + fixes:
- mbGet now use client instead of profile_key
    - fixed max_items handling
    - for whitelist access model, if a comments node is created, "member" affiliations are transformed to "publisher"
      This is because most of time we want that somebody is able to read a private blog but not write on it, and be able to write a comment.
2017-06-29 20:45:54 +02:00
Goffi
47cc5f737c jp (invitation/create): typo 2017-06-29 20:37:06 +02:00
Goffi
efbefbb276 jp (blog, event): added checkURI to some command to be able to enter a xmpp: uri as argument 2017-06-29 20:36:35 +02:00
Goffi
706fddbd9e jp (pubsub/get): renamed --id option to --item for consistency with other commands 2017-06-29 20:35:07 +02:00
Goffi
b983d39069 jp (input): log improvments + empty filter:
- more colors in debug logs
    - read values are printed if verbosity is >= 2
    - stdout and stderr of each command can be written in files using --log and --log-err
    - --empty option allow to ignore arguments if its value is empty, or skip the whole row
2017-06-28 23:49:55 +02:00