Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1238)

Side by Side Diff: third_party/chrome/tools/json_schema_compiler/highlighters/pygments_highlighter.py

Issue 12300042: Update idlsync.py to pull in dependencies required for chrome api generation. (Closed) Base URL: git://github.com/dart-lang/bleeding_edge.git@master
Patch Set: From another checkout Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import sys 5 import sys
6 try: 6 try:
7 import pygments 7 import pygments
8 from pygments.lexers import CppLexer 8 from pygments.lexers import CppLexer
9 from pygments.formatters import HtmlFormatter 9 from pygments.formatters import HtmlFormatter
10 PYGMENTS_IMPORTED = True 10 PYGMENTS_IMPORTED = True
(...skipping 17 matching lines...) Expand all
28 def GetCodeElement(self, code, style): 28 def GetCodeElement(self, code, style):
29 formatter = HtmlFormatter(linenos=True, 29 formatter = HtmlFormatter(linenos=True,
30 style=pygments.styles.get_style_by_name(style)) 30 style=pygments.styles.get_style_by_name(style))
31 return pygments.highlight(code, CppLexer(), formatter) 31 return pygments.highlight(code, CppLexer(), formatter)
32 32
33 def DisplayName(self): 33 def DisplayName(self):
34 return 'pygments' + ('' if PYGMENTS_IMPORTED else ' (not installed)') 34 return 'pygments' + ('' if PYGMENTS_IMPORTED else ' (not installed)')
35 35
36 def GetStyles(self): 36 def GetStyles(self):
37 return list(pygments.styles.get_all_styles()) 37 return list(pygments.styles.get_all_styles())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698