comparison MoinMoin/converter/docbook_out.py @ 1910:78b7a1136984

use constants in MoinMoin.constans.{item,content}types more
author Cheer Xiao <xiaqqaix@gmail.com>
date Thu, 17 Jan 2013 17:45:41 +0800
parents 4ac437141bbe
children bb2f526d961c
comparison
equal deleted inserted replaced
1901:77d7c15299c9 1910:78b7a1136984
15 15
16 from MoinMoin import log 16 from MoinMoin import log
17 logging = log.getLogger(__name__) 17 logging = log.getLogger(__name__)
18 18
19 from MoinMoin.util.tree import html, moin_page, xlink, docbook, xml 19 from MoinMoin.util.tree import html, moin_page, xlink, docbook, xml
20 from MoinMoin.constants.contenttypes import CONTENTTYPE_NONEXISTENT
20 21
21 22
22 class Converter(object): 23 class Converter(object):
23 """ 24 """
24 Converter application/x.moin.document -> application/docbook+xml 25 Converter application/x.moin.document -> application/docbook+xml
351 352
352 Similar for video and audio object. 353 Similar for video and audio object.
353 """ 354 """
354 href = element.get(xlink.href, None) 355 href = element.get(xlink.href, None)
355 attrib = {} 356 attrib = {}
356 mimetype = Type(_type=element.get(moin_page.type_, 'application/x-nonexistent')) 357 mimetype = Type(_type=element.get(moin_page.type_, CONTENTTYPE_NONEXISTENT))
357 if href: 358 if href:
358 attrib[docbook.fileref] = href 359 attrib[docbook.fileref] = href
359 if Type('image/').issupertype(mimetype): 360 if Type('image/').issupertype(mimetype):
360 object_data = self.new(docbook.imagedata, attrib=attrib, 361 object_data = self.new(docbook.imagedata, attrib=attrib,
361 children=[]) 362 children=[])