File: README.py

package info (click to toggle)
j2cli 0.3.12b-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 368 kB
  • sloc: python: 516; makefile: 30; sh: 14; xml: 2
file content (26 lines) | stat: -rwxr-xr-x 585 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#! /usr/bin/env python

import json
import inspect
from exdoc import doc, getmembers

import j2cli
import j2cli.context
import j2cli.extras.filters


README = {
    'formats': {
        name: doc(f)
        for name, f in j2cli.context.FORMATS.items()
    },
    'extras': {
        'filters': {k: doc(v)
                    for k, v in getmembers(j2cli.extras.filters)
                    if inspect.isfunction(v) and inspect.getmodule(v) is j2cli.extras.filters}
    }
}

assert 'yaml' in README['formats'], 'Looks like the YAML library is not installed!'

print(json.dumps(README))