[pkg] Set version to 3.22.2.dev0
So that cubes used in test dependencies do not install a released CubicWeb.
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr## This file is part of CubicWeb.## CubicWeb is free software: you can redistribute it and/or modify it under the# terms of the GNU Lesser General Public License as published by the Free# Software Foundation, either version 2.1 of the License, or (at your option)# any later version.## CubicWeb is distributed in the hope that it will be useful, but WITHOUT# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more# details.## You should have received a copy of the GNU Lesser General Public License along# with CubicWeb. If not, see <http://www.gnu.org/licenses/>."""Basic views for python values (eg without any result set)"""__docformat__="restructuredtext en"fromsiximporttext_typefromsix.movesimportrangefromcubicweb.viewimportViewfromcubicweb.predicatesimportmatch_kwargsfromcubicweb.web.viewsimporttableviewclassPyValTableColRenderer(tableview.AbstractColumnRenderer):"""Default column renderer for :class:`PyValTableView`."""defbind(self,view,colid):super(PyValTableColRenderer,self).bind(view,colid)self.header=view.headers[colid]ifview.headerselseNoneself.data=view.pyvaluedefrender_header(self,w):ifself.header:w(self._cw._(self.header))else:w(self.empty_cell_content)defrender_cell(self,w,rownum):w(text_type(self.data[rownum][self.colid]))classPyValTableView(tableview.TableMixIn,View):"""This table view is designed to be used a list of list of unicode values given as a mandatory `pyvalue` argument. Take care, content is NOT xml-escaped. It's configured through the following selection arguments. If `headers` is specified, it is expected to be a list of headers to be inserted as first row (in <thead>). `header_column_idx` may be used to specify a column index or a set of column indiced where values should be inserted inside <th> tag instead of <td>. `cssclass` is the CSS class used on the <table> tag, and default to 'listing' (so that the table will look similar to those generated by the table view). """__regid__='pyvaltable'__select__=match_kwargs('pyvalue')default_column_renderer_class=PyValTableColRendererpaginable=False# not supportedheaders=Nonecssclass=Nonedomid=Nonedef__init__(self,req,pyvalue,headers=None,cssclass=None,header_column_idx=None,**kwargs):super(PyValTableView,self).__init__(req,**kwargs)self.pyvalue=pyvalueifheadersisnotNone:self.headers=headerselifself.headers:# headers set on a class attribute, translateself.headers=[self._cw._(header)forheaderinself.headers]ifcssclassisnotNone:self.cssclass=cssclassself.header_column_idx=header_column_idx@propertydeflayout_args(self):args={}ifself.cssclass:args['cssclass']=self.cssclassifself.header_column_idxisnotNone:args['header_column_idx']=self.header_column_idxreturnargs# layout callbacks #########################################################@propertydeftable_size(self):"""return the number of rows (header excluded) to be displayed"""returnlen(self.pyvalue)@propertydefhas_headers(self):returnself.headersdefbuild_column_renderers(self):return[self.column_renderer(colid)forcolidinrange(len(self.pyvalue[0]))]deffacets_form(self,mainvar=None):returnNone# not supporteddeftable_actions(self):return[]# not supportedclassPyValListView(View):"""display a list of values into an html list. Take care, content is NOT xml-escaped. """__regid__='pyvallist'__select__=match_kwargs('pyvalue')defcall(self,pyvalue):self.w(u'<ul>\n')forlineinpyvalue:self.w(u'<li>%s</li>\n'%line)self.w(u'</ul>\n')