summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/pygmentex/demo.py
blob: a5fa60eed43ce5b94d9d1437c08768aafa629314 (plain)
1
2
3
4
5
6
7
8
9
10
# -*- coding: utf-8 -*-

def parse_opts(dic, opts):
    for opt in re.split(r'\s*,\s*', opts):
        x = re.split(r'\s*=\s*', opt)
        if len(x) == 2 and x[0] and x[1]:
            dic[x[0]] = x[1]
        elif len(x) == 1 and x[0]:
            dic[x[0]] = True
    return dic