Ejemplo n.º 1
0
 def prep(self, attr):
     if isinstance(attr['cols'], basestring):
         attr['cols'] = [attr['cols']]
     cols = attr['cols']
     # default value for top_title from row_title/columns
     if 'top_title' not in attr:
         top_title = [(self._top_titles[col], self._knowls[col]) for col in cols]
     else:
         top_title = attr['top_title']
     if not isinstance(top_title, basestring):
         missing_knowl = any(knowl is None for text, knowl in top_title)
         joiner = attr.get('title_joiner', ' ' if missing_knowl else ' and ')
         attr['top_title'] = joiner.join((display_knowl(knowl, title=title) if knowl else title)
                                         for title, knowl in top_title)
     attr['hash'] = hsh = hex(abs(hash(attr['top_title'])))[2:]
     data = self.display_data(**attr)
     attr['intro'] = attr.get('intro',[])
     data['attribute'] = attr
     if len(cols) == 1:
         attr['row_title'] = self._short_display[cols[0]]
         max_rows = attr.get('max_rows',6)
         counts = data['counts']
         rows = [counts[i:i+10] for i in range(0,len(counts),10)]
         if len(rows) > max_rows:
             short_rows = rows[:max_rows]
             data['divs'] = [(short_rows, "short_table_" + hsh, "short"),
                             (rows, "long_table_" + hsh + " nodisplay", "long")]
         else:
             data['divs'] = [(rows, "short_table", "none")]
     elif len(cols) == 2:
         attr['row_title'] = self._short_display[cols[0]]
         attr['col_title'] = self._short_display[cols[1]]
     return data
Ejemplo n.º 2
0
 def summary(self):
     return r"The database currently contains %s %s of %s 0 on $\Gamma_0(N)$ for $N$ in the range from 1 to %s." % (
         comma(self.nforms), display_knowl('mf.maass.mwf', 'Maass forms'),
         display_knowl('mf.maass.mwf.weight', 'weight'), self.max_level)