<commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-



import jinja2
import flask

import views


class Krempelair(flask.Flask):
    jinja_options = {
        'extensions': ['jinja2.ext.autoescape'],
        'undefined': jinja2.StrictUndefined
    }

    def __init__(self):
        """(See `make_app` for parameter descriptions.)"""
        flask.Flask.__init__(self, __name__)

        self.setup_routes()

    def create_jinja_environment(self):
        """Called by Flask.__init__"""
        env = super(Krempelair, self).create_jinja_environment()
        for func in [
            'force_unicode',
            'timesince',
            'shorten_sha1',
            'shorten_message',
            'extract_author_name',
            'formattimestamp',
        ]:
            env.filters[func] = getattr(utils, func)


        return env

    def setup_routes(self):
        for endpoint, rule in [
            #Allgemeine Funktionen
            #('air_login',   '/login/<user>/<key>'),
            
            # Getter der Temperaturen und des Betriebsstatus
            ('air_get_status_betrieb',   '/'),
            ('air_get_status_stoerung',   '/stoerung'),
            ('air_get_temperaturen', '/lueftung/temperatur'),
            
            # Setters für Funktionen
            ('air_set_level', '/lueftung/stufe/<int:level>'),
            ('air_set_timer', '/lueftung/timer/<int:time>'),
            ('air_set_tempSoll', '/lueftung/temperatur/sollTemp/<float:temp>'),
            ('air_set_tempNAK', '/lueftung/temperatur/sollTempNAK/<float:temp>'),
            ('air_set_NAK', '/lueftung/NAK/<int:NAK>'),
        ]:
            self.add_url_rule(rule, view_func=getattr(views, endpoint))


if __name__ == "__main__":
    app = Krempelair()
    app.run(host="0.0.0.0", debug=True)
else:
    application = Krempelair()
<commit_msg>Update __init__.py<commit_after>#!/usr/bin/env python3
# -*- coding: utf-8 -*-



import jinja2
import flask

import views


class Krempelair(flask.Flask):
    jinja_options = {
        'extensions': ['jinja2.ext.autoescape'],
        'undefined': jinja2.StrictUndefined
    }

    def __init__(self):
        """(See `make_app` for parameter descriptions.)"""
        flask.Flask.__init__(self, __name__)

        self.setup_routes()

    def create_jinja_environment(self):
        """Called by Flask.__init__"""
        env = super(Krempelair, self).create_jinja_environment()
        for func in [
            'force_unicode',
            'timesince',
            'shorten_sha1',
            'shorten_message',
            'extract_author_name',
            'formattimestamp',
        ]:
            env.filters[func] = getattr(utils, func)


        return env

    def setup_routes(self):
        for endpoint, rule in [
            #Allgemeine Funktionen
            #('air_login',   '/login/<user>/<key>'),
            
            # Getter der Temperaturen und des Betriebsstatus
            ('air_get_status_betrieb',   '/'),
            ('air_get_status_stoerung',   '/stoerung'),
            ('air_get_temperaturen', '/lueftung/temperatur'),
            
            # Setters für Funktionen
            ('air_set_level', '/lueftung/stufe/<int:level>'),
            ('air_set_timer', '/lueftung/timer/<int:time>'),
            ('air_set_tempSoll', '/lueftung/temperatur/sollTemp/<float:temp>'),
            ('air_set_tempNAK', '/lueftung/temperatur/sollTempNAK/<float:temp>'),
            ('air_set_tempSoll', '/lueftung/temperatur/sollTemp/<int:temp>'),
            ('air_set_tempNAK', '/lueftung/temperatur/sollTempNAK/<int:temp>'),
            ('air_set_NAK', '/lueftung/NAK/<int:NAK>'),
        ]:
            self.add_url_rule(rule, view_func=getattr(views, endpoint))


if __name__ == "__main__":
    app = Krempelair()
    app.run(host="0.0.0.0", debug=True)
else:
    application = Krempelair()

{'fraction_non_alphanumeric': 0.143522110162917, 'fraction_numerical': 0.00517196793379881, 'mean_word_length': 2.247691015952981, 'pattern_counts': {'":': 2, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6236803', 'n_tokens_mistral': 1317, 'n_tokens_neox': 1296, 'n_words': 197}