Commit graph libervia-backend/sat/plugins/plugin_misc_text_syntaxes.py
Author SHA1 Message Date
Goffi
d2685ba11b refactoring: renamed sat package to libervia.backend 2023-06-02 11:49:51 +02:00
Goffi
0eb54f9ca5 plugin text syntaxes: fix EscapeHTML following massive snake_case renaming 2023-05-29 17:52:25 +02:00
Goffi
6a6f15707a 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.
2023-04-08 13:54:42 +02:00
Goffi
01a1bf8691 plugin XEP-0060, XEP-0163, XEP-0277, text syntaxes: make those plugins usable with components 2022-01-25 17:26:05 +01:00
Goffi
14d00a9dda merge bookmark @ 2021-11-12 17:21:24 +01:00
Goffi
28b0a91fc7 plugin text syntaxes: remove id attributes and whitelist allowed classes:
for now, the only allowed classes are the one used for code highlighting.

fix 389
2021-10-21 11:55:39 +02:00
Goffi
972e96bf04 plugin text syntaxes: remove side effect on init:
When text syntaxes was initialised, `syntaxes` dict was filled, but it was a class
attribute. As a result, re-initialising it (which may happen for tests, and maybe in the
future dynamically), was not starting with an empty dict, but with an already-filled one,
resulting in conflicts.

This patch fixes it by moving `syntaxes` to an instance attribute.
2021-08-02 21:52:17 +02:00
Goffi
dc86957043 date update 2021-03-19 15:45:14 +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
c1fa2cf13b plugin text syntaxes: don't use anymore deprecated cgi.escape 2019-11-18 20:50:34 +01:00
Goffi
76aadbb3fb jp: jp asyncio port:
/!\ this commit is huge. Jp is temporarily not working with `dbus` bridge /!\

This patch implements the port of jp to asyncio, so it is now correctly using the bridge
asynchronously, and it can be used with bridges like `pb`. This also simplify the code,
notably for things which were previously implemented with many callbacks (like pagination
with RSM).

During the process, some behaviours have been modified/fixed, in jp and backends, check
diff for details.
2019-09-25 08:56:41 +02: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
6b83ef5c51 plugins: removed useless execute permission 2019-04-14 08:21:51 +02:00
Goffi
8f702a5d07 plugin text syntaxes: activated useful markdown extensions:
- code can now be highlighted, fenced code block can be used.
- new lines are converted to hard breaks
- sane lists are used
- tables are available
2019-03-25 18:40:12 +01:00
Goffi
fbb5442ff8 plugin text syntaxes: disable raw HTML parsing in mardown by default 2019-03-25 08:14:00 +01:00
Goffi
d4efb6dad1 plugin text syntaxes: fixed default syntax 2019-03-25 07:06:48 +01:00
Goffi
8f9235e661 plugin text syntaxes: handle empty content in cleanXHTML + don't use self-closing tags for non-void elements. 2019-01-19 11:39:02 +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
db0b00557a plugin text syntaxes: cleanStyle is an independent method, cleanXHTML is now blocking (no need to launch thread for that) 2019-01-19 11:39:02 +01:00
Goffi
f1c0eca9ab plugin text syntaxes: changed import name to TEXT_SYNTAX (better with underscore for autocompletion) 2019-01-19 11:39:02 +01:00
Goffi
8e338bf913 date update 2019-01-12 12:25:31 +01: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/plugins/plugin_misc_text_syntaxes.py (Browse further)