Commit graph libervia-backend/frontends/src/jp
Author SHA1 Message Date
Goffi
8155bc3ee8 jp (base, blog, output(std)): fixed bad unicode handling in stdout, use of jp.disp instead of simple print 2017-02-21 21:01:40 +01:00
Goffi
bc8c6d34ca jp (blog/get): fancy output prints author, published and updated if verbosity > 1 and tags if verbosity > 2 + format published and updated 2017-02-17 00:33:55 +01:00
Goffi
bb6d71d857 jp (blog): added blog/get command:
- blog/get will retrieve and parse blog items on specified service/node and can request only one or more specific items according to ids of max value
    - it takes profit of outputs and the new extra_outputs: a default output display microblogs as key/value, a fancy one display it in a more confortable way for reading it the terminal
    - for default output, keys can be filtered using --key argument
2017-02-16 01:02:33 +01:00
Goffi
97cf0e6e01 jp (outputs): added OUTPUT_COMPLEX type for data which are more complex than key/value dictionaries 2017-02-16 00:51:33 +01:00
Goffi
127744dd5b jp (core): added extra_outputs:
- extra outputs are output locals to a command which can be used in addition to the generic one which are compatible
    - added --output_option argument(s) to specify option specific to selected output
    - Jp.command now references the running command
2017-02-16 00:49:46 +01:00
Goffi
3e795fde5c jp (info/disco): added --node argument 2017-02-12 21:17:56 +01:00
Goffi
85f3bd5988 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
- profilesGetList now handles clients and components boolean arguments, to filter profiles
    - jp: added --clients and --components options to profile/list
    - profilesGetList now returns sorted profiles
2017-02-12 19:08:52 +01:00
Goffi
97337202cb core, jp: component handling + client handling refactoring:
- SàT can now handle components
    - plugin have now a "modes" key in PLUGIN_INFO where they declare if they can be used with clients and or components. They default to be client only.
    - components are really similar to clients, but with some changes in behaviour:
        * component has "entry point", which is a special plugin with a componentStart method, which is called just after component is connected
        * trigger end with a different suffixes (e.g. profileConnected vs profileConnectedComponent), so a plugin which manage both clients and components can have different workflow
        * for clients, only triggers of plugins handling client mode are launched
        * for components, only triggers of plugins needed in dependencies are launched. They all must handle component mode.
        * component have a sendHistory attribute (False by default) which can be set to True to allow saving sent messages into history
        * for convenience, "client" is still used in method even if it can now be a component
        * a new "component" boolean attribute tells if we have a component or a client
        * components have to add themselve Message protocol
        * roster and presence protocols are not added for components
        * component default port is 5347 (which is Prosody's default port)
    - asyncCreateProfile has been renamed for profileCreate, both to follow new naming convention and to prepare the transition to fully asynchronous bridge
    - createProfile has a new "component" attribute. When used to create a component, it must be set to a component entry point
    - jp: added --component argument to profile/create
    - disconnect bridge method is now asynchronous, this way frontends can know when disconnection is finished
    - new PI_* constants for PLUGIN_INFO values (not used everywhere yet)
    - client/component connection workflow has been moved to their classes instead of being a host methods
    - host.messageSend is now client.sendMessage, and former client.sendMessage is now client.sendMessageData.
    - identities are now handled in client.identities list, so it can be updated dynamically by plugins (in the future, frontends should be able to update them too through bridge)
    - profileConnecting* profileConnected* profileDisconnected* and getHandler now all use client instead of profile
2017-02-12 17:55:43 +01:00
Goffi
b5f1e45d4e core, bridge, frontends: renamed asyncConnect to connect, and added options parameters (not used yet) 2017-02-06 22:54:43 +01:00
Goffi
4eaf5d626f plugin XEP-0054, quick frontend(app): various improvments:
- memory.cache is now used
    - getAvatar and setAvatar has been renamed to avatarGet and avatarSet to follow new convention
    - getAvatar now return (optionally) full path, and may request vCard or only return avatar in cache
    - getAvatarFile has been removed as it is not needed anymore (avatarGet can return full path)
    - getCard has been removed from bridge as it was only used to request avatar
    - new internal method getBareOfFull return jid to use depending of the jid being part of a MUC or not
    - cache is now set per profile in client, instead of a general one for all profiles
    - thanks to the use of memory.cache, correct extension is now used in saved file, according to MIME type
    - fixed and better cache handling
    - a warning message is shown if given avatar hash differs from computed one
    - empty hash value is now in a constant, and ignored if received
    - QuickApp has been updated to follow new behaviour
    - Primitivus has been fixed (it was not declaring not using avatars correclty)
    - jp has been updated to follow new methods name
2017-01-15 17:51:37 +01:00
Goffi
e4000b4f3b jp (core): fixed signal registration for progressions 2017-01-15 16:00:40 +01:00
Goffi
1e09016747 jp (info/session): added a command to get data on current session 2017-01-05 22:22:26 +01:00
Goffi
fb0aaf2cae jp (constants): added exit code for error on bridge method call 2017-01-05 20:37:01 +01:00
Goffi
0a5fd6f3f4 primitivus, jp: dynamic bridge + fixed D-Bus bridge:
Primitivus and jp can now load the bridge specified in sat.conf, but they are only working with D-Bus so far (need to change all sync calls to async).
    Exit code 3 is used for Bridge init error.
2016-12-18 16:28:51 +01:00
Goffi
372f54ec2a bridge (D-Bus): bad design fixes:
- renamed outputed module to dbus_bridge (to avoid uppercase and conflict with dbus module)
    - class name is now Bridge for both frontend and core (make discovery/import more easy)
    - register renamed to register_method in core, and register_signal in frontend
2016-10-03 21:15:39 +02:00
Goffi
61a68ca0ca jp (message/send): message/send can now send XHTML (-x) or rich (-r) messages 2016-09-25 19:18:45 +02:00
Goffi
3aee03c381 jp (avatar): avatar get/set implementations, first draft 2016-09-13 22:19:47 +02:00
Goffi
fce13b52f8 jp (core): added EXIT_NOT_FOUND constant, which return 16 as exit code 2016-09-13 22:03:45 +02:00
Goffi
6a007eb69a jp (debug/bridge/method,signal): fixed argument parsing 2016-09-10 11:43:32 +02:00
Goffi
710e243d08 jp (debug): method callback now handles methods without return value 2016-08-28 20:10:04 +02:00
Goffi
371dd6134c jp (debug/bridge): fixed unicode handling of arguments 2016-08-21 18:57:56 +02:00
Goffi
93c860a443 jp: added jp/debug commands:
jp/debug hierarchy contain commands useful for developping and debugging.
    first commands are jp/debug/bridge:
        - "method" allows to call a bridge method, args are parsed as python arguments (using eval).
        - "signal" do the same to send a signal from backend, using the new debug plugin.
2016-08-21 12:27:19 +02:00
Goffi
a28bb7be8f merged main branch 2016-06-24 22:41:28 +02:00
Goffi
fe8187a413 jp (blog): fixed syntax detection when extension is .txt 2016-06-24 22:32:58 +02:00
Goffi
a7de473107 backend, frontends: message refactoring (huge commit):
/!\ several features are temporarily disabled, like notifications in frontends

next step in refactoring, with the following changes:
    - jp: updated jp message to follow changes in backend/bridge
    - jp: added --lang, --subject, --subject_lang, and --type options to jp message + fixed unicode handling for jid
    - quick_frontend (QuickApp, QuickChat):
        - follow backend changes
        - refactored chat, message are now handled in OrderedDict and uid are kept so they can be updated
        - Message and Occupant classes handle metadata, so frontend just have to display them
    - Primitivus (Chat):
        - follow backend/QuickFrontend changes
        - info & standard messages are handled in the same MessageWidget class
        - improved/simplified handling of messages, removed update() method
        - user joined/left messages are merged when next to each other
        - a separator is shown when message is received while widget is out of focus, so user can quickly see the new messages
        - affiliation/role are shown (in a basic way for now) in occupants panel
        - removed "/me" messages handling, as it will be done by a backend plugin
        - message language is displayed when available (only one language per message for now)
        - fixed :history and :search commands
    - core (constants): new constants for messages type, XML namespace, entity type
    - core: *Message methods renamed to follow new code sytle (e.g. sendMessageToBridge => messageSendToBridge)
    - core (messages handling): fixed handling of language
    - core (messages handling): mes_data['from'] and ['to'] are now jid.JID
    - core (core.xmpp): reorganised message methods, added getNick() method to client.roster
    - plugin text commands: fixed plugin and adapted to new messages behaviour. client is now used in arguments instead of profile
    - plugins: added information for cancellation reason in CancelError calls
    - plugin XEP-0045: various improvments, but this plugin still need work:
        - trigger is used to avoid message already handled by the plugin to be handled a second time
        - changed the way to handle history, the last message from DB is checked and we request only messages since this one, in seconds (thanks Poezio folks :))
        - subject reception is waited before sending the roomJoined signal, this way we are sure that everything including history is ready
        - cmd_* method now follow the new convention with client instead of profile
        - roomUserJoined and roomUserLeft messages are removed, the events are now handled with info message with a "ROOM_USER_JOINED" info subtype
    - probably other forgotten stuffs :p
2016-06-20 18:41:53 +02:00
Goffi
a9aa17f2d0 jp: fixed shebang python call 2016-06-19 22:22:08 +02:00
Goffi
6bbcbaf522 use of /usr/bin/env instead of /usr/bin/python in shebang 2016-04-17 14:45:26 +02:00
souliane
edb31e2d74 plugin adhoc_dbus, jp (cmd/adhoc): fixes adHocDBusAddAuto when no bus is found
fix bug 134
2016-04-17 13:37:40 +02:00
souliane
4408147e2d jp (cmd/roster): fixes division by zero exceptions
fix bug 135
2016-04-17 13:00:44 +02:00
Goffi
f600da971e jp (blog/edit): use utf-8-sig to decode content file to avoid BOM being propaged to content 2016-03-25 15:32:43 +01:00
Goffi
24be8976ef jp (blog/edit): added forgotten O_TRUNC while opening metadata file 2016-03-25 12:06:50 +01:00
Goffi
c951dea64b jp (blog/edit): do not remove files if they are not in the temporary dir hierarchy 2016-03-25 11:45:57 +01:00
Goffi
c3ae32be42 jp (blog/edit): HTTP(S) and XMPP URLs can now be directly used in blog/edit command 2016-03-24 18:38:04 +01:00
Goffi
e3623e67ef jp (blog): force deletion (without backup) when content is empty 2016-03-22 23:33:55 +01:00
Goffi
9d304eec88 jp (blog): avoid conflict error when command line tags are already present in metadata 2016-03-22 23:33:31 +01:00
Goffi
2fd6fa663c jp (blog): drafts are now put in a sub dir per profile + added a security which keep the last 10 drafts before removing them (all profiles included). 2016-03-22 22:46:05 +01:00
Goffi
2d1d286be2 core (tools): moved common to a separate package, and put data method in a data_format module 2016-03-22 22:46:04 +01:00
Goffi
d0fb849398 jp: fixed traceback shown on a normal quit when a progression is finished 2016-03-21 19:44:16 +01:00
Goffi
9782588177 jp (blog): added "updated" to keys to keys to remove from tmp metadata 2016-03-15 16:25:42 +01:00
Goffi
7ebae7c89a jp (blog/edit): removed meta_file_path non existence check, as it is now re-used if it exists 2016-03-10 19:13:42 +01:00
Goffi
3ab15a6aee jp (blog/edit): a draft file can be directly specified 2016-03-10 18:05:37 +01:00
Goffi
27cd8412d5 plugin XEP-0060: fixed traceback if service was None 2016-03-10 17:50:17 +01:00
Goffi
1fc8580831 jp: added consts for exit codes, not used yet 2016-04-23 23:30:06 +02:00
Goffi
b8e62dd69c jp: --output option:
- new --output option can be added wich use_output. use_output can be True (in which case it wild default to C.OUTPUT_TEXT), or any of C.OUTPUT_TYPES (currently text, list and dict)
    - output change the output format mainly to make command result parsing more easy, but it can also be use to add fancy effects (like coloration)
    - outputs are added with plugins in the same way as commands (import of both is done in the same method)
    - in the command class, output need to be declared with use_output=C.OUTPUT_xxx, then the data only need to be processed with self.output(data)
    - outputs can have description (not used yet)
    - use_xxx argument handling has been refactored (minor refactoring) to be more generic
    - first outputs are "default", "json" (pretty printed) and "json_raw" (compact json)
    - the first command to use them is "profile list"
2016-04-23 23:10:03 +02:00
Goffi
bf45c1d91c jp: forgotten shebang fixes 2016-04-19 20:09:02 +02:00
souliane
ce507c49da frontends (jp / blog): pass the profile to subprocess when using option --preview 2016-03-07 19:58:33 +01:00
Goffi
fe340c0135 jp (blog/preview): change watch for IN_MOVE_SELF event, needed at least for Emacs 2016-03-07 19:43:02 +01:00
Goffi
cf588d3e74 jp (blog/edit): added a confirmation message when blog item has been successfuly published 2016-03-05 20:19:40 +01:00
Goffi
f74fd5552a blog (jp/edit): added --preview option to launch a "blog preview" in parallel 2016-03-05 20:19:17 +01:00
Goffi
8839f38813 jp (blog/preview): inotify improvments:
- InotifyError are catched (can happen if file is deleted during preview for instance)
    - handle IN_DELETE_SELF event which happen when editor write content in a new file and switch to it (tested with vim)
2016-03-05 19:24:10 +01:00