##// END OF EJS Templates
extensions: preparatory refactoring...
Thomas De Schampheleire -
r8420:2228102b default
parent child Browse files
Show More
@@ -521,22 +521,23 b' def repo2db_mapper(initial_repo_dict, re'
521 521
522 522
523 523 def load_extensions(root_path):
524 path = os.path.join(root_path, 'rcextensions', '__init__.py')
525 if os.path.isfile(path):
526 ext = create_module('rc', path)
524 try:
525 ext = create_module('rc', os.path.join(root_path, 'rcextensions', '__init__.py'))
526 except FileNotFoundError:
527 return
528
529 log.info('Loaded rcextensions from %s', ext)
527 530 kallithea.EXTENSIONS = ext
528 log.debug('Found rcextensions now loading %s...', ext)
529 531
530 532 # Additional mappings that are not present in the pygments lexers
531 533 kallithea.config.conf.LANGUAGES_EXTENSIONS_MAP.update(getattr(ext, 'EXTRA_MAPPINGS', {}))
532 534
533 # OVERRIDE OUR EXTENSIONS FROM RC-EXTENSIONS (if present)
534
535 # Override any INDEX_EXTENSIONS
535 536 if getattr(ext, 'INDEX_EXTENSIONS', []):
536 537 log.debug('settings custom INDEX_EXTENSIONS')
537 538 kallithea.config.conf.INDEX_EXTENSIONS = getattr(ext, 'INDEX_EXTENSIONS', [])
538 539
539 # ADDITIONAL MAPPINGS
540 # Additional INDEX_EXTENSIONS
540 541 log.debug('adding extra into INDEX_EXTENSIONS')
541 542 kallithea.config.conf.INDEX_EXTENSIONS.extend(getattr(ext, 'EXTRA_INDEX_EXTENSIONS', []))
542 543
General Comments 0
You need to be logged in to leave comments. Login now