Last change
on this file since 726 was
726,
checked in by y_z, 16 years ago
|
started adding simple configuration-loading module and getconfig frontend; checkpoint for moving dev to home machine which actually has yaml, etc.
|
File size:
420 bytes
|
Rev | Line | |
---|
[726] | 1 | #!/usr/bin/env python |
---|
| 2 | |
---|
| 3 | from invirt.config import load |
---|
| 4 | from sys import argv, stderr |
---|
| 5 | |
---|
| 6 | def main( argv ): |
---|
| 7 | try: command, key = argv |
---|
| 8 | except: print >> stderr, 'invirt-getconf KEY' |
---|
| 9 | conf = load() |
---|
| 10 | for component in key.split('.')[:-1]: |
---|
| 11 | if component.isdigit(): component = int( component ) |
---|
| 12 | conf = conf[ component ] |
---|
| 13 | print conf[key] |
---|
| 14 | |
---|
| 15 | if __name__ == '__main__': |
---|
| 16 | main( argv ) |
---|
| 17 | |
---|
| 18 | # vim:et:sw=4:ts=4 |
---|
Note: See
TracBrowser
for help on using the repository browser.