Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 18 lines (15 sloc) 0.597 kB
import sys
import cherrypy
from cherrypy.process.plugins import Daemonizer
Daemonizer(cherrypy.engine).subscribe()
from pygments import highlight
from pygments.lexers import get_lexer_by_name
from pygments.formatters import HtmlFormatter
class Root:
def pygments(self, lang, code):
lexer = get_lexer_by_name(lang)
formatter = HtmlFormatter()
return highlight(code, lexer, formatter)
pygments.exposed = True
config = {'global': {'server.socket_host': '0.0.0.0', 'server.socket_port': int(sys.argv[1])}}
cherrypy.quickstart(Root(), config=config)
Jump to Line
Something went wrong with that request. Please try again.