no-cups
|
Last change
on this file since 609a9b0 was
609a9b0,
checked in by Jessica B. Hamrick <jhamrick@…>, 15 years ago
|
|
Add basic configuration file support
|
-
Property mode set to
100644
|
|
File size:
398 bytes
|
| Line | |
|---|
| 1 | import gutenbach.server |
|---|
| 2 | import sys |
|---|
| 3 | import os |
|---|
| 4 | import yaml |
|---|
| 5 | |
|---|
| 6 | if len(sys.argv) != 2: |
|---|
| 7 | print "Invalid number of arguments: %d" % len(sys.argv) |
|---|
| 8 | sys.exit(1) |
|---|
| 9 | |
|---|
| 10 | config = sys.argv[1] |
|---|
| 11 | if not os.path.exists(config): |
|---|
| 12 | print "Invalid config: %s" % config |
|---|
| 13 | sys.exit(1) |
|---|
| 14 | |
|---|
| 15 | conf_dict = yaml.load(open(config, "r")) |
|---|
| 16 | print "Loaded configuration file:" |
|---|
| 17 | print conf_dict |
|---|
| 18 | |
|---|
| 19 | gutenbach.server.start(conf_dict) |
|---|
Note: See
TracBrowser
for help on using the repository browser.