Commit graph libervia-backend/sat/tools
Author SHA1 Message Date
Goffi
9b5d3ea17d tools (common): new async_utils module with an async version of lru_cache 2022-01-25 17:25:10 +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
7b05d97229 merge bookmark 0.9 2021-12-01 16:13:31 +01:00
Goffi
9eecdc184c tools (common/async_process): use parent environment by default 2021-11-30 17:28:42 +01:00
Goffi
50d7cb2a51 merge bookmark @ 2021-09-08 11:20:37 +02:00
Goffi
adad4494c3 tools (common/uri): fix uri parsing for Python 3.9+ 2021-09-08 11:14:47 +02:00
Goffi
fe502fc0fc merge branche "@" 2021-08-28 15:32:58 +02:00
Goffi
547eb9feba bridge: bridge can now be set using environment variable:
The `LIBERVIA_BRIDGE_NAME` environment variable can now be used to specify the bridge to
use. If set and different from empty string, the environment has precedence over config
file value.

For `pb` bridge, the following environment variable can also be used:

- LIBERVIA_BRIDGE_PB_CONNECTION_TYPE
- LIBERVIA_BRIDGE_PB_HOST
- LIBERVIA_BRIDGE_PB_PORT
2021-08-28 15:26:02 +02:00
Goffi
436696f28c merge branche "@" 2021-08-27 14:51:40 +02:00
Goffi
506368275a tools (common/date_utils): parse now alone (when used without relative delta) 2021-08-27 14:48:38 +02:00
Goffi
cb62511fa7 tools (common/async_process): remove useless encoding + use full path for command:
- arguments don't need to be encoded anymore, `spawnProcess` handles str directly now
- use full path even for first argument: even if first argument should be only executable
  name, it appears that using full path only in `command` is not enough (seen with Python
  where system installation is used instead of the VirtualEnv one when full path is not
  used as first argument).
(grafted from 25cbaf04772855cd8aead18771465a4f00f5fa03)
2021-07-29 22:51:01 +02:00
Goffi
60fe49f883 tools (common/async_process): remove useless encoding + use full path for command:
- arguments don't need to be encoded anymore, `spawnProcess` handles str directly now
- use full path even for first argument: even if first argument should be only executable
  name, it appears that using full path only in `command` is not enough (seen with Python
  where system installation is used instead of the VirtualEnv one when full path is not
  used as first argument).
2021-07-29 22:51:01 +02:00
Goffi
aab8a38836 tools (common/date_utils): accept more units (shortcuts) + fix timezone when date with relative delta is used 2021-07-29 22:51:01 +02:00
Goffi
4421eefbf3 merge changes from main branch 2021-06-17 13:05:58 +02:00
Goffi
7adbf3ead8 core, frontends: fix invalid translatable strings.
Some f-strings where used in translatable text, this has been fixed by using explicit
`format()` call (using a script based on `tokenize`).

As tokenize messes with spaces, a reformating tool (`black`) has been applied to some
files afterwards.
2021-06-14 18:35:12 +02:00
Goffi
80ee158daa tools (common/template_xmlui: add multi and value propertied to OptionsWidget 2021-06-04 14:44:33 +02: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
3c12c4f797 component file sharing (management): add values of quota and used size on result form 2021-05-05 15:37:33 +02:00
Goffi
6e6bc64eab tools (async_trigger): new asyncReturnPoint method 2021-05-05 15:37:33 +02:00
Goffi
4e36667134 tools (common/utils): new methods to parse and generate file size with symbols:
- `parseSize` lets parse a size which can be either a int, or a string with a symbol like
  `Mio`
- `getSizeMultiplier` returns a tuple of size with it's multiplier symbol
- `getHumanSize` returns a string with size and adapted multiplier.
2021-05-05 15:37:33 +02:00
Goffi
af053c5f34 tools (common/date_utils): fix date_only for short, long and full format 2021-05-01 18:36:13 +02:00
Goffi
2596f7ae77 tools (common/regex): move code to make user friendly URLs from web frontend 2021-04-16 18:32:44 +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
e39783de7f tools (config): show a warning when no config file has been found + don't use hardcoded filename in fixConfigOption 2021-03-20 20:42:07 +01:00
Goffi
018d09caaa Renamed the project from "Salut à Toi" to "Libervia":
This renaming follows the decision taken at the General Assemblee of January 27th 2021 (cf.
https://repos.goffi.org/sat_docs/raw-file/tip/association/2021-01-27%20-%20compte%20rendu%20de%20l%27AG%20extraordinaire.pdf)
2021-03-20 20:42:04 +01:00
Goffi
dc86957043 date update 2021-03-19 15:45:14 +01:00
Goffi
591b9fe8bc tools (common/template): new fallback settings:
`fallback` can be used to change fallback behaviour. By default, fallback is done on
`default` theme, this can be set to an other theme with a string, or to a list of
fallback. The list can also be empty is no fallback is desired (notably usefull for "main"
themes, on which other themes may fallback).

This setting replaces `css_default_fallback`.
2021-03-19 14:01:52 +01:00
Goffi
bd779e8ddd tools (image): fix bad method name used when fix_orientation is set in resize 2021-03-19 14:01:51 +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
32899b71e2 tools (common/email): try to guess sender domain when necessary:
when `DNSNAME` is `localhost.localdomain` and is `mail_sender_domain` is not set, a guess
is done to find a proper domain, using `email_from`.
2021-02-19 15:53:24 +01:00
Goffi
81e9ebdf9a tools (xml_tools): add missing value property to JidWidget 2020-12-10 14:11:45 +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
2d3d30d42b tools (async_trigger): use utils.asDeferred for async triggers:
A corouting or blocking method can now be used for async triggers.
2020-11-12 14:53:15 +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
a692ba8e2e tools (common/tls): removed unused import 2020-10-19 09:28:26 +02:00
Goffi
03cffe789c core: minor typos, docstring/comments update 2020-09-20 14:05:40 +02:00
Goffi
644277a659 tools: new video module:
this module is really basic at the moment, and use `ffmpeg` if present to make thumbnails.
2020-08-25 08:54:13 +02:00
Goffi
8854f96aec tools (image): fix_orientation on resize + fix_orientation method:
a new argument (`True` by default) fix orientation (i.e. rotate according to EXIF data) of
image when resizing it.

A new `fix_orientation` method (unused for now) let do it independently
2020-08-13 23:46:18 +02:00
Goffi
820fa05d49 tools (common/template): use to_json instead of json + added missing args to date_fmt 2020-07-16 09:07:26 +02:00
Goffi
9aa7b1b7f2 tools (common/data_objects): removed deprecated code:
`BlogItem`, `BlogItems` and `parsePubSubMetadata` are not needed anymore with the new blog
data serialisation.
2020-07-16 09:07:26 +02:00
Goffi
282d2a93d9 tools (common/data_objects): implemented json dumping for BlogItems/BlogItem 2020-06-19 15:47:16 +02:00
Goffi
4b0d91cb2e common (template): better json dumping:
default method is set for json dumping (the `tojson` filter), if the object has a `json`
attribute, it will be called, otherwise it is replaced by None, this avoids crash when
rendering the template.
2020-06-19 15:45:57 +02:00
Goffi
9ba6df5503 tools (common/utils): new OrderedSet class 2020-06-08 08:54:53 +02:00
Goffi
7000fcda34 tools (common/dynamic_import): log a warning if bridge can't be imported 2020-06-01 11:14:20 +02:00
Goffi
d09be4ba42 tools/common (tls): moved re-usable Twisted TLS code from Libervia to tools/common 2020-05-29 21:07:10 +02:00
Goffi
a1eb68c1e7 core: replaced sat shell script by a python script:
the backend is now launched by `sat.core.launcher`, and the script is generated during
installation with a new entry point in `setup.py`.
2020-05-25 15:50:01 +02:00