3 # Author: A. S. Budden <abudden _at_ gmail _dot_ com>
4 # Copyright: Copyright (C) 2009-2011 A. S. Budden
5 # Permission is hereby granted to use and distribute this code,
6 # with or without modifications, provided that this copyright
7 # notice is copied with it. Like anything else that's free,
8 # the TagHighlight plugin is provided *as is* and comes with no
9 # warranty of any kind, either expressed or implied. By using
10 # this plugin, you agree that in no event will the copyright
11 # holder be liable for any damages resulting from the use
14 # ---------------------------------------------------------------------
15 from __future__ import print_function
19 def RunWithOptions(options):
20 start_directory = os.getcwd()
21 from .config import config, SetInitialOptions, LoadLanguages
22 from .debug import Debug
24 SetInitialOptions(options)
26 Debug("Running types highlighter generator", "Information")
27 Debug("Release:" + config['release'], "Information")
28 Debug("Version:" + repr(config['version']), "Information")
29 Debug("Options:" + repr(options), "Information")
31 tag_file_absolute = os.path.join(config['ctags_file_dir'], config['ctags_file'])
32 if config['use_existing_tagfile'] and not os.path.exists(tag_file_absolute):
33 Debug("Cannot use existing tagfile as it doesn't exist (checking for " + tag_file_absolute + ")", "Error")
38 if config['print_config']:
43 if config['print_py_version']:
47 from .ctags_interface import GenerateTags, ParseTags
48 from .generation import CreateTypesFile
50 if not config['use_existing_tagfile']:
51 Debug("Generating tag file", "Information")
53 tag_db = ParseTags(config)
55 for language in config['language_list']:
56 if language in tag_db:
57 CreateTypesFile(config, language, tag_db[language])
59 os.chdir(start_directory)