diff options
| author | blackbird <devnull@localhost> | 2007-01-08 23:09:09 +0100 |
|---|---|---|
| committer | blackbird <devnull@localhost> | 2007-01-08 23:09:09 +0100 |
| commit | 48241d32886ca5f809cabe0ab7114fbc631ef374 (patch) | |
| tree | 08ff4456d504111ca53325ae263f8b4724a17e61 | |
| parent | 61de5a234ccae793e7e086fed4b8b25634370764 (diff) | |
| download | pygments-48241d32886ca5f809cabe0ab7114fbc631ef374.tar.gz | |
[svn] fixed vim2pygments and the fruity file generated with it
| -rw-r--r-- | pygments/styles/fruity.py | 35 | ||||
| -rw-r--r-- | scripts/vim2pygments.py | 15 |
2 files changed, 28 insertions, 22 deletions
diff --git a/pygments/styles/fruity.py b/pygments/styles/fruity.py index 8031ce97..fff1072b 100644 --- a/pygments/styles/fruity.py +++ b/pygments/styles/fruity.py @@ -9,23 +9,26 @@ :license: BSD, see LICENSE for more details. """ -from pykleur.style import Style -from pykleur.token import Comment, Name, Keyword, Generic, Number, Operator, String +from pygments.style import Style +from pygments.token import Token, Comment, Name, Keyword, Generic, Number, Operator, String class FruityStyle(Style): - default_style = 'ffffff bg:111111' + + background_color = '#111111' + styles = { - Generic.Output: '444444 bg:222222', - Keyword: 'fb660a bold', - Number: '0086f7 bold', - Name.Tag: 'fb660a bold', - Comment: '008800 bg:0f140f italic', - Name.Attribute: 'ff0086 bold', - String: '0086d2', - Name.Function: 'ff0086 bold', - Generic.Heading: 'ffffff bold', - Keyword.Type: 'cdcaa9 bold', - Generic.Subheading: 'ffffff bold', - Name.Constant: '0086d2', - Comment.Preproc: 'ff0007 bold' + Token: '#ffffff', + Generic.Output: '#444444 bg:#222222', + Keyword: '#fb660a bold', + Number: '#0086f7 bold', + Name.Tag: '#fb660a bold', + Comment: '#008800 bg:#0f140f italic', + Name.Attribute: '#ff0086 bold', + String: '#0086d2', + Name.Function: '#ff0086 bold', + Generic.Heading: '#ffffff bold', + Keyword.Type: '#cdcaa9 bold', + Generic.Subheading: '#ffffff bold', + Name.Constant: '#0086d2', + Comment.Preproc: '#ff0007 bold' } diff --git a/scripts/vim2pygments.py b/scripts/vim2pygments.py index 09391beb..aa114abe 100644 --- a/scripts/vim2pygments.py +++ b/scripts/vim2pygments.py @@ -775,11 +775,10 @@ for token in TOKENS.itervalues(): def get_vim_color(color): if color.startswith('#'): - color = color[1:] - if len(color) == 6: + if len(color) == 7: return color else: - return '0'.join(color)[:5] + '0' + return '#%s0' % '0'.join(color)[1:] return COLORS.get(color.lower()) @@ -873,8 +872,8 @@ class StyleWriter(object): out.write(' %s Colorscheme\n' % self.name.title()) out.write(' %s\n\n' % ('~' * (len(self.name) + 12))) out.write(' Converted by %s\n' % SCRIPT_NAME) - out.write('"""\nfrom pykleur.style import Style\n') - out.write('from pykleur.token import %s\n\n' % ', '.join(TOKEN_TYPES)) + out.write('"""\nfrom pygments.style import Style\n') + out.write('from pygments.token import Token, %s\n\n' % ', '.join(TOKEN_TYPES)) out.write('class %sStyle(Style):\n\n' % self.name.title()) def write(self, out): @@ -882,7 +881,11 @@ class StyleWriter(object): default_token, tokens = find_colors(self.code) tokens = tokens.items() tokens.sort(lambda a, b: cmp(len(a[0]), len(a[1]))) - out.write(' default_style = %r\n styles = {\n' % default_token) + bg_color = [x[3:] for x in default_token.split() if x.startswith('bg:')] + if bg_color: + out.write(' background_color = %r\n' % bg_color[0]) + out.write(' styles = {\n') + out.write(' %-20s%r\n' % ('Token:', default_token)) for token, definition in tokens: if definition: out.write(' %-20s%r\n' % (token + ':', definition)) |
