Mercurial > hg > WSGraph
comparison wsgraph/main.py @ 0:cfcfa093e4b4
initial commit
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Sun, 09 Dec 2012 10:21:43 -0800 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:cfcfa093e4b4 |
---|---|
1 #!/usr/bin/env python | |
2 | |
3 """ | |
4 WSGI graph server | |
5 """ | |
6 | |
7 import sys | |
8 import optparse | |
9 | |
10 def main(args=sys.argv[:]): | |
11 | |
12 # parse command line options | |
13 usage = '%prog [options]' | |
14 class PlainDescriptionFormatter(optparse.IndentedHelpFormatter): | |
15 """description formatter for console script entry point""" | |
16 def format_description(self, description): | |
17 if description: | |
18 return description.strip() + '\n' | |
19 else: | |
20 return '' | |
21 parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter()) | |
22 options, args = parser.parse_args(args) | |
23 | |
24 if __name__ == '__main__': | |
25 main() | |
26 |