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