<commit_before>from wsgiref.simple_server import make_server

import string
import os.path
import sys
import os
import re
from pprint import pformat
from beaker.middleware import SessionMiddleware
#from cgi import parse_qs, escape
import cgi

import traceback, StringIO
sys.path.append( os.path.abspath(os.path.join( os.path.dirname(os.path.abspath(__file__)), "./lib" )))
import urllib

import powlib
import pow_web_lib

# one of: 
#    NORMAL  = print almost nothing
#    INFO    = more Info printed (But especially NOT the whole WSGI environment)
#    DEBUG   = All Info printed, including WSGI environment. (LONG)
MODE_NORMAL = 1
MODE_INFO = 2
MODE_DEBUG = 3

MODE = MODE_NORMAL

def powapp_simple_server(environ, start_response):
    
    #print show_environ_cli(environ)
    output = []
    powdict =  {}    
    real_action = None
    
    #
    # relevant parameters have to be defined here
    # (Same as for apache the declarations in the httpd.conf file
    #
    
    # redirect static media from the meta link static to the real source dir
    # advantage is: you can alway refer safely to /static/<something> inside your css o .tmpl
    # files and the real source can be anywhere. sometimes the real static source differs from
    # prod-webserver A to prod-webserver B. with this litte tirck you can leave your links unchanged.
    # for apache the redirection is done in http.conf
    alias_dict ={    
        "/static/css/"             :    "./public/css/",
        "/static/stylesheets/"     :    "./public/css/",
        "/static/scripts/"         :     "./public/js/",
        "/static/js/"               :     "./public/js/",
        "/static/documents/"     :     "./public/doc/",
        "/static/doc/"           :     "./public/doc/",
        "/static/ico/"           :     "./public/ico/",
        "/static/img/"           :     "./public/img/"<commit_msg>small<commit_after>from wsgiref.simple_server import make_server

import string
import os.path
import sys
import os
import re
from pprint import pformat
from beaker.middleware import SessionMiddleware
#from cgi import parse_qs, escape
import cgi

import traceback, StringIO
sys.path.append( os.path.abspath(os.path.join( os.path.dirname(os.path.abspath(__file__)), "./lib" )))
import urllib

import powlib
import pow_web_lib
from webob import Request, Response

# one of: 
#    NORMAL  = print almost nothing
#    INFO    = more Info printed (But especially NOT the whole WSGI environment)
#    DEBUG   = All Info printed, including WSGI environment. (LONG)
MODE_NORMAL = 1
MODE_INFO = 2
MODE_DEBUG = 3

MODE = MODE_NORMAL

def powapp_simple_server(environ, start_response):
    
    #print show_environ_cli(environ)
    output = []
    powdict =  {}    
    real_action = None
    
    req = Request(environ)
    print(req.params)
    #
    # relevant parameters have to be defined here
    # (Same as for apache the declarations in the httpd.conf file
    #
    # redirect static media from the meta link static to the real source dir
    # advantage is: you can alway refer safely to /static/<something> inside your css o .tmpl
    # files and the real source can be anywhere. sometimes the real static source differs from
    # prod-webserver A to prod-webserver B. with this litte tirck you can leave your links unchanged.
    # for apache the redirection is done in http.conf
    alias_dict ={    
        "/static/css/"             :    "./public/css/",
        "/static/stylesheets/"     :    "./public/css/",
        "/static/scripts/"         :     "./public/js/",
        "/static/js/"               :     "./public/js/",
        "/static/documents/"     :     "./public/doc/",
        "/static/doc/"           :     "./public/doc/",
        "/static/ico/"           :     "./public/ico/",
        "/static/img/"           :     "./public/img/"
{'fraction_non_alphanumeric': 0.10291818655549766, 'fraction_numerical': 0.001563314226159458, 'mean_word_length': 2.3440766550522647, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '1407829', 'n_tokens_mistral': 1137, 'n_tokens_neox': 1141, 'n_words': 373}