ThirdParty/Pygments/pygments/formatters/img.py

changeset 2426
da76c71624de
parent 1705
b0fbc9300f2b
child 2525
8b507a9a2d40
equal deleted inserted replaced
2425:ace8a08028f3 2426:da76c71624de
3 pygments.formatters.img 3 pygments.formatters.img
4 ~~~~~~~~~~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~~~~~~~~~~
5 5
6 Formatter for Pixmap output. 6 Formatter for Pixmap output.
7 7
8 :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS. 8 :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
9 :license: BSD, see LICENSE for details. 9 :license: BSD, see LICENSE for details.
10 """ 10 """
11 11
12 import sys 12 import sys
13 from subprocess import getstatusoutput
14 13
15 from pygments.formatter import Formatter 14 from pygments.formatter import Formatter
16 from pygments.util import get_bool_opt, get_int_opt, \ 15 from pygments.util import get_bool_opt, get_int_opt, \
17 get_list_opt, get_choice_opt 16 get_list_opt, get_choice_opt
18 17
71 if not font_name: 70 if not font_name:
72 self.font_name = DEFAULT_FONT_NAME_NIX 71 self.font_name = DEFAULT_FONT_NAME_NIX
73 self._create_nix() 72 self._create_nix()
74 73
75 def _get_nix_font_path(self, name, style): 74 def _get_nix_font_path(self, name, style):
75 from subprocess import getstatusoutput
76 exit, out = getstatusoutput('fc-list "%s:style=%s" file' % 76 exit, out = getstatusoutput('fc-list "%s:style=%s" file' %
77 (name, style)) 77 (name, style))
78 if not exit: 78 if not exit:
79 lines = out.splitlines() 79 lines = out.splitlines()
80 if lines: 80 if lines:

eric ide

mercurial