<commit_before># -*- coding: utf-8 -*-
import base64
import json
import logging
import urllib
import cStringIO

from PIL import Image, ImageOps

import openerp
from openerp.addons.web import http
from openerp.addons.web.controllers.main import manifest_list
from openerp.addons.web.http import request
import werkzeug
import werkzeug.exceptions
import werkzeug.wrappers

logger = logging.getLogger(__name__)

def template_values():
    debug = 'debug' in request.params
    script = "\n".join(['<script type="text/javascript" src="%s"></script>' % i for i in manifest_list('js', db=request.db, debug=debug)])
    css = "\n".join('<link rel="stylesheet" href="%s">' % i for i in manifest_list('css', db=request.db, debug=debug))
    try:
        request.session.check_security()
        loggued = True
        uid = request.session._uid
    except http.SessionExpiredException:
        loggued = False
        uid = openerp.SUPERUSER_ID

    values = {
        'loggued': loggued,
        'editable': loggued,
        'request': request,
        'registry': request.registry,
        'cr': request.cr,
        'uid': uid,
        'script': script,
        'css': css,
        'host_url': request.httprequest.host_url,
    }
    return values

class Website(openerp.addons.web.controllers.main.Home):
    @http.route('/', type='http', auth="admin")
    def index(self, **kw):
        return self.page("website.homepage")

    @http.route('/admin', type='http', auth="none")
    def admin(self, *args, **kw):
        return super(Website, self).index(*args, **kw)

    @http.route('/pagenew/<path:path>', type='http', auth="admin")<commit_msg>[MERGE] from upstream<commit_after># -*- coding: utf-8 -*-
import base64
import json
import logging
import urllib
import cStringIO

from PIL import Image, ImageOps

import openerp
from openerp.addons.web import http
from openerp.addons.web.controllers.main import manifest_list
from openerp.addons.web.http import request
import werkzeug
import werkzeug.exceptions
import werkzeug.wrappers

logger = logging.getLogger(__name__)

def template_values():
    script = "\n".join(['<script type="text/javascript" src="%s"></script>' % i for i in manifest_list('js', db=request.db)])
    css = "\n".join('<link rel="stylesheet" href="%s">' % i for i in manifest_list('css', db=request.db))
    try:
        request.session.check_security()
        loggued = True
        uid = request.session._uid
    except http.SessionExpiredException:
        loggued = False
        uid = openerp.SUPERUSER_ID

    values = {
        'loggued': loggued,
        'editable': loggued,
        'request': request,
        'registry': request.registry,
        'cr': request.cr,
        'uid': uid,
        'script': script,
        'css': css,
        'host_url': request.httprequest.host_url,
    }
    return values

class Website(openerp.addons.web.controllers.main.Home):
    @http.route('/', type='http', auth="admin")
    def index(self, **kw):
        return self.page("website.homepage")

    @http.route('/admin', type='http', auth="none")
    def admin(self, *args, **kw):
        return super(Website, self).index(*args, **kw)

    @http.route('/pagenew/<path:path>', type='http', auth="admin")
{'fraction_non_alphanumeric': 0.14764267990074442, 'fraction_numerical': 0.0018610421836228288, 'mean_word_length': 3.317269076305221, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2627937', 'n_tokens_mistral': 1037, 'n_tokens_neox': 1023, 'n_words': 245}