##// END OF EJS Templates
helpers: fixed some errors on helpers, and removed dead code.
marcink -
r254:339501a7 default
parent child Browse files
Show More
@@ -438,15 +438,17 b' def get_matching_line_offsets(lines, ter'
438 438 :param max_lines: cut off for lines of interest
439 439 eg.
440 440
441 >>> get_matching_line_offsets('''
441 text = '''
442 442 words words words
443 443 words words words
444 444 some text some
445 445 words words words
446 446 words words words
447 447 text here what
448 ''', 'text', context=1)
448 '''
449 get_matching_line_offsets(text, 'text', context=1)
449 450 {3: [(5, 9)], 6: [(0, 4)]]
451
450 452 """
451 453 matching_lines = {}
452 454 phrases = [normalize_text_for_matching(phrase)
@@ -460,6 +462,7 b' text here what'
460 462
461 463 return matching_lines
462 464
465
463 466 def get_lexer_safe(mimetype=None, filepath=None):
464 467 """
465 468 Tries to return a relevant pygments lexer using mimetype/filepath name,
@@ -470,7 +473,7 b' def get_lexer_safe(mimetype=None, filepa'
470 473 if mimetype:
471 474 lexer = get_lexer_for_mimetype(mimetype)
472 475 if not lexer:
473 lexer = get_lexer_for_filename(path)
476 lexer = get_lexer_for_filename(filepath)
474 477 except pygments.util.ClassNotFound:
475 478 pass
476 479
@@ -675,11 +678,6 b' def _shorten_commit_id(commit_id):'
675 678 return commit_id[:def_len]
676 679
677 680
678 def get_repo_id_from_name(repo_name):
679 repo = get_by_repo_name(repo_name)
680 return repo.repo_id
681
682
683 681 def show_id(commit):
684 682 """
685 683 Configurable function that shows ID
General Comments 0
You need to be logged in to leave comments. Login now