Commit graph libervia-backend/sat/tools/xml_tools.py
Author SHA1 Message Date
Syndace
e062c2f0e5 plugin XEP-0384: Implementation of Automatic Trust Management:
- Implementation of Trust Messages (XEP-0434)
- Implementation of Automatic Trust Management (XEP-0450)
- Implementations directly as part of the OMEMO plugin, since omemo:2 is the only protocol supported by ATM at the moment
- Trust system selection updated to allow choice between manual trust with ATM and BTBV
- dev-requirements.txt updated to include additional requirements for the e2e tests

fix 376
2022-10-28 18:50:06 +02:00
Goffi
6255985262 tools (xml_tools): domish_elt_2_et_elt and et_elt_2_domish_elt now handle lxml.etree 2022-10-28 18:47:17 +02:00
Goffi
8444115262 plugin XEP-0384, xml_tools: avoid getItems timeout + fix empty node crash + parsing:
- use `max_items` in `getItems` calls for bundles, as otherwise some pubsub service may
  return full nodes, which may be huge is `max_items=1` is not set on the node, possibly
  resulting in timeouts.

- the plugin was crashing when TWOMEMO devices list node has no items at all. This is not
  the case anymore.

- a naive parsing method has been implemented in `xml_tools` to replace the
  serialisation/deserialisation method. This should be more efficient and will avoid
  annoying `ns0:` prefixes in XML logs.
2022-09-24 16:37:46 +02:00
Goffi
97c0d6a0e5 tools (xml_tools): handle required field in dataDict2dataForm:
rel 372
2022-09-21 22:43:55 +02:00
Goffi
e393c908b0 tools (xml_tools): fix widget_args modification in _dataFormField2XMLUIData:
in `textbox` widget, the first arg was modified with all values, lettings other ones
unchanger, resulting in invalid number of arguments. This has been fixed by replacing all
args with the new value.
2022-01-31 18:35:52 +01:00
Goffi
03ca0037f3 tools (xml_tools): implement list-multi in _dataFormField2XMLUIData:
`list-multi` was missing and thus these data form field type was not supported, resulting
in those fields shown as a text field.

Due to legacy, current implementation use a hack to split values, this should be fixed
later by using proper serialisation.
2021-12-08 15:45:57 +01:00
Goffi
3c12c4f797 component file sharing (management): add values of quota and used size on result form 2021-05-05 15:37:33 +02:00
Goffi
839aea4e2b tools (xml_tools): new findAncestor method:
this methods help to find a `domish.Element` ancestor with specific name/namespace
2021-03-27 14:35:07 +01:00
Goffi
dc86957043 date update 2021-03-19 15:45:14 +01:00
Goffi
026ac9db13 tools (xml_tools): new dataForm2dataDict and dataDict2dataForm:
those methods convert a serialisable dict format to `wokkel.data_form.Form` and vice versa
2021-02-27 18:36:38 +01:00
Goffi
843928bf02 tools (xml_tools): fix pFmtElt:
default URI was not handled correctly, and attributes were missing, this patch fixes
those bugs.
2021-02-19 15:53:25 +01:00
Goffi
81e9ebdf9a tools (xml_tools): add missing value property to JidWidget 2020-12-10 14:11:45 +01:00
Goffi
1aeeffd399 tools (xml_tools): domish.Element pretty formatting functions:
- `pFmtElt`: pretty format a `domish.Element`
- `ppElt`: use the above function to pretty print a `domish.Element`
2020-11-12 14:53:15 +01:00
Goffi
54494409d2 tools (xml_tools): added with_parent and with_children argument to elementCopy 2020-11-12 14:53:15 +01:00
Goffi
1167c12c6f tools(xml_tools): fixed <div> unwrapping + added parse instance:
`<div>` unwrapping could fail when a text node was a sibling of the top element (could
easily happen ith a `\n` line feed added by an editor). This is fixed by filtering on
IElement with `elements()`.

A `parse` instance has been added as it is not necessary to create a new `ElementParser`
each time that we want to parse something.
2020-11-12 14:53:15 +01:00
Goffi
56d6613c4d tools (xl_tools): fixed handling of list options labels 2020-03-27 09:50:42 +01:00
Goffi
e1a44cf4e4 fixed shebangs 2020-01-29 10:07:00 +01:00
Goffi
a39349fe64 dates update 2020-01-29 09:50:54 +01:00
Goffi
fbfe96c505 Python 3 port:
/!\ this is a huge commit
/!\ starting from this commit, SàT is needs Python 3.6+
/!\ SàT maybe be instable or some feature may not work anymore, this will improve with time

This patch port backend, bridge and frontends to Python 3.

Roughly this has been done this way:

- 2to3 tools has been applied (with python 3.7)
- all references to python2 have been replaced with python3 (notably shebangs)
- fixed files not handled by 2to3 (notably the shell script)
- several manual fixes
- fixed issues reported by Python 3 that where not handled in Python 2
- replaced "async" with "async_" when needed (it's a reserved word from Python 3.7)
- replaced zope's "implements" with @implementer decorator
- temporary hack to handle data pickled in database, as str or bytes may be returned,
  to be checked later
- fixed hash comparison for password
- removed some code which is not needed anymore with Python 3
- deactivated some code which needs to be checked (notably certificate validation)
- tested with jp, fixed reported issues until some basic commands worked
- ported Primitivus (after porting dependencies like urwid satext)
- more manual fixes
2019-08-13 19:08:41 +02:00
Goffi
0f97a75f6f tools (xml_tools): added "read_only" argument in dataFormResult2XMLUI (and use it in plugin pubsub_schema) 2019-06-12 09:11:28 +02:00
Goffi
7d8d9c8ccb tools (xml_tools): split new lines for multi-lines text in XMLUIResult2DataFormResult to be correctly handled in data form 2019-05-03 20:48:19 +02:00
Goffi
82bb99f88c core (xml_tools): new elementCopy method to shallow copy a domish.Element 2019-02-28 18:57:00 +01:00
Goffi
87871fabca core (XMLUI): new XHTMLBox widget:
XHTMLBox is a textbox specialised in XHTML, i.e. it renders the XHTML when in read_only, and it allows to edit it.
The XHTML is cleaned by default, the cleaning is done by Text Syntaxes plugin (actually there is a cleaning method which can be set by any plugin, but Text Syntaxes is the one which does it).
2019-01-19 11:39:02 +01:00
Goffi
8e338bf913 date update 2019-01-12 12:25:31 +01:00
Goffi
b33d1f66de core (XMLUI): small optimisation: introspection is done once at module loading instead of on each XMLUI instantiation 2019-01-11 09:48:17 +01:00
Goffi
7dc9aae5aa tools (xml_tools): isXMLUICancelled helper function to check if an XMLUI has been cancelled from raw XML. 2019-01-03 20:49:21 +01:00
Goffi
24c4cc0487 frontends (XMLUI): TabsContainer can now be the main container (Primitivus keep the old behaviour and always use VerticalContainer as main container) 2019-01-02 18:32:16 +01:00
Goffi
14fd4252eb core, frontends (xmlui): added "hidden" widget, to specify a value to be returned unmodified 2018-08-31 15:57:11 +02:00
Goffi
d5c9fa5e31 plugin XEP-0070: use a confirm dialog instead of a form + simplified a bit the code 2018-06-27 21:15:34 +02:00
Goffi
744cb0c503 code style reformatting using black 2018-06-27 20:14:46 +02:00
Goffi
80ef13612b core, setup: huge cleaning:
- moved directories from src and frontends/src to sat and sat_frontends, which is the recommanded naming convention
- move twisted directory to root
- removed all hacks from setup.py, and added missing dependencies, it is now clean
- use https URL for website in setup.py
- removed "Environment :: X11 Applications :: GTK", as wix is deprecated and removed
- renamed sat.sh to sat and fixed its installation
- added python_requires to specify Python version needed
- replaced glib2reactor which use deprecated code by gtk3reactor

sat can now be installed directly from virtualenv without using --system-site-packages anymore \o/
2018-04-02 19:44:50 +02:00
Renamed from src/tools/xml_tools.py (Browse further)