13 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
13 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
14 # details. |
14 # details. |
15 # |
15 # |
16 # You should have received a copy of the GNU Lesser General Public License along |
16 # You should have received a copy of the GNU Lesser General Public License along |
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
18 """hooks triggered on email entities creation: |
18 """Some parsers to detect action to do from text |
19 |
19 |
20 * look for state change instruction (XXX security) |
20 Currently only a parser to look for state change instruction is provided. |
21 * set email content as a comment on an entity when comments are supported and |
21 Take care to security when you're using it, think about the user that |
22 linking information are found |
22 will provide the text to analyze... |
|
23 """ |
23 |
24 |
24 """ |
|
25 __docformat__ = "restructuredtext en" |
25 __docformat__ = "restructuredtext en" |
26 |
26 |
27 import re |
27 import re |
28 |
28 |
29 from cubicweb import UnknownEid, typed_eid |
29 from cubicweb import UnknownEid, typed_eid |
30 from cubicweb.view import Component |
30 from cubicweb.view import Component |
31 |
31 |
32 # XXX use user session if gpg signature validated |
|
33 |
32 |
34 class TextAnalyzer(Component): |
33 class TextAnalyzer(Component): |
35 """analyze and extract information from plain text by calling registered |
34 """analyze and extract information from plain text by calling registered |
36 text parsers |
35 text parsers |
37 """ |
36 """ |