| 3235 | |
| 3236 | |
| 3237 | def show_all(argv=None): |
| 3238 | import inspect |
| 3239 | if argv is None: |
| 3240 | argv = sys.argv |
| 3241 | opts, args = parseCmdLine(argv) |
| 3242 | if opts.verbose: |
| 3243 | log.set_threshold(log.DEBUG) |
| 3244 | else: |
| 3245 | log.set_threshold(log.INFO) |
| 3246 | show_only = [] |
| 3247 | for n in args: |
| 3248 | if n[-5:] != '_info': |
| 3249 | n = n + '_info' |
| 3250 | show_only.append(n) |
| 3251 | show_all = not show_only |
| 3252 | _gdict_ = globals().copy() |
| 3253 | for name, c in _gdict_.items(): |
| 3254 | if not inspect.isclass(c): |
| 3255 | continue |
| 3256 | if not issubclass(c, system_info) or c is system_info: |
| 3257 | continue |
| 3258 | if not show_all: |
| 3259 | if name not in show_only: |
| 3260 | continue |
| 3261 | del show_only[show_only.index(name)] |
| 3262 | conf = c() |
| 3263 | conf.verbosity = 2 |
| 3264 | # we don't need the result, but we want |
| 3265 | # the side effect of printing diagnostics |
| 3266 | conf.get_info() |
| 3267 | if show_only: |
| 3268 | log.info('Info classes not defined: %s', ','.join(show_only)) |
| 3269 | |
| 3270 | if __name__ == "__main__": |
| 3271 | show_all() |