equal
deleted
inserted
replaced
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
18 """xbel views""" |
18 """xbel views""" |
19 |
19 |
20 __docformat__ = "restructuredtext en" |
20 __docformat__ = "restructuredtext en" |
21 _ = unicode |
21 _ = unicode |
|
22 |
|
23 from six.moves import range |
22 |
24 |
23 from logilab.mtconverter import xml_escape |
25 from logilab.mtconverter import xml_escape |
24 |
26 |
25 from cubicweb.predicates import is_instance |
27 from cubicweb.predicates import is_instance |
26 from cubicweb.view import EntityView |
28 from cubicweb.view import EntityView |
40 """display a list of entities by calling their <item_vid> view""" |
42 """display a list of entities by calling their <item_vid> view""" |
41 self.w(u'<?xml version="1.0" encoding="%s"?>\n' % self._cw.encoding) |
43 self.w(u'<?xml version="1.0" encoding="%s"?>\n' % self._cw.encoding) |
42 self.w(u'<!DOCTYPE xbel PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML" "http://www.python.org/topics/xml/dtds/xbel-1.0.dtd">') |
44 self.w(u'<!DOCTYPE xbel PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML" "http://www.python.org/topics/xml/dtds/xbel-1.0.dtd">') |
43 self.w(u'<xbel version="1.0">') |
45 self.w(u'<xbel version="1.0">') |
44 self.w(u'<title>%s</title>' % self._cw._('bookmarks')) |
46 self.w(u'<title>%s</title>' % self._cw._('bookmarks')) |
45 for i in xrange(self.cw_rset.rowcount): |
47 for i in range(self.cw_rset.rowcount): |
46 self.cell_call(i, 0) |
48 self.cell_call(i, 0) |
47 self.w(u"</xbel>") |
49 self.w(u"</xbel>") |
48 |
50 |
49 |
51 |
50 class XbelItemView(EntityView): |
52 class XbelItemView(EntityView): |