Commit graph libervia-backend/frontends
Author SHA1 Message Date
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
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
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
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
702c5e78e9 jp (common): fixed the use of --last-item when "-n [node]" is used 2017-07-05 15:04:45 +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
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
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
4c82adce82 jp (event/invitee/invite): command to use new eventInvite backend method 2017-06-29 20:57:14 +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
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
9322d617d4 jp (input): input command first draft:
this is an experimental command to use external data as input arguments.
A series of data is used (only CSV is implemented so far), and it is used to fill argument of a command according to a sequence.
The sequence is given using input arguments, with types corresponding to the data found (short option, long option, stdin).
e.g. if a CSV file has row with 3 columns, we can say that column 1 is subject (long option), column 2 is body (stdin), and column 3 is language (short option -l).
A filter can be used after each option type, to transform read value.
Finally a static part is used to have the main command and non dynamic arguments to use.
2017-06-28 01:28:41 +02:00
Goffi
e8409b13e6 jp (base): added no_lf in disp() to avoid printing a line feed 2017-06-28 01:21:49 +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
2449721982 jp (blog, common): various fixes in common and blog:
- parse_args has been moved to common
    - cat_dir is converted to str on BaseEdit init, so it can be use to make str path for files manipulation
    - fixed use of EDITOR_ARGS_MAGIC when use_metadata is False
    - fixed unlink of metadata files when use_metadata is False
2017-06-27 19:38:22 +02:00
Goffi
71d61f372f jp (blog): minor typo fix 2017-06-27 17:02:10 +02:00
Goffi
6025cc4e3b jp (blog, common): added --force-item option to avoid magic and use argument as actual item id:
- creation of new item with item id has been fixed
    - --force-item allow to use url as item id, or keyword
    - pubsub_item can is now returned by getItemPath. If not None, the id is known and must be used
2017-06-27 17:00:52 +02:00
Goffi
5eda63d99e jp (blog, common): moved and improved edit code from blog:
- a new "common" module is there for code commonly used in commands
    - moved code for editing item with $EDITOR there
    - moved code to identify item to edit there
    - aforementioned fontions have been made generic
    - a class BaseEdit is now available to implement edition
    - HTTPS links are handled (only HTTP links were working before)
    - item can be use if all previous methods fail (url, keyword, file path).
2017-06-27 16:23:28 +02:00
Goffi
7edc9c8a3b jp (constants): added exit code for data error. 2017-06-27 16:14:58 +02:00
Goffi
be9de5afc4 jp (blog): added language in managed keys 2017-06-25 09:43:04 +02:00
Goffi
b18523e615 jp (invitation): fixed inconsistency in language handling 2017-06-21 08:00:14 +02:00
Goffi
b7a0972237 jp (identity): new identity command to handle the new plugin identity in backend, and maybe other plugins like vcard in the future 2017-05-21 20:06:07 +02:00
Goffi
2ca6788477 jp (invitation): fixed typo 2017-05-21 19:57:46 +02:00
Goffi
40e764cab5 jp (output/template): initialize template rendered only if a rendering is actually needed 2017-05-21 15:52:23 +02:00
Goffi
9ea4dba14d jp (event): don't use dayfirst for YY-MM-DD style dates 2017-05-21 15:47:53 +02:00
Goffi
2359f3908a jp (event): creation/modification of main event + invitee commands are now in a "invitee" subcommand 2017-05-19 12:45:26 +02:00
Goffi
48100ac776 jp (uri): new command to parse or generate XMPP URIs 2017-05-19 12:34:33 +02:00