cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / tools / json_schema_compiler / highlighters / hilite_me_highlighter.py
blobaf0484723cd7fc0f5679b87f19031e1267f7a271
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
3 # found in the LICENSE file.
5 import urllib
6 import urllib2
8 class HiliteMeHighlighter(object):
9 """Highlighter that calls the http://hilite.me API to highlight code.
10 """
11 def GetCSS(self, style):
12 return ''
14 def GetCodeElement(self, code, style):
15 # Call hilite.me API to do syntax highlighting
16 return urllib2.urlopen('http://hilite.me/api',
17 urllib.urlencode([
18 ('code', code),
19 ('lexer', 'cpp'),
20 ('style', style),
21 ('linenos', 1)])
22 ).read()
24 def DisplayName(self):
25 return 'hilite.me (slow, requires internet)'
27 def GetStyles(self):
28 return ['monokai', 'manni', 'perldoc', 'borland', 'colorful', 'default',
29 'murphy', 'vs', 'trac', 'tango', 'fruity', 'autumn', 'bw', 'emacs',
30 'vim', 'pastie', 'friendly', 'native']