]> Pileus Git - ~andy/sunrise/blob - scripts/use_desc_gen
scripts/use_desc_gen: Add files for automatic use.local.desc generation
[~andy/sunrise] / scripts / use_desc_gen
1 #!/usr/bin/env python
2 # Written by Alec Warner <antarus@gentoo.org>
3 # This code is hereby placed in the public domain.
4
5 """A simple driver file for use_desc_gen."""
6
7 import logging
8 import optparse
9 import use_desc_gen
10
11
12 def GetOpts():
13   """Simple Option Parsing."""
14
15   parser = optparse.OptionParser()
16   parser.add_option('-r', '--repo_path', help=('path to repository from '
17                     'which the documentation will be generated.'))
18   parser.add_option('-c', '--category_file', help=('path to a category',
19                     'file if repo_path lacks a profile/category file'))
20
21   opts, unused_args = parser.parse_args()
22
23   if not opts.repo_path:
24     parser.error('--repo_path is a required option')
25
26   logging.debug('REPO_PATH is %s' % opts.repo_path)
27
28   return (opts, unused_args)
29
30
31 def Main():
32   """Main."""
33   opts, unused_args = GetOpts()
34   use_desc_gen.FindMetadataFiles(opts.repo_path, opts.category_file)
35
36
37 if __name__ == '__main__':
38   Main()