{
"info": {
"author": "Simon Delcourt",
"author_email": "simon.delcourt@imio.be",
"bugtrack_url": null,
"classifiers": [
"Environment :: Web Environment",
"Framework :: Plone",
"Framework :: Plone :: 4.3",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7"
],
"description": ".. image:: https://travis-ci.org/IMIO/imio.helpers.svg?branch=master\n :target: https://travis-ci.org/IMIO/imio.helpers\n\n.. image:: https://coveralls.io/repos/IMIO/imio.helpers/badge.png?branch=master\n :target: https://coveralls.io/r/IMIO/imio.helpers?branch=master\n\n\n====================\nimio.helpers\n====================\n\nVarious helper methods for development.\n\n\nRequirements\n------------\n\nThe barcode generation method uses zint tool (https://sourceforge.net/projects/zint/).\n\nYou have to install zint version >= 2.6.0.\n\nContributors\n============\n\n- Simon Delcourt, simon.delcourt@imio.be\n- Gauthier Bastien, gauthier.bastien@imio.be\n\nChangelog\n=========\n\n0.23 (2019-09-12)\n-----------------\n\n- Added `content.get_vocab` helper method to easily get a `IVocabularyFactory`\n vocabulary instance or only the factory when parameter `only_factory=True`.\n [gbastien]\n- Added `catalog.reindexIndexes` helper method making it possible to reindex a\n specific `portal_catalog` index with `ZLogHandler` log output.\n [gbastien]\n- Added javascript function to callViewAndReload with ajax. Gotten from PloneMeeting ;-)\n [sgeulette]\n- Added get_state_infos (used in PM and plonetheme.imioapps).\n [sgeulette]\n\n0.22 (2019-08-23)\n-----------------\n\n- Added parameter `update_metadata` to `catalog.addOrUpdateColumns`,\n if `True` (default), the new added metadata are updated on every\n catalogued objects.\n [gbastien]\n- Added function to return html link for an object\n [sgeulette]\n\n0.21 (2019-08-13)\n-----------------\n\n- Added parameter `get_again=False` to\n `cache.invalidate_cachekey_volatile_for`, when True, this will call\n `cache.get_cachekey_volatile` just after the cache is invalidated so we get\n a fresh date stored. This is useful to avoid write by async requests if it\n calls `cache.get_cachekey_volatile`.\n [gbastien]\n\n0.20 (2019-07-19)\n-----------------\n\n- In `xhtml.storeImagesLocally`, do not break when a `resolveuid` is found but\n it does not find the image. This can be the case when copy/pasting HTML code\n from another instance or so.\n [gbastien]\n- In `xhtml.removeBlanks`, check if content is empty by calling\n `xhtml.xhtmlContentIsEmpty` with parameter `tagWithAttributeIsNotEmpty=False`\n so empty tags with attributes are considered empty.\n [gbastien]\n\n0.19 (2019-07-05)\n-----------------\n\n- Patch index method from collective.solr to fix an issue with partial reindex\n [mpeeters]\n- Added css id on row field display in container.pt and content.pt.\n [sgeulette]\n\n0.18 (2019-05-16)\n-----------------\n\n- Added `appy.pod` sample that show problem of wrongly defined style like\n `margin-left: opt;` using `opt` instead `0pt`.\n [gbastien]\n- Added `appy.pod` sample that show problem of class not used in `
`\n or `
`.\n [gbastien]\n- Added methods `content.disable_link_integrity_checks` and\n `content.restore_link_integrity_checks` to be able to disable the\n `enable_link_integrity_checks property` and to restore it to it's original\n value. This works for Plone4 (property) and Plone5 (registry).\n [gbastien]\n- Fix import of `IEditingSchema` on Plone5.\n [gbastien]\n\n0.17 (2019-02-12)\n-----------------\n\n- Added collapsible option on container view.\n [sgeulette]\n- Do not store date for get_cachekey_volatile/invalidate_cachekey_volatile_for\n in a volatile (_v_...) as it seems \"stored\" by thread and is computed to much\n times.\n [gbastien]\n- Added JS helper method has_faceted returning true if currently on a faceted.\n [gbastien]\n\n0.16 (2019-01-31)\n-----------------\n\n- Added `appy.pod` usecase to show problems with table optimization if\n `
` has a defined size.\n [gbastien]\n- Added `appy.pod` usecase to show problems with table having a first empty\n `
` that do not render second column of following lines.\n [gbastien]\n- Added `appy.pod` usecase for line-height style.\n [gbastien]\n- Added `appy.pod` usecase for `` without `src` that breaks generation.\n [gbastien]\n- Do not break in `xhtml.imagesToPath` if `` does not have a `src`.\n [gbastien]\n\n0.15 (2018-12-18)\n-----------------\n\n- Display more logging in `content.validate_fields` when bypassing validation.\n [gbastien]\n- In `catalog.addOrUpdateIndexes`, pass a `ZLogHandler` to `reindexIndex` so the\n progress is shown in the Zope log.\n [gbastien]\n- In `content.add_to_annotation` and `content.del_from_annotation`, store\n annotation in a `PersistentList` instead a `set()` to avoid persistence\n problems.\n [gbastien]\n\n0.14 (2018-10-22)\n-----------------\n\n- Improved content create to avoid creating object when defined id already exists.\n [sgeulette]\n- Added methods content.uuidsToCatalogBrains and content.uuidsToObjects.\n [gbastien]\n- Adapted `content.validate_fields` to bypass validation when field.required=False,\n value is None and field type is other than Bool. Validation is also bypassed for\n field using a `source` attribute because it fails for now...\n [gbastien]\n- Added parameter raise_on_errors to content.validate_fields to raise a ValueError\n when errors are found instead simply returning it.\n [gbastien]\n\n0.13 (2018-08-31)\n-----------------\n\n- Added `content.get_schema_fields` to get schema fields (behaviors included\n by default).\n [sgeulette]\n- Pep8 on imports.\n [sgeulette]\n- Added appy.pod usecase for lists containing tables.\n [bleybaert]\n- Added dependency on `Plone` in `setup.py`.\n [gbastien]\n- Do not break in `xhtml.storeImagesLocally._handle_internal_image` if image\n src is not a path to an image but to another element (like `Folder` or\n `Plone Site`).\n [gbastien]\n\n0.12 (2018-05-03)\n-----------------\n\n- Added appy.pod usecase for rgba().\n [gbastien]\n- Improved annotation code\n [sgeulette]\n\n0.11 (2018-01-30)\n-----------------\n\n- Use `html` instead `xml` for `lxml.html.to_string` rendering `method`.\n This avoids results like `
` turned to `
`.\n [gbastien]\n\n0.10 (2017-12-21)\n-----------------\n\n- Fixed bug in `catalog.addOrUpdateIndexes` where a new index was not reindexed\n if it was added together with an already existing index.\n [gbastien]\n- Fixed bug in `xhtml.storeImagesLocally` when img uses a `resolveuid` and\n starts with the `portal_url` (this is the case when using `uploadimage plugin`\n in `collective.ckeditor`), it raised a NotFound error.\n [gbastien]\n- In `xhtml.storeImagesLocally`, keep the `scale` at the end of the URL using\n `resolveuid` (like `resolveuid/content_uid/image_preview`).\n [gbastien]\n- Use `PyPDF2` instead deprecated `pyPdf` to insert barcode into PDF.\n This solves `ValueError: invalid literal for int() with base 10: ''`.\n [gbastien]\n\n0.9 (2017-11-27)\n----------------\n\n- Added appy.pod usecase for complex styles start/end on same paragraph.\n [gbastien]\n- Do not break in `xhtml.storeImagesLocally` when no ` src` found.\n [gbastien]\n- Add methods to manage annotations (Add and Remove).\n [anuyens, odelaere]\n- Added method to get annotation\n [sgeulette]\n\n0.8 (2017-10-04)\n----------------\n\n- In `xhtml.storeImagesLocally`, take into account ` src`\n that uses `resolveuid`. This is the case when using `collective.ckeditor` and\n option `allow_link_byuid` is enabled.\n [gbastien]\n- Do not use `/* ... */` together with `https://` in helpers.js comment or\n merged javascripts produce a wrong format and raise a JS comment unterminated\n error in the browser.\n [gbastien]\n\n0.7 (2017-09-22)\n----------------\n\n- Added method `testing_logger` to `testing.py` that enables logging into tests.\n [gbastien]\n\n0.6 (2017-09-15)\n----------------\n\n- Changed method `xhtml.storeExternalImagesLocally` to\n `xhtml.storeImagesLocally`, it handles now external and internal images\n retrieval so an image stored in the portal is also created in given context\n when necessary.\n [gbastien]\n\n0.5 (2017-08-30)\n----------------\n\n- Added method to safe encode string.\n [sgeulette]\n- appy.pod usecase : table using width of 0px.\n [gbastien]\n- In `content.validate_fields`, added special bypass to avoid failing\n validation for `Choice` field that is `required=False` and for which given\n value is None. Validation fails because None not in vocabulary but it is\n nevertheless a correct value as it is managed by the widget while added thru\n the UI.\n [gbastien]\n- Added JS fix to be able to print `