From 70774f85ebfa567f0caf81c93afcb23ff834b7b7 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 14 Jul 2015 11:11:48 +0200 Subject: [PATCH] [IMP] inline paraiso dark to avoid pygments version headaches --- _extensions/odoo/pygments_override.py | 122 ++++++++++++++++++++++++-- 1 file changed, 114 insertions(+), 8 deletions(-) diff --git a/_extensions/odoo/pygments_override.py b/_extensions/odoo/pygments_override.py index 58458f417..d03fb4f0e 100644 --- a/_extensions/odoo/pygments_override.py +++ b/_extensions/odoo/pygments_override.py @@ -1,16 +1,122 @@ # -*- coding: utf-8 -*- from pygments.style import Style -from pygments.styles.paraiso_dark import ParaisoDarkStyle -from pygments.token import * +from pygments.token import Keyword, Name, Comment, String, Error, Text, \ + Number, Operator, Generic, Whitespace, Punctuation, Other, Literal + + +BACKGROUND = '#272727' +CURRENT_LINE = "#41323f" +SELECTION = "#4f424c" +FOREGROUND = "#e7e9db" +COMMENT = "#776e71" +RED = "#ef6155" +ORANGE = "#f99b15" +YELLOW = "#fec418" +GREEN = "#48b685" +AQUA = "#5bc4bf" +BLUE = "#06b6ef" +PURPLE = "#815ba4" -# extracted from getbootstrap.com class OdooStyle(Style): - background_color = '#272727' - highlight_color = ParaisoDarkStyle.highlight_color + """Modified version of Paraiso Dark style to avoid Pygments version + annoyances. - styles = dict(ParaisoDarkStyle.styles) - styles[Keyword] = '#cb49a8' - styles[Name.Tag] = '#21b799' + ParaĆ­so (Dark) by Jan T. Sott + + Pygments template by Jan T. Sott (https://github.com/idleberg) + Created with Base16 Builder by Chris Kempson + (https://github.com/chriskempson/base16-builder). + + :copyright: Copyright 2006-2014 by the Pygments team + :license: BSD + """ + + default_style = '' + + background_color = BACKGROUND + highlight_color = SELECTION + + styles = { + # No corresponding class for the following: + Text: FOREGROUND, + Whitespace: "", + Error: RED, + Other: "", + + Comment: COMMENT, + Comment.Multiline: "", + Comment.Preproc: "", + Comment.Single: "", + Comment.Special: "", + + Keyword: '#cb49a8', + Keyword.Constant: "", + Keyword.Declaration: "", + Keyword.Namespace: AQUA, + Keyword.Pseudo: "", + Keyword.Reserved: "", + Keyword.Type: YELLOW, + + Operator: AQUA, + Operator.Word: "", + + Punctuation: FOREGROUND, + + Name: FOREGROUND, + Name.Attribute: BLUE, + Name.Builtin: "", + Name.Builtin.Pseudo: "", + Name.Class: YELLOW, + Name.Constant: RED, + Name.Decorator: AQUA, + Name.Entity: "", + Name.Exception: RED, + Name.Function: BLUE, + Name.Property: "", + Name.Label: "", + Name.Namespace: YELLOW, + Name.Other: BLUE, + Name.Tag: '#21b799', + Name.Variable: RED, + Name.Variable.Class: "", + Name.Variable.Global: "", + Name.Variable.Instance: "", + + Number: ORANGE, + Number.Float: "", + Number.Hex: "", + Number.Integer: "", + Number.Integer.Long: "", + Number.Oct: "", + + Literal: ORANGE, + Literal.Date: GREEN, + + String: GREEN, + String.Backtick: "", + String.Char: FOREGROUND, + String.Doc: COMMENT, + String.Double: "", + String.Escape: ORANGE, + String.Heredoc: "", + String.Interpol: ORANGE, + String.Other: "", + String.Regex: "", + String.Single: "", + String.Symbol: "", + + Generic: "", + Generic.Deleted: RED, + Generic.Emph: "italic", + Generic.Error: "", + Generic.Heading: "bold " + FOREGROUND, + Generic.Inserted: GREEN, + Generic.Output: "", + Generic.Prompt: "bold " + COMMENT, + Generic.Strong: "bold", + Generic.Subheading: "bold " + AQUA, + Generic.Traceback: "", + } import imp import sys