Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions html_image_url_extractor/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

==========================
Image URLs from HTML field
==========================

This module includes a method that extracts image URLs from any chunk of HTML,
in appearing order.

Usage
=====

This module just adds a technical utility, but nothing for the end user.

If you are a developer and need this utility for your module, see these
examples and read the docs inside the code.

Python example::

@api.multi
def some_method(self):
# Get images from an HTML field
imgs = self.env["ir.fields.converter"].imgs_from_html(self.html_field)
for url in imgs:
# Do stuff with those URLs
pass

QWeb example::

<!-- Extract first image from a blog post -->
<t t-foreach="env['ir.fields.converter']
.imgs_from_html(blog_post.content, 1)"
t-as="url">
<img t-att-href="url"/>
</t>

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/149/10.0

Known issues / Roadmap
======================

* The regexp to find the URL could be better.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/server-tools/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed feedback.

Credits
=======

Contributors
------------

* Jairo Llopis <yajo.sk8@gmail.com>
* Vicent Cubells <vicent.cubells@tecnativa.com>

Maintainer
----------

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

To contribute to this module, please visit https://odoo-community.org.
4 changes: 4 additions & 0 deletions html_image_url_extractor/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
24 changes: 24 additions & 0 deletions html_image_url_extractor/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
# Copyright 2016-2017 Jairo Llopis <jairo.llopis@tecnativa.com>
# Copyright 2016 Tecnativa - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Image URLs from HTML field",
"summary": "Extract images found in any HTML field",
"version": "10.0.1.0.0",
"category": "Tools",
"website": "https://www.tecnativa.com",
"author": "Tecnativa, "
"Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"external_dependencies": {
"python": [
"lxml.html",
],
},
"depends": [
"base",
],
}
44 changes: 44 additions & 0 deletions html_image_url_extractor/i18n/am.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * html_image_url_extractor
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-03 04:11+0000\n"
"PO-Revision-Date: 2016-12-03 04:11+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2016\n"
"Language-Team: Amharic (https://www.transifex.com/oca/teams/23907/am/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: am\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter_create_uid
msgid "Created by"
msgstr "Creado por"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter_create_date
msgid "Created on"
msgstr "Creado en"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter_write_uid
msgid "Last Updated by"
msgstr "Última actualización por"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter_write_date
msgid "Last Updated on"
msgstr "Última actualización en"

#. module: html_image_url_extractor
#: model:ir.model,name:html_image_url_extractor.model_ir_fields_converter
msgid "ir.fields.converter"
msgstr ""
44 changes: 44 additions & 0 deletions html_image_url_extractor/i18n/ar.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * html_image_url_extractor
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-03 04:11+0000\n"
"PO-Revision-Date: 2016-12-03 04:11+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2016\n"
"Language-Team: Arabic (https://www.transifex.com/oca/teams/23907/ar/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: ar\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter_create_uid
msgid "Created by"
msgstr "أنشئ بواسطة"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter_create_date
msgid "Created on"
msgstr "أنشئ في"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter_write_uid
msgid "Last Updated by"
msgstr "آخر تحديث بواسطة"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter_write_date
msgid "Last Updated on"
msgstr "آخر تحديث في"

#. module: html_image_url_extractor
#: model:ir.model,name:html_image_url_extractor.model_ir_fields_converter
msgid "ir.fields.converter"
msgstr ""
44 changes: 44 additions & 0 deletions html_image_url_extractor/i18n/bg.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * html_image_url_extractor
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-03 04:11+0000\n"
"PO-Revision-Date: 2016-12-03 04:11+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2016\n"
"Language-Team: Bulgarian (https://www.transifex.com/oca/teams/23907/bg/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: bg\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter_create_uid
msgid "Created by"
msgstr "Създадено от"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter_create_date
msgid "Created on"
msgstr "Създадено на"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter_write_uid
msgid "Last Updated by"
msgstr "Последно обновено от"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter_write_date
msgid "Last Updated on"
msgstr "Последно обновено на"

#. module: html_image_url_extractor
#: model:ir.model,name:html_image_url_extractor.model_ir_fields_converter
msgid "ir.fields.converter"
msgstr ""
44 changes: 44 additions & 0 deletions html_image_url_extractor/i18n/bs.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * html_image_url_extractor
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-03 04:11+0000\n"
"PO-Revision-Date: 2016-12-03 04:11+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2016\n"
"Language-Team: Bosnian (https://www.transifex.com/oca/teams/23907/bs/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: bs\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter_create_uid
msgid "Created by"
msgstr "Kreirao"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter_create_date
msgid "Created on"
msgstr "Kreirano"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter_write_uid
msgid "Last Updated by"
msgstr "Zadnji ažurirao"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter_write_date
msgid "Last Updated on"
msgstr "Zadnje ažurirano"

#. module: html_image_url_extractor
#: model:ir.model,name:html_image_url_extractor.model_ir_fields_converter
msgid "ir.fields.converter"
msgstr ""
45 changes: 45 additions & 0 deletions html_image_url_extractor/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * html_image_url_extractor
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2016
# Marc Tormo i Bochaca <mtbochaca@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-04-19 18:00+0000\n"
"PO-Revision-Date: 2017-04-19 18:00+0000\n"
"Last-Translator: Marc Tormo i Bochaca <mtbochaca@gmail.com>, 2017\n"
"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: ca\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter_create_uid
msgid "Created by"
msgstr "Creat per"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter_create_date
msgid "Created on"
msgstr "Creat el"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter_write_uid
msgid "Last Updated by"
msgstr "Darrera Actualització per"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter_write_date
msgid "Last Updated on"
msgstr "Darrera Actualització el"

#. module: html_image_url_extractor
#: model:ir.model,name:html_image_url_extractor.model_ir_fields_converter
msgid "ir.fields.converter"
msgstr "ir.fields.converter"
44 changes: 44 additions & 0 deletions html_image_url_extractor/i18n/cs.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * html_image_url_extractor
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-03 04:11+0000\n"
"PO-Revision-Date: 2016-12-03 04:11+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2016\n"
"Language-Team: Czech (https://www.transifex.com/oca/teams/23907/cs/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: cs\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter_create_uid
msgid "Created by"
msgstr "Vytvořil(a)"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter_create_date
msgid "Created on"
msgstr "Vytvořeno"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter_write_uid
msgid "Last Updated by"
msgstr "Naposled upraveno"

#. module: html_image_url_extractor
#: model:ir.model.fields,field_description:html_image_url_extractor.field_ir_fields_converter_write_date
msgid "Last Updated on"
msgstr "Naposled upraveno"

#. module: html_image_url_extractor
#: model:ir.model,name:html_image_url_extractor.model_ir_fields_converter
msgid "ir.fields.converter"
msgstr ""
Loading