comparison doc/components.rst @ 4037:524856bd7b19

massive refactoring to switch from camelCase to snake_case: historically, Libervia (SàT before) was using camelCase as allowed by PEP8 when using a pre-PEP8 code, to use the same coding style as in Twisted. However, snake_case is more readable and it's better to follow PEP8 best practices, so it has been decided to move on full snake_case. Because Libervia has a huge codebase, this ended with a ugly mix of camelCase and snake_case. To fix that, this patch does a big refactoring by renaming every function and method (including bridge) that are not coming from Twisted or Wokkel, to use fully snake_case. This is a massive change, and may result in some bugs.
author Goffi <goffi@goffi.org>
date Sat, 08 Apr 2023 13:54:42 +0200
parents 425d809a505b
children d6837db456fd
comparison
equal deleted inserted replaced
4036:c4464d7ae97b 4037:524856bd7b19
382 - if you need to use special characters, then you'll have to use ``___`` followed by the 382 - if you need to use special characters, then you'll have to use ``___`` followed by the
383 special encoding (see below). 383 special encoding (see below).
384 384
385 The encoding is explained in the documentation of the following method: 385 The encoding is explained in the documentation of the following method:
386 386
387 .. automethod:: sat.plugins.plugin_comp_ap_gateway.APGateway.getJIDAndNode 387 .. automethod:: sat.plugins.plugin_comp_ap_gateway.APGateway.get_jid_and_node
388 388
389 389
390 .. [#AP_chars] Most if not all AP implementations use webfinger `acct` URI as a de-facto 390 .. [#AP_chars] Most if not all AP implementations use webfinger `acct` URI as a de-facto
391 standard to manage user-friendly handles (something like ``user@example.org``). Those 391 standard to manage user-friendly handles (something like ``user@example.org``). Those
392 handles, according to `RFC7565`_, should 392 handles, according to `RFC7565`_, should
857 857
858 Using the Component (for developers) 858 Using the Component (for developers)
859 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 859 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
860 860
861 Publication of AP items can be tested using the following method (with can be accessed 861 Publication of AP items can be tested using the following method (with can be accessed
862 through the ``APSend`` bridge method, client is then replaced by the ``profile`` name, as 862 through the ``ap_send`` bridge method, client is then replaced by the ``profile`` name, as
863 last argument): 863 last argument):
864 864
865 .. automethod:: sat.plugins.plugin_comp_ap_gateway.APGateway.publishMessage 865 .. automethod:: sat.plugins.plugin_comp_ap_gateway.APGateway.publish_message
866 866
867 The method can be used either with CLI's :ref:`debug bridge method 867 The method can be used either with CLI's :ref:`debug bridge method
868 <li_debug_bridge_method>` or with any D-Bus tool like ``qdbus`` or ``d-feet`` (only if you 868 <li_debug_bridge_method>` or with any D-Bus tool like ``qdbus`` or ``d-feet`` (only if you
869 use the D-Bus bridge). 869 use the D-Bus bridge).
870 870
873 873
874 On its ``example.net`` Mastodon instance, Pierre has published a message with the id 874 On its ``example.net`` Mastodon instance, Pierre has published a message with the id
875 ``https://example.net/@pierre/106986412193109832``. To send a reply to this message, 875 ``https://example.net/@pierre/106986412193109832``. To send a reply to this message,
876 Louise can use the following command:: 876 Louise can use the following command::
877 877
878 $ li debug bridge method -c APSend '"{\"node\": \"https://example.net/@pierre/106986412193109832\", \"content\": \"A lille hello from XMPP\"}","pierre\\40example.net@ap.example.org", "louise"' 878 $ li debug bridge method -c ap_send '"{\"node\": \"https://example.net/@pierre/106986412193109832\", \"content\": \"A lille hello from XMPP\"}","pierre\\40example.net@ap.example.org", "louise"'
879 879
880 Note the double escaping, one for the shell argument, and the other to specify JSON 880 Note the double escaping, one for the shell argument, and the other to specify JSON
881 object. 881 object.