Ignore:
Timestamp:
Jan 12, 2012, 1:28:05 AM (12 years ago)
Author:
Jessica B. Hamrick <jhamrick@…>
Branches:
no-cups
Children:
ef387cf
Parents:
2620618
git-author:
Jessica B. Hamrick <jhamrick@…> (01/12/12 01:28:05)
git-committer:
Jessica B. Hamrick <jhamrick@…> (01/12/12 01:28:05)
Message:

Add basic configuration file support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/lib/gutenbach-server.py

    re58af05 r609a9b0  
    11import gutenbach.server
    2 gutenbach.server.start()
     2import sys
     3import os
     4import yaml
     5
     6if len(sys.argv) != 2:
     7    print "Invalid number of arguments: %d" % len(sys.argv)
     8    sys.exit(1)
     9
     10config = sys.argv[1]
     11if not os.path.exists(config):
     12    print "Invalid config: %s" % config
     13    sys.exit(1)
     14
     15conf_dict = yaml.load(open(config, "r"))
     16print "Loaded configuration file:"
     17print conf_dict
     18   
     19gutenbach.server.start(conf_dict)
Note: See TracChangeset for help on using the changeset viewer.