Mercurial > libervia-backend
comparison doc/libervia-cli/debug.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 | a1eff4e32848 |
children |
comparison
equal
deleted
inserted
replaced
4036:c4464d7ae97b | 4037:524856bd7b19 |
---|---|
15 Python arguments as many shell arguments, or put them in a single shell argument. | 15 Python arguments as many shell arguments, or put them in a single shell argument. |
16 | 16 |
17 You profile is automatically set if the method requires it (using the value of ``-p | 17 You profile is automatically set if the method requires it (using the value of ``-p |
18 PROFILE, --profile PROFILE``), so you must not specify it as an extra argument. | 18 PROFILE, --profile PROFILE``), so you must not specify it as an extra argument. |
19 | 19 |
20 You can refer to `Bridge API documentation`_ to get core methods signatures | 20 You can refer to `bridge API documentation`_ to get core methods signatures |
21 | 21 |
22 .. _Bridge API documentation: https://wiki.goffi.org/wiki/Bridge_API | 22 .. _Bridge API documentation: https://wiki.goffi.org/wiki/Bridge_API |
23 | 23 |
24 | 24 |
25 examples | 25 examples |
26 -------- | 26 -------- |
27 | 27 |
28 Send a message using a single shell arguments for all Python arguments. We | 28 Send a message using a single shell arguments for all Python arguments. We |
29 use first the method name (``messageSend``), then the required arguments (see `Bridge | 29 use first the method name (``message_send``), then the required arguments (see `bridge |
30 API documentation`_ for details), without the profile as it is automatically set. We | 30 API documentation`_ for details), without the profile as it is automatically set. We |
31 specify them as Python in one shell argument, so we use single quote (``\```)first for | 31 specify them as Python in one shell argument, so we use single quote (``\```)first for |
32 s hell string, and inside it we use double quote (``"``) for Python strings:: | 32 s hell string, and inside it we use double quote (``"``) for Python strings:: |
33 | 33 |
34 $ li debug bridge method messageSend '"louise@example.org", {"": "test message"}, {}, "auto", {}' | 34 $ li debug bridge method message_send '"louise@example.org", {"": "test message"}, {}, "auto", {}' |
35 | 35 |
36 .. note:: | 36 .. note:: |
37 | 37 |
38 This is for debugging only, if you want to send message with li, use :ref:`libervia-cli_message_send`. | 38 This is for debugging only, if you want to send message with li, use :ref:`libervia-cli_message_send`. |
39 | 39 |
40 Get version string of Libervia:: | 40 Get version string of Libervia:: |
41 | 41 |
42 $ li debug bridge method getVersion | 42 $ li debug bridge method version_get |
43 | 43 |
44 | 44 |
45 bridge signal | 45 bridge signal |
46 ============= | 46 ============= |
47 | 47 |
54 | 54 |
55 Send a note with ``info`` level and hand written XMLUI. Here me use a shell variable to | 55 Send a note with ``info`` level and hand written XMLUI. Here me use a shell variable to |
56 store the level, so we can easily change it if we want to use an other level for tests. | 56 store the level, so we can easily change it if we want to use an other level for tests. |
57 Note the use of quotes (to escape both for shell and Python):: | 57 Note the use of quotes (to escape both for shell and Python):: |
58 | 58 |
59 $ LEVEL='info'; li debug bridge signal -c actionNew '{"xmlui": '"'"'<?xml version="1.0" ?><sat_xmlui title="test title" type="dialog"><dialog level="'$LEVEL'" type="note"><message>test message\non\nseveral\nlines</message></dialog></sat_xmlui>'"'"'}' '""' -1 | 59 $ LEVEL='info'; li debug bridge signal -c action_new '{"xmlui": '"'"'<?xml version="1.0" ?><sat_xmlui title="test title" type="dialog"><dialog level="'$LEVEL'" type="note"><message>test message\non\nseveral\nlines</message></dialog></sat_xmlui>'"'"'}' '""' -1 |
60 | 60 |
61 | 61 |
62 monitor | 62 monitor |
63 ======= | 63 ======= |
64 | 64 |