comparison scripts/build_sln_cache.py @ 0:5d2c0db51914

Initial commit
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 17 Sep 2019 13:24:24 -0700
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:5d2c0db51914
1 import os.path
2 import logging
3 import argparse
4 from vsutil import SolutionCache
5
6
7 def main():
8 parser = argparse.ArgumentParser()
9 parser.add_argument('solution',
10 help="The path to the solution file")
11 parser.add_argument('cache',
12 help="The path to the cache file")
13 parser.add_argument('-v', '--verbose',
14 action='store_true')
15 args = parser.parse_args()
16
17 loglevel = logging.INFO
18 if args.verbose:
19 loglevel = logging.DEBUG
20 logging.basicConfig(level=loglevel)
21 logger = logging.getLogger()
22
23 cache, loaded = SolutionCache.load_or_rebuild(args.solution, args.cache)
24 if not loaded:
25 total_items = sum([len(i) for i in cache.index.values()])
26 logger.debug(f"Built cache with {total_items} items.")
27
28
29 if __name__ == '__main__':
30 main()