devtools/fill.py
changeset 7995 9a9f35ef418c
parent 7815 2a164a9cf81c
child 8238 087bb529035c
--- a/devtools/fill.py	Fri Oct 21 14:32:37 2011 +0200
+++ b/devtools/fill.py	Fri Oct 21 14:32:37 2011 +0200
@@ -20,12 +20,14 @@
 
 __docformat__ = "restructuredtext en"
 
+import logging
 from random import randint, choice
 from copy import deepcopy
 from datetime import datetime, date, time, timedelta
 from decimal import Decimal
 
 from logilab.common import attrdict
+from logilab.mtconverter import xml_escape
 from yams.constraints import (SizeConstraint, StaticVocabularyConstraint,
                               IntervalBoundConstraint, BoundaryConstraint,
                               Attribute, actual_value)
@@ -238,6 +240,14 @@
         # raise exception
         return u'text/plain'
 
+    def generate_CWDataImport_log(self, entity, index, **kwargs):
+        # content_format attribute of EmailPart has no vocabulary constraint, we
+        # need this method else stupid values will be set which make mtconverter
+        # raise exception
+        logs =  [u'%s\t%s\t%s\t%s<br/>' % (logging.ERROR, 'http://url.com?arg1=hop&arg2=hip',
+                                           1, xml_escape('hjoio&oio"'))]
+        return u'<br/>'.join(logs)
+
 
 class autoextend(type):
     def __new__(mcs, name, bases, classdict):