---
+++
@@ -220,7 +220,7 @@
if table_size == 0:
errors += ['empty table']
elif table_size < MIN_TABLE_SIZE:
- errors += ['has only %s entries' % table_size]
+ errors += ['has only %s rows' % table_size]
foreign = self.inspector.get_foreign_keys(table)
primary = self.inspector.get_pk_constraint(table)
---
+++
@@ -14,6 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+from cgi import escape
from datetime import datetime
import os
import re
@@ -175,16 +176,18 @@
CSS = ['highlight.css']
LEXERS = {
'plpgsql': PlPgsqlLexer(),
+ 'sql': SqlLexer(),
}
def _get_lexer(self, language):
- if language not in self.LEXERS:
- raise NotImplemented('Unknown function language "%s"' % language)
- return self.LEXERS[language]
+ return self.LEXERS.get(language)
def _render(self, function, language, code):
lexer = self._get_lexer(language)
- highlighted = highlight(code, lexer, FORMATTER)
+ if lexer is not None:
+ highlighted = highlight(code, lexer, FORMATTER)
+ else:
+ highlighted = '<pre>%s</pre>' % escape(code)
self.write('<h1>Function %s</h1>' % function)
self.write('%s language' % language)
self.write(highlighted)
Generated with KisssPM