atramhasis.views.static   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 15
dl 0
loc 24
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A StaticView.__init__() 0 3 1
A StaticView.sitemaps() 0 8 1
1
import os
2
3
from pyramid.response import FileResponse
4
from pyramid.view import view_config
5
6
7
class StaticView:
8
    """
9
    Views voor aan de root gebonden static files.
10
    """
11
12
    def __init__(self, request):
13
        self.request = request
14
        self.here = os.path.dirname(__file__)
15
16
    @view_config(route_name='sitemap')
17
    def sitemaps(self):
18
        sitemaps = os.path.join(
19
            self.here, '..', 'static', '_sitemaps', 'sitemap_index.xml'
20
        )
21
        return FileResponse(
22
            sitemaps,
23
            request=self.request
24
        )
25