Klaus Demo ~jonashaag/klaus / f8db105
Raise ImportError if python-ctags is missing Jonas Haag 6 years ago
1 changed file(s) with 5 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
99
1010 try:
1111 import ctags
12 from klaus import ctagscache
1312 except ImportError:
1413 ctags = None
14 else:
15 from klaus import ctagscache
16 CTAGS_CACHE = ctagscache.CTagsCache()
1517
1618 from klaus import markup, tarutils
1719 from klaus.highlighting import pygmentize
1820 from klaus.utils import parent_directory, subpaths, force_unicode, guess_is_binary, \
1921 guess_is_image, replace_dupes
20
21
22 if ctags:
23 CTAGS_CACHE = ctagscache.CTagsCache()
2422
2523
2624 def repo_list():
189187 should_use_ctags = current_app.should_use_ctags(self.context['repo'],
190188 self.context['commit'])
191189 if should_use_ctags:
190 if ctags is None:
191 raise ImportError("Ctags enabled but python-ctags not installed")
192192 ctags_base_url = url_for(
193193 self.view_name,
194194 repo=self.context['repo'].name,