0
|
1 #!/usr/bin/env python
|
|
2
|
|
3 """
|
|
4 python PAckage INTrospection
|
|
5 """
|
|
6
|
|
7 import sys
|
|
8 import optparse
|
2
|
9 import tempfile
|
|
10
|
|
11 class InspectPackages(object):
|
|
12 def __init__(self):
|
|
13 pass
|
|
14
|
3
|
15 def dependencies(self, *packages):
|
|
16 if len(packages) > 1:
|
|
17 retval = set()
|
|
18 for package in packages:
|
|
19 retval += self.dependencies(package)
|
|
20 else:
|
|
21 raise NotImplementedError
|
|
22
|
2
|
23 def cleanup(self):
|
|
24 pass
|
|
25 __del__ = cleanup
|
0
|
26
|
|
27 def main(args=sys.argv[:]):
|
|
28
|
1
|
29 # parse command line options
|
|
30 usage = '%prog [options]'
|
0
|
31
|
1
|
32 # description formatter
|
|
33 class PlainDescriptionFormatter(optparse.IndentedHelpFormatter):
|
|
34 def format_description(self, description):
|
|
35 if description:
|
|
36 return description + '\n'
|
|
37 else:
|
|
38 return ''
|
|
39
|
|
40 parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter())
|
|
41 options, args = parser.parse_args(args)
|
0
|
42
|
|
43 if __name__ == '__main__':
|
1
|
44 main()
|