2c909f7d32128c29ff03da7713c3c7edfd91d785,debug_toolbar/panels/sql.py,,reformat_sql,#,127
Before Change
sql = sql.replace(" HAVING ", "\nHAVING\n\t")
sql = sql.replace(" GROUP BY ", "\nGROUP BY\n\t")
// Use Pygments to highlight SQL if it"s available
try:
from pygments import highlight
from pygments.lexers import SqlLexer
from pygments.formatters import HtmlFormatter
sql = highlight(sql, SqlLexer(), HtmlFormatter())
except ImportError:
pass
return sql
After Change
def reformat_sql(sql):
for kwd in SQL_KEYWORDS:
sql = sql.replace(kwd, "<strong>%s</strong>" % (kwd,))
return sql
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: jazzband/django-debug-toolbar
Commit Name: 2c909f7d32128c29ff03da7713c3c7edfd91d785
Time: 2009-08-28
Author: rob@cogit8.org
File Name: debug_toolbar/panels/sql.py
Class Name:
Method Name: reformat_sql
Project Name: lingpy/lingpy
Commit Name: b46114a5b8076c38e765811bd6d55ed2930d9975
Time: 2013-11-14
Author: mattis.list@posteo.de
File Name: lingpy/convert/html.py
Class Name:
Method Name: alm2html
Project Name: akkana/scripts
Commit Name: 037be121696158ecb3f2da13c8409b1ae311b0b4
Time: 2021-01-16
Author: akkana@shallowsky.com
File Name: musicplayer.py
Class Name: MusicWin
Method Name: update_content