# -*- coding: utf8 -*- from pyramid.httpexceptions import HTTPFound, HTTPNotFound, HTTPForbidden from pyramid.httpexceptions import HTTPBadRequest, HTTPUnauthorized from pyramid.renderers import render_to_response from pyramid.view import notfound_view_config, forbidden_view_config from pyramid.view import view_config from pyramid.response import Response from mako.template import Template from pyramid_mailer.message import Message from .upload import IMAGEPATH, MediaPath # Import Web Forms from .forms import * # Database access imports from .models import * from .helpers import Orga_helpers from sqlalchemy import func, or_, text, and_ from sqlalchemy.orm import aliased from os import path, makedirs, listdir #  Usefull tools from slugify import slugify from icalendar import Calendar from pytz import timezone from icalendar import Event as Evt from pyramid_mailer.message import Message from .security import check_staff, check_logged # Then, standard libs import csv try: from StringIO import StringIO except ImportError: from io import StringIO import io import paginate import unicodedata import datetime import re import shutil import glob from jm2l.const import CurrentYear from passlib.hash import argon2 ## =-=- 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 = "