equal
deleted
inserted
replaced
425 if value is None and metadata == 'encoding': |
425 if value is None and metadata == 'encoding': |
426 value = self.vreg.property_value('ui.encoding') |
426 value = self.vreg.property_value('ui.encoding') |
427 return value |
427 return value |
428 |
428 |
429 def printable_value(self, attr, value=_marker, attrtype=None, |
429 def printable_value(self, attr, value=_marker, attrtype=None, |
430 format='text/html'): |
430 format='text/html', displaytime=True): |
431 """return a displayable value (i.e. unicode string) which may contains |
431 """return a displayable value (i.e. unicode string) which may contains |
432 html tags |
432 html tags |
433 """ |
433 """ |
434 attr = str(attr) |
434 attr = str(attr) |
435 if value is _marker: |
435 if value is _marker: |
455 if attrformat: |
455 if attrformat: |
456 encoding = self.attr_metadata(attr, 'encoding') |
456 encoding = self.attr_metadata(attr, 'encoding') |
457 return self.mtc_transform(value.getvalue(), attrformat, format, |
457 return self.mtc_transform(value.getvalue(), attrformat, format, |
458 encoding) |
458 encoding) |
459 return u'' |
459 return u'' |
460 value = printable_value(self.req, attrtype, value, props) |
460 value = printable_value(self.req, attrtype, value, props, |
|
461 displaytime=displaytime) |
461 if format == 'text/html': |
462 if format == 'text/html': |
462 value = xml_escape(value) |
463 value = xml_escape(value) |
463 return value |
464 return value |
464 |
465 |
465 def mtc_transform(self, data, format, target_format, encoding, |
466 def mtc_transform(self, data, format, target_format, encoding, |