Michael Merickel
2018-10-15 bda1306749c62ef4f11cfe567ed7d56c8ad94240
commit | author | age
14be69 1 import plaster
d29151 2
0c29cf 3
49fb77 4 def parse_vars(args):
JA 5     """
6     Given variables like ``['a=b', 'c=d']`` turns it into ``{'a':
7     'b', 'c': 'd'}``
8     """
9     result = {}
10     for arg in args:
11         if '=' not in arg:
0c29cf 12             raise ValueError('Variable assignment %r invalid (no "=")' % arg)
49fb77 13         name, value = arg.split('=', 1)
JA 14         result[name] = value
15     return result
16
0c29cf 17
14be69 18 def get_config_loader(config_uri):
d29151 19     """
14be69 20     Find a ``plaster.ILoader`` object supporting the "wsgi" protocol.
d29151 21
CM 22     """
14be69 23     return plaster.get_loader(config_uri, protocols=['wsgi'])