Exemplo n.º 1
0
def generate_dimensions():
    dimensions = []
    for dimension in get_all_dimensions():
        pprint(dimension)
        if dimension.get('measure_type').startswith('W-'):
            continue
        attrs = ['name', 'label']
        if 'ZI' in dimension.get('measure_type'):
            attrs = ['text', 'from', 'until']
        dim = {
            'name': dimension.get('name'),
            'label': dimension.get('title_de'),
            'description': dimension.get('definition_de'),
            'attributes': attrs
        }
        dimensions.append(dim)
    return dimensions
Exemplo n.º 2
0
def freeze_html():
    print "Copying /static..."
    outdir = os.path.join(get_output_dir(), 'static')
    if os.path.isdir(outdir):
        shutil.rmtree(outdir)
    shutil.copytree(app.static_folder, outdir)
    freeze_request('/index.html')
    freeze_request('/faq.html')
    freeze_request('/api.html')
    freeze_request('/contact.html')
    for catalog in ['regional']:
        freeze_request('/%s/index.html' % catalog)
        for dimension in get_all_dimensions():
            freeze_request('/%s/dimensions/%s.html' % (catalog, dimension['name']))
        for statistic in get_all_statistics():
            slug = slugify(statistic['title_de'])
            freeze_request('/%s/statistics/%s.%s.html' % (catalog, slug, statistic['name']))
Exemplo n.º 3
0
def generate_dimensions():
    dimensions = []
    for dimension in get_all_dimensions():
        pprint (dimension)
        if dimension.get('measure_type').startswith('W-'):
            continue
        attrs = ['name', 'label']
        if 'ZI' in dimension.get('measure_type'):
            attrs = ['text', 'from', 'until']
        dim = {
            'name': dimension.get('name'),
            'label': dimension.get('title_de'),
            'description': dimension.get('definition_de'),
            'attributes': attrs
        }
        dimensions.append(dim)
    return dimensions