Commit graph libervia-backend/sat/tools/utils.py
Author SHA1 Message Date
Goffi
f7fdde6dce tools (utils): fix parse_xmpp_date timezone:
rel 381
2022-10-28 18:47:17 +02:00
Goffi
1e4fc213f6 tools (utils): helper parse_xmpp_date method:
This method converts an XMPP date(time) to a unix time

rel 372
2022-09-21 22:29:54 +02:00
Goffi
672174fb23 tools: renamed module sat.tools.datetime to date.tools.xmpp_datetime to avoid conflict with Python's standard lib 2022-08-31 13:18:56 +02:00
Goffi
ed3660c4a7 tools (datetime, utils): fix incorrect use of naive object:
`tools.datetime.format_datetime` was expecting aware datetime objects while
`tools.utils.xmpp_date` was returning naive datetime objects. A check has been added to
the former one, and latter one has been modified to return aware datetime objects.
2022-08-31 13:11:26 +02:00
Syndace
d1b5ff0c41 plugin XEP-0420: Implementation of Stanza Content Encryption:
Includes implementation of XEP-0082 (XMPP date and time profiles) and tests for both new plugins.
Everything is type checked, linted, format checked and unit tested.
Adds new dependency xmlschema.

fix 377
2022-08-23 12:04:11 +02:00
Goffi
6c170ef8cc plugin XEP-0060, tools (utils): doc/type hints 2022-07-20 17:18:17 +02:00
Goffi
3ee5e1bbba tools (utils): fix getRepositoryData crash:
- use `hg_path` to be sure to use the right executable
- better exception handling
2022-03-22 17:00:42 +01:00
Goffi
893e8e7a96 tools (utils): new ensure_deferred decorator 2021-06-03 15:21:43 +02:00
Goffi
a5f225e1ea core (memory/storage): backend storage is now based on SQLAlchemy 2021-06-03 15:20:47 +02:00
Goffi
dc86957043 date update 2021-03-19 15:45:14 +01:00
Goffi
6ebc7da1f1 tools(utils): fixed error catching when getting repository data with pkg_resources 2020-11-16 14:44:43 +01:00
Goffi
03cffe789c core: minor typos, docstring/comments update 2020-09-20 14:05:40 +02:00
Goffi
067fcbe235 core (tools/utils): fixed return value for non async callbacks 2020-03-30 19:59:14 +02:00
Goffi
31e9cc7cbf core (tools/utils): new asDeferred function:
asDeferred is similar to defer.maybeCoroutine, and also handles coroutine.
2020-03-13 17:46:27 +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
48b13f0aeb core (tools/utils): fixed hex conversion in getRepositoryData following Python 3 port 2019-10-21 23:52:25 +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
8a59034935 plugin mr mercurial, tools(common/utils): moved command protocol to a new module 2019-01-25 09:06:29 +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
0242772939 tools (date_utils): moved date_parse to common.date_utils, because it can be used in frontends 2018-06-21 01:21:44 +02:00
Goffi
a9e368cf6a setup, tools(utils): fixed versioning in setup and getRepositoryData 2018-04-06 16:47:40 +02:00
Goffi
3951ea451a tools (utils): better repository version handling:
- removed save_dir_path and .hg_data/pickle method: it is not needed to save repository data anymore as its version is now saved on installation by setuptools_scm
- added "distance" (number of commits since last tag)
- use twisted's which method to find the hg executable
- result is now cached on first execution
- fixed dirstate method
- at last resort, try to find the repository version using the package version, as it is saved there by setuptools_scm
2018-04-05 15:23:38 +02:00
Goffi
578883b8bd tools(utils): fixed path handling in getRepositoryData 2018-04-04 09:21:00 +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/utils.py (Browse further)