Commit graph libervia-backend/sat/core/constants.py
Author SHA1 Message Date
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
d21a6a660f 0.8 development starts 2019-07-31 11:31:22 +02:00
Goffi
5e43c6c98c core, plugin XEP-0045: fixed message type autodetection + ENTITY_TYPE_MUC constant:
an old hardcoded value was used in several places to detect if an entity is a MUC, but this
value was not valid anymore. This has been fixed, and ENTITY_TYPE_MUC constant is now used
instead. This fixes message type autodetection for "groupchat" messages.

fixes 300
2019-07-09 09:06:45 +02:00
Goffi
218390a0d9 logs: increased defaut limit for memory output to 300 2019-06-30 15:40:52 +02:00
Goffi
ffb051fca2 core (constants): fixed flatpak config paths for older versions of flatpak:
Older versions of Flatpak don't seem to set FLATPAK_ID, but do set FLATPAK_SANDBOX_DIR, so
this is now checked too to detect flatpak.
2019-06-30 15:39:58 +02:00
Goffi
29c4e048df core (constants): fixed Flatpak config path:
trailing "/" was missing in flatpak config path, resulting in the configuration not being read properly on this platform.
2019-06-27 20:26:00 +02:00
Goffi
e85c55f7a0 core (config): if flatpak is detected, config is also looked after in /app 2019-06-23 17:40:19 +02:00
Goffi
a090b76afd core (constants): added generic constants for "info", "warning" and "error" levels 2019-05-26 22:22:01 +02:00
Goffi
a782b6e6e0 core (constants): "on" can now be used as True value in bool method. 2019-05-26 22:22:00 +02:00
Goffi
1f7d5bfd94 constants: added KEY_LANG which is the key/name used in templates to change language/locale. 2019-04-10 21:04:51 +02:00
Goffi
e89135b8ae plugin XEP-0384: give feedback to client when encryption failed 2019-03-20 09:08:47 +01:00
Goffi
8e338bf913 date update 2019-01-12 12:25:31 +01:00
Goffi
3e63d54e3d plugins XEP-0060, XEP-0313: implemented Order-By protoXEP:
new "order_by" key can be used in extra data, value can be, for now, "creation" or "modification".
2019-01-06 17:36:51 +01:00
Goffi
02dc38762e core (constants): added a constant for "encrypted" 2019-01-04 18:46:02 +01:00
Goffi
ed049c7a9d core: removed whitespace ping (not needed anymore as we handle XMPP ping) 2018-11-19 21:08:25 +01:00
Goffi
05b59775d0 plugin XEP-0198: Stream Management implementation:
- hooks can now be set in stream onElement and send methods
- xmllog refactored to use new hooks
- client.isConnected now uses transport.connected method
- fixed reconnection, SàT will now try to reconnect indefinitely until it success, unresolvable failure happen (e.g. invalid certificate), or explicit disconnection is requested (or a plugin change this behaviour)
- new triggers: "stream_hooks", "disconnecting", "disconnected", and "xml_init" (replace "XML Initialized")
2018-11-18 15:49:46 +01:00
Goffi
18a4d3d544 core: fixed package name for Android 2018-10-05 13:42:06 +02:00
Goffi
e70405cfc2 tools (common/template), jp: refactoring to handle multiple sites:
- site can now be specified in template header before theme, for instance: (some_site/some_theme)path/to/template.ext
- absolute template paths are now implemented, but Renderer must be instanciated with trusted to True for security reason (it's the case for jp)
- a new "front_url_filter" callable can be given to Renderer, which will convert template path to URL seen by end-user (default to real path).
- the "front_url_filter" can be used in templates with… "front_url" filter
- template_data is a new named tuple available in templates, which give site, theme and template relative URL
- search order is site/theme, site/default_theme, and default/default_theme where default link to sat_pubsub templates
- when loading CSS files, files with _noscript suffixes are now loaded, and used when javascript is not available
- "styles_extra.css" is also loaded before "styles.css", useful when a theme want to reuse default style, and just override some rules
- new site can be specified in sat.conf [DEFAULT] section, using sites_path_public_dict or sites_path_private_dict (where sites_path_private_dict won't be used in public frontends, like Libervia)
- "private" argument of Renderer tells the renderer to load private sites or not
- templates are now loaded from "templates" subdirectory, to differenciate them from other data like i18n
- jp template output has been updated to handle those changes, and to manage absolute templates
2018-09-10 08:58:18 +02:00
Goffi
32b4db60c9 core: new EncryptionHandler class which manage encrypted session as a core feature:
Plugin handling encryption can now register using host.registerEncryptionPlugin, and an encryption session can now be started using messageEncryptionStart bridge method.

This will make encryption handling more easy, as we now know if a session is clear or e2e encrypted, and which plugin handle it.
2018-07-29 19:22:56 +02:00
Goffi
f2b1398a9f core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
generation of D-Bus bridge has been broken by black formatting tool, this patch fixes this.
2018-07-01 20:37:58 +02:00
Goffi
744cb0c503 code style reformatting using black 2018-06-27 20:14:46 +02:00
Goffi
785af76bc0 tools (common): moved date_fmt function from template filters to new date_utils module, so it can be used everywhere. 2018-06-01 12:04:06 +02:00
Goffi
37c73105e0 core (constants): new downloads_dir config option (default path where files can be downloaded):
use Android API to find downloads_dir on this platform
2018-05-25 10:51:59 +02:00
Goffi
c43f8e6205 core (constants): updated Android constants for Cagou 2018-04-13 18:44:22 +02:00
Goffi
ac954f378d setup: version is now set in SAT/VERSION, sat is not imported anymore in setup 2018-04-05 10:41:08 +02:00
Goffi
14c817fa2c setup, constant: use https address in APP_URL, and keep pypi NAME separated from constants 2018-04-03 09:04:55 +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/core/constants.py (Browse further)