# -*- coding: utf8 -*- from pyramid.httpexceptions import HTTPFound, HTTPNotFound, HTTPForbidden from pyramid.httpexceptions import HTTPBadRequest, HTTPUnauthorized from pyramid.renderers import render_to_response from pyramid.response import Response from pyramid.view import notfound_view_config, forbidden_view_config from pyramid.view import view_config from pyramid_mailer import get_mailer from mako.template import Template # Import Web Forms from .forms import * # Database access imports from .models import * from sqlalchemy.exc import DBAPIError from sqlalchemy import func, or_ # Usefull tools from slugify import slugify from icalendar import Calendar from pytz import timezone from icalendar import Event as Evt from pyramid_mailer import get_mailer from pyramid_mailer.message import Attachment, Message # Then, standard libs import webhelpers.paginate as paginate import unicodedata import time import datetime import re CurrentYear = 2015 ## =-=- Here, We keep some usefull function -=-= def remove_accents(input_str): """ This function is intended to remove all accent from input unicode string """ nkfd_form = unicodedata.normalize('NFKD', input_str) only_ascii = nkfd_form.encode('ASCII', 'ignore') return only_ascii def embeed_video(mime_type, link): Container = "