Changeset - d10caf435170
[Not reviewed]
default
0 1 0
Mads Kiilerich - 6 years ago 2019-11-23 21:42:11
mads@kiilerich.com
Grafted from: 6edefe941a0c
pygmentsutils: simplify get_index_filenames
1 file changed with 3 insertions and 8 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/pygmentsutils.py
Show inline comments
 
@@ -26,7 +26,6 @@ Original author and date, and relevant c
 
"""
 

	
 
from collections import defaultdict
 
from itertools import ifilter
 

	
 
from pygments import lexers
 

	
 
@@ -59,15 +58,11 @@ def get_index_filenames():
 
    """
 
    Get list of known indexable filenames from pygment lexer internals
 
    """
 

	
 
    filenames = []
 

	
 
    def likely_filename(s):
 
        return s.find('*') == -1 and s.find('[') == -1
 

	
 
    for lx, t in sorted(lexers.LEXERS.items()):
 
        for f in ifilter(likely_filename, t[-2]):
 
            filenames.append(f)
 
        for f in t[-2]:
 
            if '*' not in f and '[' not in f:
 
                filenames.append(f)
 

	
 
    return filenames
 

	
0 comments (0 inline, 0 general)