Commit graph libervia-backend/src/tools
Author SHA1 Message Date
Goffi
1cfd34c38d core (tools/utils): added method to parse XMPP dates 2017-05-19 12:33:11 +02:00
Goffi
3ecb61f064 tools (common/uri): minor comment update 2017-04-20 17:20:44 +02:00
Goffi
affbd97593 tools (common/data_objects): comments items can now be chained to their parent 2017-04-17 20:34:43 +02:00
Goffi
9d60e145c0 tools/common (uri): added a method to build URI 2017-04-16 17:55:10 +02:00
Goffi
0c01779ae7 tools(common/uri): XMPP uri parsing module, first draft 2017-03-29 21:04:43 +02:00
Goffi
a022ae21af plugin XEP-0060: added getConfiguration ad psNodeConfigurationGet bridge method 2017-03-13 23:18:00 +01:00
Goffi
25c07ce105 plugin account, tools: some cleaning account + email and password tools:
- plugin misc account has been reordered and cleaned a bit.
    - new xmpp_domain setting is used to get the domain name of main XMPP server
    - password generation method has been moved to tools.utils
    - email sending method has been moved to tools.email
2017-03-12 19:32:59 +01:00
Goffi
a4934b1955 tools(templates): workflow improvments:
- template theme can be specified in parenthesis: (some_theme)path/to/template.html. Withtout parenthesis, "default" is used
    - static content are supposed to be in [theme]/static, error pages in [theme]/error/[err_code].html
    - default page are used in some case (2 for now): if error page with specified code doesn't exists, a base page is used, and if a page doesn't exist for a theme, the same one for default theme is looked for
    - CSS files are automatically found for HTML pages
    - CSS files can be split, the'll be added in the template according to the page requested.
    - theme CSS file is looked for, and if not found the default theme equivalent is looked for.
    - each element of a path can be associated to a CSS file, and styles.css is always there. For instance if blog/articles.html is requested, the following CSS can be included: "styles.css", "blog.css", "blog_article.css". They all must be in /static
    - if the automatic finding of CSS files is not wanted, css_files arguments can be used instead, with full relative path (i.e. including theme)
    - CSS files can be merged and included inline with css_inline argument
    - root_path can be specified, it will be used as a prefix for static files
    - requested theme (which may differ from actual theme, e.g. if the template is not found and default one is used instead) is available in template with "theme" variable
    - added getThemeAndRoot method to retrieve theme and theme root path from template
2017-03-05 23:41:10 +01:00
Goffi
9b0542fb46 core, frontends: various fixes for Libervia:
- quick_app: don't fail when we can't get autodisconnect parameter
    - bridge: removed useless BridgeFrontend parent class
    - use of TypeError, unicode and list to workaround Pyjamas incompatibilities
2017-02-26 18:23:01 +01:00
Goffi
4a36fba066 tools (common): fixed tty detection when isatty is not available 2017-02-23 07:33:30 +01:00
Goffi
8d578cec3b core (tools/common): data objects first draft:
this module aims is to help manipulate complex data from bridge, mainly for the template system.
    It is in common and not only in frontends as it may be used in some case by backend, if it needs to use template system in the future.
2017-02-21 21:01:40 +01:00
Goffi
23cb2e5843 core (tools/common): template renderer first draft:
jinja integration is being rewritten to be used not only in Libervia, this is a first step which put the renderer in backend/frontends tools.
    The renderer is mainly HTML oriented, but may be used for other files.
    sat_templates dependency is needed to use it.
2017-02-21 21:01:39 +01:00
Goffi
bc5f57702f core (constants), tools (common/ansi): moved ANSI escape codes to a dedicated class, with helper methods 2017-02-16 00:44:54 +01:00
Goffi
84fd46d62c tools (common/data_format): added dict2iterdict to yield dictionary from serialised complex values 2017-02-16 00:40:50 +01:00
Goffi
791be3a4ad core (xml_tools): fixed findAll
- names and namespases arguments haven been inverted to be in the same order as for domish.Element.elements
    - fixed bad copy of elements in recursions
    - check if childrens are IElements
    - namespaces and names can now be basestrings instead of iterables
2017-01-03 18:51:50 +01:00
Goffi
2618d48e7b core, quick_frontends: android compatibility hacks:
a couple of hacks have been used so backend can be launched on android using kivy
    - config file (sat.conf) is been read on a specific dir, using a detection of Cagou domains in constants.py
    - fixed crash when using sys.stdout.isatty in log_config.py
    - Q&D fix for logging encoding issue on android
    - when android is detected, the path/pattern to load plugins is modified
    - SRV is not working at the moment on android. If the platform is detected, the host is used directly with default port. A hosts_dir configuration can be used in [android] section to map a specific ip to a host
    - getRepositoryData in tools/utils return constant string on android. Proper repository data need to be copied during package building.
    - [quick app] more robust failure handling on asyncConnect error
    - [quick chat] default to utf-8 when getlocale doesn't return the actual locale.
2016-12-04 18:16:48 +01:00
Goffi
9ce91cf534 core: bridge can now be changed in conf
by default DBus bridge is used, but this can be changed in sat.conf's DEFAULT section using "bridge" option.
    bridge can be "dbus" (or equivalent "dbus_bridge") or embedded at the moment.
    Bridge name used is saved in SAT.bridge_name, and load_bridge method can be used by frontends.
2016-12-04 18:16:37 +01:00
Goffi
3337750def core (tools/common): added getSubDict method in data_format to get sub dictionary from serialised one 2016-09-25 19:16:25 +02:00
Goffi
44933e1a60 core (stdui): fixed cancellation of ContactList forms 2016-09-11 23:17:31 +02:00
Goffi
527e561a3e core (xmlui): added a quickNote method to easily send notes 2016-08-28 18:16:03 +02:00
Goffi
06663b9571 core: removed pyfeed and xe dependencies:
pyfeed and xe where still used only for date format handling, and there is already dateutil which is a dependency of Wokkel.
    Furthermore pyfeed and xe are still not on pypi, causing troubles for installation with pip
2016-04-17 17:08:12 +02:00
Goffi
6bbcbaf522 use of /usr/bin/env instead of /usr/bin/python in shebang 2016-04-17 14:45:26 +02:00
Goffi
3d20c6e059 tool (common): added forgotten __init__.py 2016-03-22 22:49:00 +01:00
Goffi
787a84c29d tools (common): added regex module with path (un)escaping methods 2016-03-22 22:46:04 +01:00
Goffi
2d1d286be2 core (tools): moved common to a separate package, and put data method in a data_format module 2016-03-22 22:46:04 +01:00
Goffi
c4ac825c8f plugin XEP-0060: service, node and uri are added to metadata when doing a getItems 2016-03-09 16:59:29 +01:00
Goffi
0e1bf65f08 core (tools/config): fixed fixConfigOption:
C.DEFAULT_CONFIG was used so the default values were written if not set in the config file used, resulting in a overriding of values set in config files of higher level (e.g. ~/.config/sat/sat.conf could override /etc/sat.conf values).
2016-03-09 12:11:35 +01:00
Goffi
8403bd61ae core (memory, config): moved parseMainConf to tools/config so it can be used by frontends too 2016-02-29 16:13:47 +01:00
Goffi
9de26f66ea tools (utils): improved repository version detection:
- getRepositoryData has 2 new option: is_path to give absolute path instead of module name, and save_dir_path to save the repository data in a pickled dictionnary
    - if "hg" executable doesn't work, a .hg_data dictionnary is checked if present in module root path
2016-02-28 13:42:31 +01:00
Goffi
00f47f8181 core (tools): fixed bad call to "hg id" when hg is not working to guest revision, which was the cause of an Exception 2016-02-28 01:57:51 +01:00
Goffi
04a42fa9a3 core (config): getConfig now returns unicode and raise exceptions.ParsingError in case of parsing problem 2016-01-24 18:28:08 +01:00
Goffi
c5d6e545f5 core (config): _dict values are now handled with json syntax 2016-01-23 20:06:01 +01:00
Goffi
99894bd6f2 core (xml_tools): added a method to find all elements corresponding to criteria 2016-01-22 20:24:17 +01:00
Goffi
6c11191230 core (xml_tools): unescape HTML sequences to avoid parsing error in ElementParser 2016-01-22 20:24:17 +01:00
Goffi
4a44b41793 core (xml_tools), plugin XEP-0277: ElementParser element now manage automatically the wrapping with <div/> element when needed + fixed content_xhtml/title_xhtml in XEP-0277 2016-01-22 20:24:17 +01:00
Goffi
7a2b6fa909 tools (xml_tools): removed unused import 2016-01-13 13:12:50 +01:00
Goffi
fbb50a025d reverted patch 3770d13776e8 2016-01-13 13:11:20 +01:00
Goffi
348be27934 copyright update 2016-01-03 16:28:30 +01:00
souliane
3cc6e41ad6 tools, plugins XEP-0071, XEP-0277: remove recently added expandNewLinesToXHTML, just leave it to the convertors 2015-12-15 20:29:19 +01:00
souliane
9e0b24a4a5 memory (params): parameter jids_list values are specified with <jid>...</jid> 2015-12-15 14:12:19 +01:00
Goffi
18b1ca3d31 core (xmlui): fixed deferConfirm 2015-12-15 12:41:07 +01:00
Goffi
2a5a33df1f core (xmlui): fixed bad call of deferredUI in deferXMLUI 2015-12-15 12:20:55 +01:00
souliane
d38543029f tools: expandNewLinesToXHTML replaces two or more \n instead of each ones 2015-12-11 07:54:14 +01:00
souliane
2df5519eda plugin XEP-0277, xml_tools: restore decapsulation of XHTML content
- to avoid successive nesting of the content in <div>
    - otherwise there is a new <div> at each item modification
2015-12-10 14:21:51 +01:00
souliane
ca5c913ce2 xml_tools, plugin XEP-0071, XEP-0277: add method expandNewLinesToXHTML:
- \n in XHTML content should not be converted to <br /> by the frontend
    - save it directly in the Atom payload for better compatibility with other clients
2015-12-10 14:00:21 +01:00
Goffi
6a44221a83 core (xmlui): new deferredUI method allows to manage XMLUI with a Deferred insteand of manual submit_id handling:
- this differ from deferXMLUI, as it can be used in ui returned to frontend after a bridge call (deferXMLUI use actionNew only)
    - the "chained" argument  allow to manage series of XMLUIs
    - this argument is also present in deferXMLUI
2015-11-27 16:45:55 +01:00
Goffi
6540e5fb6f core (tools): new tools.common module with tools used by backend and frontends. dict2iter and iter2dict method to serialise iterable in a dict (for bridge) 2015-11-24 16:21:18 +01:00
Goffi
6b7272c5b3 core (xmlui): fixed security_limit in deferXMLUI 2015-11-22 21:24:23 +01:00
Goffi
a42452ff57 core, bridge: actionsGet:
- added a new mechanism to keep actions until they are answered (or timeout-ed)
    - keep_id must be explicitly used on actionNew
    - actionsGet is used to retrive these actions
    - the mechanism is used in deferXMLUI
2015-11-17 21:28:58 +01:00
Goffi
de85e24577 core (xmlui), plugin file: added action_extra param to deferXMLUI/deferDialog which is merged to the action data dict when actionNew is called 2015-11-15 23:11:27 +01:00