lodgeit-main / lodgeit /

# -*- coding: utf-8 -*-

    Serveral utilities used by LodgeIt.

    :copyright: 2007-2008 by Christopher Grebs.
    :license: BSD
import time
from os import path

from werkzeug import Request as RequestBase, 

class Request(RequestBase):
    """Subclass of the `Request` object. automatically creates a new
    `user_hash` and sets `first_visit` to `True` if it's a new user.
    It also stores the engine and dbsession on it.
    charset = 'utf-8'

    def __init__(self, environ, urls):
        # language is limited to english until translations are ready
        lang = session.get('locale')
        if lang is None:
            lang = 'en'

    def set_language(self, lang):
        self.session['locale'] = lang