diff --git a/.env b/.env new file mode 100644 index 0000000000000000000000000000000000000000..3a7954c34056b62790decc06108fe8d046aec906 --- /dev/null +++ b/.env @@ -0,0 +1,14 @@ +# In your .env file (keep this private) +CONTACT_EMAIL=egliszaratus@gmail.com +ADMIN_EMAIL=egliszaratus@gmail.com + +# In app.py +app.config['CONTACT_EMAIL'] = os.environ.get('CONTACT_EMAIL', 'info@munishischool.ac.tz') +app.config['ADMIN_EMAIL'] = os.environ.get('ADMIN_EMAIL', 'admin@munishischool.ac.tz') + + +app.config['ADMIN_USERNAME'] = os.environ.get('ADMIN_USERNAME', 'admin') # Default: 'admin' +app.config['ADMIN_PASSWORD'] = os.environ.get('ADMIN_PASSWORD', generate_password_hash('admin123')) # Default: hashed 'admin123' + +MAIL_USERNAME=egliszaratus@gmail.com +MAIL_PASSWORD=xwzd nogw tavi qgtg \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index a6344aac8c09253b3b630fb776ae94478aa0275b..34c72725697d29c308f3cb0254b0a2896b526b4f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -33,3 +33,156 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text *.zst filter=lfs diff=lfs merge=lfs -text *tfevents* filter=lfs diff=lfs merge=lfs -text +static/uploads/applications/348f9a45-0184-40ed-8fc4-444829eea40d_photo.png filter=lfs diff=lfs merge=lfs -text +static/uploads/applications/7d8de7f4-a5c9-47c3-81e0-9e95eed94557_photo.png filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/global.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/af.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ak.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/am.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ar.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/as.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ast.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/az.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/bal_Latn.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/be_TARASK.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/be.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/bew.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/bg.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/blo.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/bn.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/br.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/brx.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/bs_Cyrl.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/bs.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ca.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ccp.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ce.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ceb.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/chr.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/cs.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/cv.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/cy.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/da.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/de.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/dsb.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/el.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/en.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/eo.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/es.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/et.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/eu.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/fa.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ff_Adlm.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/fi.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/fil.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/fo.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/fr.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/frr.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/fy.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ga.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/gd.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/gl.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/gu.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ha.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/he.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/hi.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/hr.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/hsb.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/hu.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/hy.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ia.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/id.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/is.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/it.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ja.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/jv.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ka.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/kab.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/kgp.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/kk_Arab.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/kk.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/km.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/kn.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ko.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/kok.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ks.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ku.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ky.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/lb.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/lij.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/lo.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/lt.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/lv.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/mk.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ml.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/mn.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/mr.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ms.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/my.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ne.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/nl.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/no.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/nqo.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/or.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/pa.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/pcm.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/pl.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ps.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/pt.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ro.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ru.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/sc.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/sd.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/si.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/sk.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/sl.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/so.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/sq.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/sr_Latn.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/sr.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/sv.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/sw.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/syr.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ta.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/te.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/tg.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/th.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ti.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/tk.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/to.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/tr.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/trw.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/tt.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ug.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/uk.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/ur.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/uz.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/vec.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/vi.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/xnr.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/yo.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/yrl.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/yue_Hans.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/yue.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/zh_Hant.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/zh.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/babel/locale-data/zu.dat filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/click/__pycache__/core.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/jinja2/__pycache__/compiler.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/pip/_vendor/__pycache__/typing_extensions.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/pip/_vendor/distlib/t64-arm.exe filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/pip/_vendor/distlib/t64.exe filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/pip/_vendor/distlib/w64-arm.exe filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/pip/_vendor/distlib/w64.exe filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/pip/_vendor/idna/__pycache__/uts46data.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/pip/_vendor/pkg_resources/__pycache__/__init__.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/pip/_vendor/rich/__pycache__/_emoji_codes.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text +venv/Lib/site-packages/pip/_vendor/rich/__pycache__/console.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text +venv/Scripts/dotenv.exe filter=lfs diff=lfs merge=lfs -text +venv/Scripts/flask.exe filter=lfs diff=lfs merge=lfs -text +venv/Scripts/pip.exe filter=lfs diff=lfs merge=lfs -text +venv/Scripts/pip3.13.exe filter=lfs diff=lfs merge=lfs -text +venv/Scripts/pip3.exe filter=lfs diff=lfs merge=lfs -text +venv/Scripts/pybabel.exe filter=lfs diff=lfs merge=lfs -text +venv/Scripts/python.exe filter=lfs diff=lfs merge=lfs -text +venv/Scripts/pythonw.exe filter=lfs diff=lfs merge=lfs -text diff --git a/app.py b/app.py new file mode 100644 index 0000000000000000000000000000000000000000..e51568aee79bac25c7802089e146b6566b21a981 --- /dev/null +++ b/app.py @@ -0,0 +1,1048 @@ +from flask import Flask, render_template, request, session, redirect, url_for, send_from_directory, g, flash, jsonify +from flask_babel import Babel, gettext as _ +from flask_mail import Mail, Message +import os +import json +from datetime import datetime +from functools import wraps +import uuid +from werkzeug.utils import secure_filename +from werkzeug.security import generate_password_hash, check_password_hash + +app = Flask(__name__) +app.secret_key = os.environ.get('SECRET_KEY', 'dev_secret_key') + +# Application Configuration +app.config['BABEL_DEFAULT_LOCALE'] = 'en' +app.config['BABEL_TRANSLATION_DIRECTORIES'] = 'translations' +app.config['SCHOOL_NAME'] = "Munishi Secondary School" +app.config['SCHOOL_MOTTO'] = "Excellence Through Diligence" +app.config['CONTACT_EMAIL'] = "info@munishischool.ac.tz" +app.config['CONTACT_PHONE'] = "+255 22 123 4567" +app.config['ADDRESS'] = "P.O. Box 1234, Dar es Salaam, Tanzania" +app.config['SOCIAL_MEDIA'] = { + 'facebook': 'https://facebook.com/munishischool', + 'twitter': 'https://twitter.com/munishischool', + 'instagram': 'https://instagram.com/munishischool', + 'youtube': 'https://youtube.com/munishischool' +} +app.config['UPLOAD_FOLDER'] = 'static/uploads' +app.config['ALLOWED_EXTENSIONS'] = {'png', 'jpg', 'jpeg', 'gif', 'pdf'} +app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024 # 16MB max upload size + +# Admin Configuration +app.config['ADMIN_USERNAME'] = os.environ.get('ADMIN_USERNAME', 'admin') +app.config['ADMIN_PASSWORD'] = os.environ.get('ADMIN_PASSWORD', generate_password_hash('admin123')) +app.config['ADMIN_UPLOAD_FOLDER'] = 'static/uploads/admin' +app.config['APPLICATIONS_PER_PAGE'] = 10 +app.config['ADMIN_SESSION_TIMEOUT'] = 3600 # 1 hour in seconds + +# Email Configuration +app.config['MAIL_SERVER'] = 'smtp.gmail.com' +app.config['MAIL_PORT'] = 587 +app.config['MAIL_USE_TLS'] = True +app.config['MAIL_USERNAME'] = 'egliszaratus@gmail.com' +app.config['MAIL_PASSWORD'] = 'xwzd nogw tavi qgtg' # Your app password +app.config['MAIL_DEFAULT_SENDER'] = 'Munishi Secondary School ' +app.config['ADMIN_EMAIL'] = 'egliszaratus@gmail.com' + +# Initialize Babel and Mail +babel = Babel(app) +mail = Mail(app) + +# Admin Authentication Decorator +def admin_required(f): + @wraps(f) + def decorated_function(*args, **kwargs): + if not session.get('admin_logged_in'): + return redirect(url_for('admin_login', next=request.url)) + + # Check session timeout + last_activity = session.get('admin_last_activity') + if last_activity and (datetime.now() - datetime.strptime(last_activity, "%Y-%m-%d %H:%M:%S")).seconds > app.config['ADMIN_SESSION_TIMEOUT']: + session.pop('admin_logged_in', None) + flash(_('Your session has timed out. Please log in again.'), 'warning') + return redirect(url_for('admin_login', next=request.url)) + + # Update last activity time + session['admin_last_activity'] = datetime.now().strftime("%Y-%m-%d %H:%M:%S") + return f(*args, **kwargs) + return decorated_function + +# Helper Functions +def load_data(filename): + """Load JSON data from the data directory""" + try: + with open(f'data/{filename}.json', 'r', encoding='utf-8') as f: + data = json.load(f) + # Process the data based on type + if isinstance(data, list): + for item in data: + if isinstance(item, dict): + # Escape % signs in strings for translation + for key in ['title', 'description', 'excerpt']: + if key in item and isinstance(item[key], str): + item[key] = item[key].replace('%', '%%') + # Set default image if missing or file doesn't exist + if 'image' in item: + image_path = os.path.join('static', 'images', item['image']) + if not os.path.exists(image_path): + item['image'] = 'default.jpg' + return data + except FileNotFoundError: + app.logger.warning(f"Data file not found: {filename}.json") + return None + except json.JSONDecodeError: + app.logger.error(f"Invalid JSON in file: {filename}.json") + return None + except Exception as e: + app.logger.error(f"Error loading {filename}.json: {str(e)}") + return None + +def save_data(filename, data): + """Save data to JSON file""" + try: + with open(f'data/{filename}.json', 'w', encoding='utf-8') as f: + json.dump(data, f, indent=2, ensure_ascii=False) + return True + except Exception as e: + app.logger.error(f"Error saving data: {str(e)}") + return False + +def allowed_file(filename): + """Check if a file has an allowed extension""" + return '.' in filename and \ + filename.rsplit('.', 1)[1].lower() in app.config['ALLOWED_EXTENSIONS'] + +def format_date(value, format='medium', part=None): + """Jinja2 filter for date formatting""" + try: + if format == 'full': + format_str = "%A, %d %B %Y" + elif format == 'medium': + format_str = "%d %b %Y" + else: + format_str = format + + date_obj = datetime.strptime(value, "%Y-%m-%d") + formatted = date_obj.strftime(format_str) + + if part == 'first': + return formatted.split()[0] + elif part == 'second': + parts = formatted.split() + return parts[1] if len(parts) > 1 else '' + + return formatted + except Exception as e: + app.logger.error(f"Date formatting error: {str(e)}") + return value + +def format_currency(value): + """Jinja2 filter for currency formatting""" + return f"TZS {value:,.0f}" + +def send_email(subject, recipients, body, html=None): + """Send an email using Flask-Mail""" + try: + msg = Message( + subject=subject, + recipients=recipients, + body=body, + html=html + ) + mail.send(msg) + return True + except Exception as e: + app.logger.error(f"Error sending email: {str(e)}") + return False + +# Register filters +app.jinja_env.filters['format_date'] = format_date +app.jinja_env.filters['date'] = format_date +app.jinja_env.filters['format_currency'] = format_currency +app.jinja_env.filters['currency'] = format_currency + +# Make helpers and configuration available to all templates +@app.context_processor +def inject_config(): + """Inject configuration and helper functions into all templates""" + return { + 'school_name': app.config['SCHOOL_NAME'], + 'school_motto': app.config['SCHOOL_MOTTO'], + 'contact_email': app.config['CONTACT_EMAIL'], + 'contact_phone': app.config['CONTACT_PHONE'], + 'address': app.config['ADDRESS'], + 'social_media': app.config['SOCIAL_MEDIA'], + 'now': datetime.now(), + 'load_data': load_data + } + +# Language Handling +@app.before_request +def before_request(): + """Set language for the request""" + if 'lang' not in session: + session['lang'] = request.accept_languages.best_match(['en', 'sw']) + g.current_lang = session['lang'] + +@babel.localeselector +def get_locale(): + """Get the current locale""" + return session.get('lang', 'en') + +@app.route('/set_lang/') +def set_lang(lang): + """Change the application language""" + if lang in ['en', 'sw']: + session['lang'] = lang + return redirect(request.referrer or url_for('home')) + +# Admin Routes +@app.route('/admin/login', methods=['GET', 'POST']) +def admin_login(): + if session.get('admin_logged_in'): + return redirect(url_for('admin_dashboard')) + + if request.method == 'POST': + username = request.form.get('username') + password = request.form.get('password') + + if (username == app.config['ADMIN_USERNAME'] and + check_password_hash(app.config['ADMIN_PASSWORD'], password)): + session['admin_logged_in'] = True + session['admin_last_activity'] = datetime.now().strftime("%Y-%m-%d %H:%M:%S") + next_url = request.args.get('next') or url_for('admin_dashboard') + return redirect(next_url) + else: + flash(_('Invalid username or password'), 'error') + + return render_template('admin/login.html') + +@app.route('/admin/logout') +@admin_required +def admin_logout(): + session.pop('admin_logged_in', None) + session.pop('admin_last_activity', None) + flash(_('You have been logged out successfully'), 'success') + return redirect(url_for('admin_login')) + +@app.route('/admin/dashboard') +@admin_required +def admin_dashboard(): + applications = load_data('applications') or [] + stats = { + 'total': len(applications), + 'submitted': len([a for a in applications if a.get('status') == 'submitted']), + 'reviewed': len([a for a in applications if a.get('status') == 'reviewed']), + 'accepted': len([a for a in applications if a.get('status') == 'accepted']), + 'rejected': len([a for a in applications if a.get('status') == 'rejected']) + } + + recent_apps = sorted(applications, key=lambda x: x.get('submission_date', ''), reverse=True)[:5] + + return render_template('admin/dashboard.html', stats=stats, recent_apps=recent_apps) + + +@app.route('/admin/applications') +@admin_required +def admin_applications(): + page = request.args.get('page', 1, type=int) + status_filter = request.args.get('status', 'all') + search_query = request.args.get('search', '') + sort_by = request.args.get('sort', 'submission_date') + sort_order = request.args.get('order', 'desc') + + applications = load_data('applications') or [] + + # Apply filters + if status_filter != 'all': + applications = [a for a in applications if a['status'] == status_filter] + + if search_query: + search_query = search_query.lower() + applications = [a for a in applications if + search_query in a['first_name'].lower() or + search_query in a['last_name'].lower() or + search_query in a['parent_name'].lower() or + search_query in a['id'].lower()] + + # Sorting + reverse_order = sort_order == 'desc' + if sort_by in ['first_name', 'last_name', 'submission_date', 'status']: + applications.sort(key=lambda x: x.get(sort_by, ''), reverse=reverse_order) + + # Pagination + per_page = app.config['APPLICATIONS_PER_PAGE'] + total_pages = max(1, (len(applications) + per_page - 1) // per_page) + paginated_apps = applications[(page-1)*per_page : page*per_page] + + return render_template('admin/applications.html', + applications=paginated_apps, + current_page=page, + total_pages=total_pages, + status_filter=status_filter, + search_query=search_query, + sort_by=sort_by, + sort_order=sort_order) + + + + + +@app.route('/admin/application/', methods=['GET', 'POST']) +@admin_required +def admin_application_detail(application_id): + # Load all applications + all_applications = load_data('applications') or [] + + # Find the current application + current_app = None + app_index = -1 + for i, app_data in enumerate(all_applications): + if app_data['id'] == application_id: + current_app = app_data + app_index = i + break + + if not current_app: + flash(_('Application not found'), 'error') + return redirect(url_for('admin_applications')) + + if request.method == 'POST': + # Capture the current status before any changes + old_status = current_app.get('status') + + # Get form data + new_status = request.form.get('status') + notes = request.form.get('admin_notes', '') + + if new_status in ['submitted', 'reviewed', 'accepted', 'rejected', 'waitlisted']: + # Update application data + current_app['status'] = new_status + current_app['admin_notes'] = notes + current_app['review_date'] = datetime.now().strftime("%Y-%m-%d %H:%M") + current_app['reviewed_by'] = session.get('admin_username', 'admin') + + # Handle file uploads + for file_field in ['additional_docs']: + file = request.files.get(file_field) + if file and allowed_file(file.filename): + filename = secure_filename( + f"{application_id}_{file_field}_{datetime.now().strftime('%Y%m%d%H%M%S')}{os.path.splitext(file.filename)[1]}" + ) + upload_dir = os.path.join(app.config['ADMIN_UPLOAD_FOLDER'], 'application_docs') + os.makedirs(upload_dir, exist_ok=True) + file_path = os.path.join(upload_dir, filename) + file.save(file_path) + + if 'admin_uploads' not in current_app: + current_app['admin_uploads'] = [] + + current_app['admin_uploads'].append({ + 'filename': filename, + 'original_name': file.filename, + 'upload_date': datetime.now().strftime("%Y-%m-%d %H:%M"), + 'uploaded_by': session.get('admin_username', 'admin') + }) + + # Update the application in the list + if app_index >= 0: + all_applications[app_index] = current_app + + # Save updated data + if save_data('applications', all_applications): + flash(_('Application updated successfully'), 'success') + + # Send email notifications if status changed + if old_status != new_status: + # Send to applicant/parent + applicant_email = current_app.get('parent_email') + if applicant_email: + # Prepare email content based on status + if new_status == 'accepted': + subject = _("Congratulations! Your Application Has Been Accepted") + body = _( + f"Dear {current_app['first_name']} {current_app['last_name']},\n\n" + "We are pleased to inform you that your application to Munishi Secondary School has been accepted!\n\n" + "Congratulations! We look forward to welcoming you to our school community.\n\n" + "Next Steps:\n" + "1. Please log in to your application portal to review the acceptance letter\n" + "2. Complete the enrollment forms by [date]\n" + "3. Submit any remaining documents\n\n" + "If you have any questions, please contact our admissions office at admissions@munishischool.ac.tz\n\n" + "Sincerely,\n" + "The Admissions Committee\n" + "Munishi Secondary School" + ) + elif new_status == 'rejected': + subject = _("Update on Your Application to Munishi Secondary School") + body = _( + f"Dear {current_app['first_name']} {current_app['last_name']},\n\n" + "Thank you for applying to Munishi Secondary School.\n\n" + "After careful consideration, we regret to inform you that we are unable to offer you a place at this time.\n\n" + "We appreciate your interest in our school and wish you the best in your educational journey.\n\n" + "Sincerely,\n" + "The Admissions Committee\n" + "Munishi Secondary School" + ) + elif new_status == 'waitlisted': + subject = _("Update on Your Application to Munishi Secondary School") + body = _( + f"Dear {current_app['first_name']} {current_app['last_name']},\n\n" + "Thank you for applying to Munishi Secondary School.\n\n" + "We have received a large number of applications this year. While we are not able to offer you a place at this time, " + "your application has been placed on our waitlist. We will contact you if a place becomes available.\n\n" + "We appreciate your patience and understanding.\n\n" + "Sincerely,\n" + "The Admissions Committee\n" + "Munishi Secondary School" + ) + elif new_status == 'reviewed': + subject = _("Update on Your Application to Munishi Secondary School") + body = _( + f"Dear {current_app['first_name']} {current_app['last_name']},\n\n" + "This email is to inform you that your application to Munishi Secondary School has been reviewed.\n\n" + "Our admissions committee has examined your application materials, and we are currently in the final stages " + "of our decision-making process.\n\n" + "We will notify you as soon as a final decision has been made. Thank you for your patience.\n\n" + "Sincerely,\n" + "The Admissions Committee\n" + "Munishi Secondary School" + ) + else: # submitted (shouldn't happen, but just in case) + subject = _("Application Update") + body = _( + f"Dear {current_app['first_name']} {current_app['last_name']},\n\n" + "Your application status has been updated to: Submitted\n\n" + "This is usually an initial status when we receive your application. " + "We will begin reviewing it shortly.\n\n" + "Sincerely,\n" + "The Admissions Committee\n" + "Munishi Secondary School" + ) + + send_email(subject, [applicant_email], body) + + # Send to admin + admin_subject = _("Application Status Updated: {} {}").format( + current_app['first_name'], current_app['last_name']) + admin_body = _( + f"Application ID: {application_id}\n" + f"Student: {current_app['first_name']} {current_app['last_name']}\n" + f"Parent Email: {current_app.get('parent_email', 'N/A')}\n" + f"Status changed from {old_status} to: {new_status}\n\n" + "Review the application: {}\n" + ).format(url_for('admin_application_detail', application_id=application_id, _external=True)) + send_email(admin_subject, [app.config['ADMIN_EMAIL']], admin_body) + else: + flash(_('Failed to save application update. Please try again.'), 'error') + + return redirect(url_for('admin_application_detail', application_id=application_id)) + + # Document fields to display + document_fields = [ + 'birth_certificate', 'academic_records', + 'recommendation_letter', 'photo' + ] + + # Get all uploaded documents + documents = [] + for field in document_fields: + if current_app.get(field): + documents.append({ + 'name': field.replace('_', ' ').title(), + 'filename': current_app[field], + 'path': url_for('download_application_file', filename=current_app[field]) + }) + + # Get admin uploaded documents + admin_documents = [] + for doc in current_app.get('admin_uploads', []): + admin_documents.append({ + 'name': doc['original_name'], + 'uploaded_by': doc['uploaded_by'], + 'upload_date': doc['upload_date'], + 'path': url_for('download_admin_file', filename=doc['filename']) + }) + + return render_template('admin/application_detail.html', + application=current_app, + documents=documents, + admin_documents=admin_documents) + + + + + + +@app.route('/admin/settings', methods=['GET', 'POST']) +@admin_required +def admin_settings(): + if request.method == 'POST': + current_password = request.form.get('current_password') + new_password = request.form.get('new_password') + confirm_password = request.form.get('confirm_password') + + if not check_password_hash(app.config['ADMIN_PASSWORD'], current_password): + flash(_('Current password is incorrect'), 'error') + elif new_password != confirm_password: + flash(_('New passwords do not match'), 'error') + elif len(new_password) < 8: + flash(_('Password must be at least 8 characters long'), 'error') + else: + app.config['ADMIN_PASSWORD'] = generate_password_hash(new_password) + flash(_('Password updated successfully'), 'success') + return redirect(url_for('admin_settings')) + + return render_template('admin/settings.html') + +@app.route('/admin/content') +@admin_required +def admin_content(): + # Get all content types available for management + content_types = [ + {'name': 'News', 'endpoint': 'news', 'count': len(load_data('news') or [])}, + {'name': 'Events', 'endpoint': 'events', 'count': len(load_data('events') or [])}, + {'name': 'Faculty', 'endpoint': 'faculty', 'count': len(load_data('faculty') or [])}, + {'name': 'Alumni', 'endpoint': 'alumni', 'count': len(load_data('alumni') or [])}, + {'name': 'Clubs', 'endpoint': 'clubs', 'count': len(load_data('clubs') or [])} + ] + + return render_template('admin/content.html', content_types=content_types) + +@app.route('/admin/content/', methods=['GET', 'POST']) +@admin_required +def manage_content(content_type): + if content_type not in ['news', 'events', 'faculty', 'alumni', 'clubs']: + flash(_('Invalid content type'), 'error') + return redirect(url_for('admin_content')) + + data = load_data(content_type) or [] + + if request.method == 'POST': + # Handle content creation/update + action = request.form.get('action') + item_id = request.form.get('id') + + if action == 'delete': + # Delete item + data = [item for item in data if item.get('id') != item_id] + save_data(content_type, data) + flash(_('Item deleted successfully'), 'success') + return redirect(url_for('manage_content', content_type=content_type)) + + elif action in ['create', 'update']: + # Validate required fields + required_fields = { + 'news': ['title', 'content', 'date'], + 'events': ['title', 'date', 'location'], + 'faculty': ['name', 'position', 'department'], + 'alumni': ['name', 'graduation_year', 'current_position'], + 'clubs': ['name', 'description', 'meeting_schedule'] + }.get(content_type, []) + + form_data = {k: request.form.get(k, '').strip() for k in request.form} + + if not all(form_data.get(field) for field in required_fields): + flash(_('Please fill in all required fields'), 'error') + return redirect(url_for('manage_content', content_type=content_type)) + + # Handle file upload + image_file = request.files.get('image') + image_filename = None + if image_file and allowed_file(image_file.filename): + image_filename = secure_filename(f"{content_type}_{datetime.now().strftime('%Y%m%d%H%M%S')}_{image_file.filename}") + upload_dir = os.path.join(app.config['ADMIN_UPLOAD_FOLDER'], content_type) + os.makedirs(upload_dir, exist_ok=True) + image_file.save(os.path.join(upload_dir, image_filename)) + + if action == 'create': + # Create new item + new_item = { + 'id': str(uuid.uuid4()), + 'created_at': datetime.now().strftime("%Y-%m-%d %H:%M"), + 'created_by': session.get('admin_username', 'admin'), + **form_data + } + if image_filename: + new_item['image'] = image_filename + data.append(new_item) + flash(_('Item created successfully'), 'success') + else: + # Update existing item + for item in data: + if item.get('id') == item_id: + item.update({ + 'updated_at': datetime.now().strftime("%Y-%m-%d %H:%M"), + 'updated_by': session.get('admin_username', 'admin'), + **{k: v for k, v in form_data.items() if v} + }) + if image_filename: + item['image'] = image_filename + break + flash(_('Item updated successfully'), 'success') + + save_data(content_type, data) + return redirect(url_for('manage_content', content_type=content_type)) + + return render_template('admin/manage_content.html', + content_type=content_type, + items=data, + fields=get_content_fields(content_type)) + +def get_content_fields(content_type): + """Return field configuration for different content types""" + fields = { + 'news': [ + {'name': 'title', 'type': 'text', 'required': True, 'label': _('Title')}, + {'name': 'content', 'type': 'textarea', 'required': True, 'label': _('Content')}, + {'name': 'excerpt', 'type': 'textarea', 'required': False, 'label': _('Excerpt')}, + {'name': 'date', 'type': 'date', 'required': True, 'label': _('Date')}, + {'name': 'image', 'type': 'file', 'required': False, 'label': _('Featured Image')}, + {'name': 'author', 'type': 'text', 'required': False, 'label': _('Author')}, + {'name': 'tags', 'type': 'text', 'required': False, 'label': _('Tags')} + ], + 'events': [ + {'name': 'title', 'type': 'text', 'required': True, 'label': _('Title')}, + {'name': 'description', 'type': 'textarea', 'required': True, 'label': _('Description')}, + {'name': 'date', 'type': 'date', 'required': True, 'label': _('Date')}, + {'name': 'time', 'type': 'text', 'required': False, 'label': _('Time')}, + {'name': 'location', 'type': 'text', 'required': True, 'label': _('Location')}, + {'name': 'image', 'type': 'file', 'required': False, 'label': _('Featured Image')}, + {'name': 'registration_link', 'type': 'url', 'required': False, 'label': _('Registration Link')} + ], + 'faculty': [ + {'name': 'name', 'type': 'text', 'required': True, 'label': _('Name')}, + {'name': 'position', 'type': 'text', 'required': True, 'label': _('Position')}, + {'name': 'department', 'type': 'text', 'required': True, 'label': _('Department')}, + {'name': 'bio', 'type': 'textarea', 'required': False, 'label': _('Biography')}, + {'name': 'image', 'type': 'file', 'required': False, 'label': _('Photo')}, + {'name': 'email', 'type': 'email', 'required': False, 'label': _('Email')}, + {'name': 'phone', 'type': 'tel', 'required': False, 'label': _('Phone')} + ] + } + return fields.get(content_type, []) + +# Admin API Endpoints +@app.route('/admin/api/application//status', methods=['POST']) +@admin_required +def update_application_status(application_id): + applications = load_data('applications') or [] + application = next((app for app in applications if app['id'] == application_id), None) + + if not application: + return jsonify({'success': False, 'message': 'Application not found'}), 404 + + new_status = request.json.get('status') + if new_status not in ['submitted', 'reviewed', 'accepted', 'rejected', 'waitlisted']: + return jsonify({'success': False, 'message': 'Invalid status'}), 400 + + # Update application + for app in applications: + if app['id'] == application_id: + old_status = app['status'] + app['status'] = new_status + app['review_date'] = datetime.now().strftime("%Y-%m-%d %H:%M") + app['reviewed_by'] = session.get('admin_username', 'admin') + break + + save_data('applications', applications) + + # Send email notification if status changed to accepted + if new_status == 'accepted' and new_status != old_status: + # Send to applicant + applicant_email = application.get('parent_email') + if applicant_email: + subject = _("Your Application to Munishi Secondary School Has Been Accepted!") + body = _( + f"Dear {application['first_name']} {application['last_name']},\n\n" + "We are pleased to inform you that your application to Munishi Secondary School has been accepted!\n\n" + "Congratulations! We look forward to welcoming you to our school community.\n\n" + "Next Steps:\n" + "1. Please log in to your application portal to review the acceptance letter\n" + "2. Complete the enrollment forms by [date]\n" + "3. Submit any remaining documents\n\n" + "If you have any questions, please contact our admissions office at admissions@munishischool.ac.tz\n\n" + "Sincerely,\n" + "The Admissions Committee\n" + "Munishi Secondary School" + ) + send_email(subject, [applicant_email], body) + + # Send to admin + admin_subject = _("Application Accepted: {} {}").format( + application['first_name'], application['last_name']) + admin_body = _( + f"Application ID: {application_id}\n" + f"Student: {application['first_name']} {application['last_name']}\n" + f"Parent Email: {application.get('parent_email', 'N/A')}\n" + f"Status changed to: Accepted\n\n" + "Review the application: {}\n" + ).format(url_for('admin_application_detail', application_id=application_id, _external=True)) + send_email(admin_subject, [app.config['ADMIN_EMAIL']], admin_body) + + return jsonify({'success': True, 'new_status': new_status}) + +@app.route('/admin/api/application//notes', methods=['POST']) +@admin_required +def update_application_notes(application_id): + applications = load_data('applications') or [] + application = next((app for app in applications if app['id'] == application_id), None) + + if not application: + return jsonify({'success': False, 'message': 'Application not found'}), 404 + + notes = request.json.get('notes', '') + + # Update application + for app in applications: + if app['id'] == application_id: + app['admin_notes'] = notes + break + + save_data('applications', applications) + return jsonify({'success': True}) + +# Main Routes +@app.route('/') +def home(): + """Home page route""" + news_data = load_data('news') + events_data = load_data('events') + highlights_data = load_data('highlights') + + news = news_data[:3] if news_data else [] + events = events_data[:3] if events_data else [] + highlights = highlights_data[:3] if highlights_data else [] + + return render_template('home.html', + news=news, + events=events, + highlights=highlights) + +@app.route('/about') +def about(): + """About page route""" + return render_template('about.html', + history=load_data('history') or {}, + mission=load_data('mission') or {}, + leadership=load_data('leadership') or [], + facilities=load_data('facilities') or [], + faculty=load_data('faculty') or { + 'stats': {'teachers': 0, 'degrees': 0, 'training': 0}, + 'department_heads': [] + }) + +@app.route('/academics') +def academics(): + """Academics page route""" + return render_template('academics.html', + subjects=load_data('subjects') or [], + results=load_data('results') or {}, + calendar=load_data('calendar') or []) + +# Admissions Routes +@app.route('/admissions') +def admissions(): + """Admissions main page""" + return render_template('admissions.html', + process={ + 'steps': load_data('admissions_steps') or [], + 'requirements': load_data('admissions_requirements') or [] + }, + fees=load_data('fee_structure') or [], + scholarships=load_data('scholarships') or [], + downloads=load_data('admissions_downloads') or []) + +@app.route('/admissions/apply', methods=['GET', 'POST']) +def admissions_apply(): + """Admissions application form""" + if request.method == 'POST': + # Validate required fields + required_fields = [ + 'first_name', 'last_name', 'birthdate', 'gender', + 'parent_name', 'parent_email', 'parent_phone' + ] + if not all(request.form.get(field) for field in required_fields): + flash(_('Please fill in all required fields'), 'error') + return redirect(url_for('admissions_apply')) + + # Create application data + student_data = { + 'id': str(uuid.uuid4()), + 'first_name': request.form.get('first_name'), + 'last_name': request.form.get('last_name'), + 'birthdate': request.form.get('birthdate'), + 'gender': request.form.get('gender'), + 'nationality': request.form.get('nationality', ''), + 'current_school': request.form.get('current_school', ''), + 'applying_grade': request.form.get('applying_grade', ''), + 'parent_name': request.form.get('parent_name'), + 'parent_email': request.form.get('parent_email'), + 'parent_phone': request.form.get('parent_phone'), + 'address': request.form.get('address', ''), + 'emergency_contact': request.form.get('emergency_contact', ''), + 'medical_conditions': request.form.get('medical_conditions', ''), + 'previous_schools': request.form.get('previous_schools', ''), + 'extracurriculars': request.form.get('extracurriculars', ''), + 'why_join': request.form.get('why_join', ''), + 'status': 'submitted', + 'submission_date': datetime.now().strftime("%Y-%m-%d %H:%M"), + } + + # Handle file uploads + uploaded_files = {} + for file_field in ['birth_certificate', 'academic_records', 'recommendation_letter', 'photo']: + file = request.files.get(file_field) + if file and allowed_file(file.filename): + filename = secure_filename(f"{student_data['id']}_{file_field}{os.path.splitext(file.filename)[1]}") + upload_dir = os.path.join(app.config['UPLOAD_FOLDER'], 'applications') + os.makedirs(upload_dir, exist_ok=True) + file_path = os.path.join(upload_dir, filename) + file.save(file_path) + uploaded_files[file_field] = filename + + # Save application data + applications = load_data('applications') or [] + full_data = {**student_data, **uploaded_files} + applications.append(full_data) + save_data('applications', applications) + + # Send email notifications + # To applicant + applicant_subject = _("Application Submitted to Munishi Secondary School") + applicant_body = _( + f"Dear {student_data['first_name']} {student_data['last_name']},\n\n" + "Thank you for submitting your application to Munishi Secondary School!\n\n" + f"Your application ID is: {student_data['id']}\n" + "We will review your application and contact you within 5-7 business days.\n\n" + "If you have any questions, please contact our admissions office at admissions@munishischool.ac.tz\n\n" + "Sincerely,\n" + "The Admissions Committee\n" + "Munishi Secondary School" + ) + send_email(applicant_subject, [student_data['parent_email']], applicant_body) + + # To admin + admin_subject = _("New Application Submitted: {} {}").format( + student_data['first_name'], student_data['last_name']) + admin_body = _( + f"Application ID: {student_data['id']}\n" + f"Student: {student_data['first_name']} {student_data['last_name']}\n" + f"Applying Grade: {student_data.get('applying_grade', 'N/A')}\n" + f"Parent: {student_data['parent_name']}\n" + f"Email: {student_data['parent_email']}\n" + f"Phone: {student_data['parent_phone']}\n\n" + "Review the application: {}\n" + ).format(url_for('admin_application_detail', application_id=student_data['id'], _external=True)) + send_email(admin_subject, [app.config['ADMIN_EMAIL']], admin_body) + + flash(_('Application submitted successfully!'), 'success') + return redirect(url_for('application_success', application_id=student_data['id'])) + + return render_template('admissions/apply.html') + +@app.route('/admissions/success/') +def application_success(application_id): + """Application submission success page""" + return render_template('admissions/application_success.html', + application_id=application_id) + +@app.route('/admissions/view/') +def view_application(application_id): + """View submitted application (admin view)""" + applications = load_data('applications') or [] + application = next((app for app in applications if app['id'] == application_id), None) + + if not application: + return render_template('404.html'), 404 + + return render_template('admissions/view_application.html', + application=application) + +# Other Routes +@app.route('/student-life') +def student_life(): + """Student life page route""" + return render_template('student_life.html', + clubs=load_data('clubs') or [], + sports={ + 'competitive': load_data('sports_competitive') or [], + 'recreational': load_data('sports_recreational') or [], + 'achievements': load_data('sports_achievements') or [] + }, + arts={ + 'performing': load_data('arts_performing') or [], + 'visual': load_data('arts_visual') or [] + }, + activities=load_data('activities') or [], + blogs=load_data('blogs') or []) + +@app.route('/safeguarding') +def safeguarding(): + """Safeguarding page route""" + return render_template('safeguarding.html', + policies=load_data('policies') or []) + +@app.route('/news') +def news(): + """News listing page route""" + return render_template('news.html', + news=load_data('news') or []) + +@app.route('/news/') +def news_detail(slug): + """News detail page route""" + news_items = load_data('news') or [] + item = next((item for item in news_items if item.get('slug') == slug), None) + if not item: + return render_template('404.html'), 404 + return render_template('news_detail.html', item=item) + +@app.route('/events') +def events(): + """Events listing page route""" + return render_template('events.html', + events=load_data('events') or []) + +@app.route('/alumni') +def alumni(): + """Alumni page route""" + return render_template('alumni.html', + alumni=load_data('alumni') or []) + + + + +# Add these routes in the "Admin Routes" section + +@app.route('/download/application/') +@admin_required +def download_application_file(filename): + """Download an application file uploaded by the applicant""" + directory = os.path.join(app.config['UPLOAD_FOLDER'], 'applications') + return send_from_directory(directory, filename, as_attachment=True) + +@app.route('/download/admin/') +@admin_required +def download_admin_file(filename): + """Download an admin uploaded file for an application""" + directory = os.path.join(app.config['ADMIN_UPLOAD_FOLDER'], 'application_docs') + return send_from_directory(directory, filename, as_attachment=True) + + + + +@app.route('/contact', methods=['GET', 'POST']) +def contact(): + """Contact page route with form handling""" + contact_data = load_data('contact') or { + 'locations': [], + 'departments': [], + 'office_hours': {} + } + + if request.method == 'POST': + name = request.form.get('name', '').strip() + email = request.form.get('email', '').strip() + subject = request.form.get('subject', 'No Subject').strip() + message = request.form.get('message', '').strip() + + # Validate form data + if not all([name, email, message]): + flash(_('Please fill in all required fields'), 'error') + return redirect(url_for('contact')) + + if '@' not in email or '.' not in email: + flash(_('Please enter a valid email address'), 'error') + return redirect(url_for('contact')) + + # Process the message (in production: save to DB and send email) + print(f"New contact message from {name} ({email}): {message}") + + # Send email to admin + admin_subject = f"New Contact Form Submission: {subject}" + admin_body = ( + f"Name: {name}\n" + f"Email: {email}\n" + f"Subject: {subject}\n\n" + f"Message:\n{message}" + ) + send_email(admin_subject, [app.config['ADMIN_EMAIL']], admin_body) + + flash(_('Your message has been sent successfully!'), 'success') + return redirect(url_for('contact_success')) + + return render_template('contact.html', + locations=contact_data.get('locations', []), + departments=contact_data.get('departments', []), + office_hours=contact_data.get('office_hours', {})) + +@app.route('/contact/success') +def contact_success(): + """Contact success page""" + return render_template('contact_success.html') + +@app.route('/downloads//') +def download_file(category, filename): + """File download route""" + try: + # Secure the filename to prevent directory traversal attacks + safe_filename = secure_filename(filename) + directory = os.path.join(app.root_path, 'static', 'downloads', category) + + # Verify file exists before sending + if not os.path.exists(os.path.join(directory, safe_filename)): + app.logger.error(f"File not found: {category}/{safe_filename}") + return render_template('404.html'), 404 + + return send_from_directory( + directory, + safe_filename, + as_attachment=True, + mimetype='application/octet-stream' + ) + except Exception as e: + app.logger.error(f"Download error: {str(e)}") + return render_template('500.html'), 500 + +# Error Handlers +@app.errorhandler(404) +def page_not_found(e): + """404 Error handler""" + return render_template('404.html'), 404 + +@app.errorhandler(500) +def internal_server_error(e): + """500 Error handler""" + return render_template('500.html'), 500 + +if __name__ == '__main__': + # Create necessary directories if they don't exist + os.makedirs('data', exist_ok=True) + os.makedirs('static/downloads/admissions', exist_ok=True) + os.makedirs('static/downloads/scholarships', exist_ok=True) + os.makedirs('static/uploads/applications', exist_ok=True) + os.makedirs(app.config['ADMIN_UPLOAD_FOLDER'], exist_ok=True) + + # Create admin template files if they don't exist + admin_templates = [ + 'admin/base.html', + 'admin/login.html', + 'admin/dashboard.html', + 'admin/applications.html', + 'admin/application_detail.html', + 'admin/settings.html', + 'admin/content.html', + 'admin/manage_content.html' + ] + + os.makedirs('templates/admin', exist_ok=True) + for template in admin_templates: + template_path = os.path.join('templates', template) + if not os.path.exists(template_path): + with open(template_path, 'w') as f: + f.write(f"\n") + + app.run(debug=True, port=33445) \ No newline at end of file diff --git a/app_errors.log b/app_errors.log new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/static/css/style.css b/static/css/style.css new file mode 100644 index 0000000000000000000000000000000000000000..a8006318388398f1ef203cd5793159dfb1311434 --- /dev/null +++ b/static/css/style.css @@ -0,0 +1,265 @@ +/* static/css/style.css */ +:root { + --primary: #1a4d8c; + --secondary: #f9a826; + --accent: #e74c3c; + --light: #f8f9fa; + --dark: #343a40; +} + +body { + font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + color: #333; + line-height: 1.6; +} + +/* Accessibility enhancements */ +a:focus, button:focus { + outline: 3px solid var(--secondary); + outline-offset: 2px; +} + +.skip-link { + position: absolute; + top: -40px; + left: 0; + background: var(--primary); + color: white; + padding: 8px; + z-index: 100; +} + +.skip-link:focus { + top: 0; +} + +/* Header */ +.navbar-brand img { + max-height: 70px; +} + +.navbar .nav-link { + font-weight: 500; + padding: 0.5rem 1rem; + transition: all 0.3s; + position: relative; +} + +.navbar .nav-link:hover { + color: var(--primary); +} + +.navbar .nav-link:after { + content: ''; + position: absolute; + width: 0; + height: 2px; + bottom: 0; + left: 0; + background-color: var(--secondary); + transition: width 0.3s; +} + +.navbar .nav-link:hover:after, +.navbar .nav-link.active:after { + width: 100%; +} + +/* Hero Section */ +.hero { + background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../images/hero-bg.jpg') center/cover no-repeat; + color: white; + padding: 100px 0; + text-align: center; +} + +.hero h1 { + font-weight: 700; + font-size: 3rem; + text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); +} + +.hero p { + font-size: 1.2rem; + max-width: 700px; + margin: 20px auto; +} + +/* Cards */ +.card { + border: none; + border-radius: 10px; + overflow: hidden; + box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); + transition: transform 0.3s, box-shadow 0.3s; + height: 100%; +} + +.card:hover { + transform: translateY(-10px); + box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15); +} + +.card-img-top { + height: 200px; + object-fit: cover; +} + +.card-title { + color: var(--primary); + font-weight: 700; +} + +/* News section */ +.news-card .date { + color: var(--secondary); + font-weight: 600; +} + +/* Buttons */ +.btn-primary { + background-color: var(--primary); + border-color: var(--primary); +} + +.btn-primary:hover { + background-color: #0d3a6e; + border-color: #0d3a6e; +} + +.btn-secondary { + background-color: var(--secondary); + border-color: var(--secondary); + color: #fff; +} + +.btn-secondary:hover { + background-color: #e59400; + border-color: #e59400; +} + +/* Section titles */ +.section-title { + position: relative; + margin-bottom: 40px; + text-align: center; +} + +.section-title:after { + content: ''; + display: block; + width: 80px; + height: 4px; + background: var(--secondary); + margin: 15px auto 0; +} + +/* Testimonials */ +.testimonial { + background: var(--light); + padding: 30px; + border-radius: 10px; + position: relative; +} + +.testimonial:after { + content: '"'; + position: absolute; + top: 20px; + left: 20px; + font-size: 5rem; + color: rgba(0, 0, 0, 0.05); + font-family: Georgia, serif; +} + +.testimonial .author { + font-weight: 600; + color: var(--primary); + margin-top: 20px; +} + +/* Footer */ +footer { + background: linear-gradient(to right, #0a3a6d, #1a4d8c); +} + +footer h5 { + position: relative; + padding-bottom: 15px; +} + +footer h5:after { + content: ''; + position: absolute; + left: 0; + bottom: 0; + width: 50px; + height: 2px; + background: var(--secondary); +} + +footer a { + color: #ddd; + text-decoration: none; + transition: color 0.3s; +} + +footer a:hover { + color: var(--secondary); +} + +.social-links a { + display: inline-block; + width: 40px; + height: 40px; + background: rgba(255, 255, 255, 0.1); + border-radius: 50%; + text-align: center; + line-height: 40px; + transition: all 0.3s; +} + +.social-links a:hover { + background: var(--secondary); + transform: translateY(-5px); +} + +/* WhatsApp Button */ +.whatsapp-button { + position: fixed; + bottom: 30px; + right: 30px; + width: 60px; + height: 60px; + background: #25d366; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + color: white; + font-size: 2rem; + box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); + z-index: 1000; + transition: all 0.3s; +} + +.whatsapp-button:hover { + transform: scale(1.1); + box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3); + color: white; +} + +/* Responsive adjustments */ +@media (max-width: 768px) { + .hero { + padding: 60px 0; + } + + .hero h1 { + font-size: 2.2rem; + } + + .navbar-brand img { + max-height: 50px; + } +} \ No newline at end of file diff --git a/static/downloads/admissions/company logo.jpg b/static/downloads/admissions/company logo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..713b964d6b680d4f862078d6edac22624d3eb75a Binary files /dev/null and b/static/downloads/admissions/company logo.jpg differ diff --git a/static/downloads/admissions/prospectus.pdf b/static/downloads/admissions/prospectus.pdf new file mode 100644 index 0000000000000000000000000000000000000000..00043217c97f72ae1446067f61f81238bdef6be4 Binary files /dev/null and b/static/downloads/admissions/prospectus.pdf differ diff --git a/static/downloads/general/index.html b/static/downloads/general/index.html new file mode 100644 index 0000000000000000000000000000000000000000..20a71ad3a53f105e45d8acbdb5afbe10918a0bea --- /dev/null +++ b/static/downloads/general/index.html @@ -0,0 +1,10 @@ + + + + Downloads + + +

Downloads

+

Available downloads will be listed here.

+ + diff --git a/static/images/default.jpg b/static/images/default.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/static/js/main.js b/static/js/main.js new file mode 100644 index 0000000000000000000000000000000000000000..b2a581e474e8ea16a605d9935ceb3bdd4b1845ba --- /dev/null +++ b/static/js/main.js @@ -0,0 +1,63 @@ +// Initialize tooltips +document.addEventListener('DOMContentLoaded', function() { + // Enable Bootstrap tooltips + var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')); + var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) { + return new bootstrap.Tooltip(tooltipTriggerEl); + }); + + // Handle contact form submission + const contactForm = document.getElementById('contact-form'); + if (contactForm) { + contactForm.addEventListener('submit', function(e) { + e.preventDefault(); + + // Simple validation + const name = document.getElementById('name').value.trim(); + const email = document.getElementById('email').value.trim(); + const message = document.getElementById('message').value.trim(); + + if (!name || !email || !message) { + alert('Please fill in all fields'); + return; + } + + // In a real app, you would send this data to the server + console.log('Form submitted:', { name, email, message }); + + // Show success message + alert('Thank you for your message. We will contact you soon.'); + contactForm.reset(); + }); + } + + // Language switcher + const langSwitcher = document.querySelector('.lang-selector'); + if (langSwitcher) { + langSwitcher.addEventListener('click', function(e) { + if (e.target.tagName === 'A') { + // In a real app, this would be handled by Flask + localStorage.setItem('preferredLanguage', e.target.dataset.lang); + } + }); + } + + // Lazy loading for images + if ('loading' in HTMLImageElement.prototype) { + const images = document.querySelectorAll('img[loading="lazy"]'); + images.forEach(img => { + img.src = img.dataset.src; + }); + } else { + // Fallback for browsers that don't support lazy loading + const lazyLoadScript = document.createElement('script'); + lazyLoadScript.src = 'https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.6.1/dist/lazyload.min.js'; + document.body.appendChild(lazyLoadScript); + + lazyLoadScript.onload = function() { + new LazyLoad({ + elements_selector: "[loading=lazy]" + }); + }; + } +}); \ No newline at end of file diff --git a/static/uploads/applications/348f9a45-0184-40ed-8fc4-444829eea40d_academic_records.pdf b/static/uploads/applications/348f9a45-0184-40ed-8fc4-444829eea40d_academic_records.pdf new file mode 100644 index 0000000000000000000000000000000000000000..00043217c97f72ae1446067f61f81238bdef6be4 Binary files /dev/null and b/static/uploads/applications/348f9a45-0184-40ed-8fc4-444829eea40d_academic_records.pdf differ diff --git a/static/uploads/applications/348f9a45-0184-40ed-8fc4-444829eea40d_birth_certificate.pdf b/static/uploads/applications/348f9a45-0184-40ed-8fc4-444829eea40d_birth_certificate.pdf new file mode 100644 index 0000000000000000000000000000000000000000..00043217c97f72ae1446067f61f81238bdef6be4 Binary files /dev/null and b/static/uploads/applications/348f9a45-0184-40ed-8fc4-444829eea40d_birth_certificate.pdf differ diff --git a/static/uploads/applications/348f9a45-0184-40ed-8fc4-444829eea40d_photo.png b/static/uploads/applications/348f9a45-0184-40ed-8fc4-444829eea40d_photo.png new file mode 100644 index 0000000000000000000000000000000000000000..eac66c458a2bb16261ae8714aaacd4247fc6ad1f --- /dev/null +++ b/static/uploads/applications/348f9a45-0184-40ed-8fc4-444829eea40d_photo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7f9a1c6ad1f29779f048aa10235738a811223546459a35aa650b9ffc6ab30d5 +size 525415 diff --git a/static/uploads/applications/348f9a45-0184-40ed-8fc4-444829eea40d_recommendation_letter.pdf b/static/uploads/applications/348f9a45-0184-40ed-8fc4-444829eea40d_recommendation_letter.pdf new file mode 100644 index 0000000000000000000000000000000000000000..00043217c97f72ae1446067f61f81238bdef6be4 Binary files /dev/null and b/static/uploads/applications/348f9a45-0184-40ed-8fc4-444829eea40d_recommendation_letter.pdf differ diff --git a/static/uploads/applications/7d8de7f4-a5c9-47c3-81e0-9e95eed94557_academic_records.pdf b/static/uploads/applications/7d8de7f4-a5c9-47c3-81e0-9e95eed94557_academic_records.pdf new file mode 100644 index 0000000000000000000000000000000000000000..00043217c97f72ae1446067f61f81238bdef6be4 Binary files /dev/null and b/static/uploads/applications/7d8de7f4-a5c9-47c3-81e0-9e95eed94557_academic_records.pdf differ diff --git a/static/uploads/applications/7d8de7f4-a5c9-47c3-81e0-9e95eed94557_birth_certificate.pdf b/static/uploads/applications/7d8de7f4-a5c9-47c3-81e0-9e95eed94557_birth_certificate.pdf new file mode 100644 index 0000000000000000000000000000000000000000..00043217c97f72ae1446067f61f81238bdef6be4 Binary files /dev/null and b/static/uploads/applications/7d8de7f4-a5c9-47c3-81e0-9e95eed94557_birth_certificate.pdf differ diff --git a/static/uploads/applications/7d8de7f4-a5c9-47c3-81e0-9e95eed94557_photo.png b/static/uploads/applications/7d8de7f4-a5c9-47c3-81e0-9e95eed94557_photo.png new file mode 100644 index 0000000000000000000000000000000000000000..1907797001e10e5218bcbdc636eefde047c32a0d --- /dev/null +++ b/static/uploads/applications/7d8de7f4-a5c9-47c3-81e0-9e95eed94557_photo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:613ef752dc28674ad72b5814c528043cbaa47ac93484522d1f77441203aa4d71 +size 508594 diff --git a/static/uploads/applications/7d8de7f4-a5c9-47c3-81e0-9e95eed94557_recommendation_letter.pdf b/static/uploads/applications/7d8de7f4-a5c9-47c3-81e0-9e95eed94557_recommendation_letter.pdf new file mode 100644 index 0000000000000000000000000000000000000000..00043217c97f72ae1446067f61f81238bdef6be4 Binary files /dev/null and b/static/uploads/applications/7d8de7f4-a5c9-47c3-81e0-9e95eed94557_recommendation_letter.pdf differ diff --git a/templates/404.html b/templates/404.html new file mode 100644 index 0000000000000000000000000000000000000000..d495644b37613efd553d0ed2a58f5e383aa905d3 --- /dev/null +++ b/templates/404.html @@ -0,0 +1,17 @@ +{% extends "base.html" %} + +{% block content %} +
+
+
+ +
+

{{ _('Page Not Found') }}

+

{{ _('The page you are looking for does not exist.') }}

+

{{ _('Please check the URL or navigate back to the homepage.') }}

+ + {{ _('Return to Homepage') }} + +
+
+{% endblock %} \ No newline at end of file diff --git a/templates/about.html b/templates/about.html new file mode 100644 index 0000000000000000000000000000000000000000..354bc6b1460bd9d93deb689ee606d8699a3440d1 --- /dev/null +++ b/templates/about.html @@ -0,0 +1,342 @@ +{% extends "base.html" %} + +{% block content %} + +
+
+

{{ _('About Our School') }}

+

{{ _('Discover our rich history, mission, and the dedicated team that makes Munishi School exceptional') }}

+
+
+ + +
+
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+

{{ _('Our History') }}

+

+ {{ history.founding.description }} +

+
+

{{ _('Key Milestones') }}

+
+ {% for milestone in history.milestones %} +
+
+ {{ milestone.year }} +
+

{{ milestone.event }}

+

{{ milestone.description }}

+
+ {% endfor %} +
+
+
+
+
+
+
+ + +
+
+
+

{{ _('Our Mission & Vision') }}

+ +
+
+
+ +
+

{{ _('Mission Statement') }}

+

{{ mission.mission }}

+
+ +
+
+ +
+

{{ _('Vision Statement') }}

+

{{ mission.vision }}

+
+
+ +
+

{{ _('Core Values') }}

+
+ {% for value in mission.get('values', []) %} +
+
+ +
+

{{ value.name }}

+

{{ value.description }}

+
+ {% endfor %} +
+
+
+
+
+ + +
+
+

{{ _('School Leadership') }}

+

+ {{ _('Our dedicated leadership team brings decades of educational experience and a passion for student success') }} +

+ +
+ {% for leader in leadership %} +
+
+
+ +
+
+
+

{{ leader.name }}

+

{{ leader.position }}

+

{{ leader.bio }}

+
+ + {{ leader.email }} +
+
+
+ {% endfor %} +
+
+
+ + +
+
+

{{ _('Our Faculty') }}

+

+ {{ _('Highly qualified educators committed to academic excellence and student development') }} +

+ +
+
+
+
{{ faculty.stats.teachers }}
+

{{ _('Dedicated Teachers') }}

+

{{ _('Average 15 years teaching experience') }}

+
+ +
+
{{ faculty.stats.degrees }}%
+

{{ _('Advanced Degrees') }}

+

{{ _('Masters or PhD qualifications') }}

+
+ +
+
{{ faculty.stats.training }}
+

{{ _('Annual Training Hours') }}

+

{{ _('Professional development commitment') }}

+
+
+ +
+

{{ _('Department Heads') }}

+
+ {% for head in faculty.department_heads %} +
+
+ {{ head.initials }} +
+

{{ head.name }}

+

{{ head.department }}

+

{{ head.qualification }}

+
+ {% endfor %} +
+
+
+
+
+ + +
+
+

{{ _('Our Facilities') }}

+

+ {{ _('Modern learning environments designed to inspire and support academic achievement') }} +

+ +
+ {% for facility in facilities %} +
+
+
+ +
+
+
+

{{ facility.name }}

+

{{ facility.description }}

+
+ {% for feature in facility.features %} + + {{ feature }} + + {% endfor %} +
+
+
+ {% endfor %} +
+
+
+ + +
+
+
+

{{ _('Accreditation & Partnerships') }}

+ +
+
+
+ +
+

{{ _('Fully Accredited') }}

+

{{ _('Recognized by the Tanzanian Ministry of Education') }}

+
+ +
+
+ +
+

{{ _('Global Partnerships') }}

+

{{ _('Collaborations with international educational institutions') }}

+
+ +
+
+ +
+

{{ _('Quality Assurance') }}

+

{{ _('Regular evaluations to maintain educational standards') }}

+
+
+ +
+

{{ _('Our Partners') }}

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + +
+
+

{{ _('What Parents & Students Say') }}

+ +
+
+
+
A
+
+

Amina Juma

+

{{ _('Parent') }}

+
+
+

"{{ _('The transformation in my daughter since joining Munishi has been remarkable. She\'s more confident and passionate about learning.') }}"

+
+ + + + + +
+
+ +
+
+
D
+
+

David Omondi

+

{{ _('Alumni') }}

+
+
+

"{{ _('Munishi prepared me not just academically, but for life. The leadership opportunities I had shaped my career path.') }}"

+
+ + + + + +
+
+ +
+
+
J
+
+

John Mwamba

+

{{ _('Student') }}

+
+
+

"{{ _('I love the balance between academics and extracurriculars. The robotics club has been life-changing for me!') }}"

+
+ + + + + +
+
+
+
+
+ + +
+
+
+

{{ _('Experience Munishi School') }}

+

+ {{ _('Schedule a campus tour and discover why Munishi is the right choice for your child\'s education') }} +

+ +
+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/academics.html b/templates/academics.html new file mode 100644 index 0000000000000000000000000000000000000000..16bef02130fb91948ecd63a4a4772db0d44d322f --- /dev/null +++ b/templates/academics.html @@ -0,0 +1,314 @@ +{% extends "base.html" %} + +{% block content %} + +
+
+

{{ _('Academic Excellence') }}

+

{{ _('Rigorous academic programs designed to prepare students for university and beyond') }}

+
+
+ + +
+
+
+

{{ _('Academic Performance') }}

+ +
+
+
{{ results.pass_rate }}%
+

{{ _('Pass Rate') }}

+

{{ _('Consistent outstanding results in national examinations') }}

+
+ +
+
{{ results.university_admission }}%
+

{{ _('University Admission') }}

+

{{ _('Students admitted to top universities worldwide') }}

+
+ +
+
{{ subjects|length }}
+

{{ _('Subjects Offered') }}

+

{{ _('Comprehensive range of academic disciplines') }}

+
+ +
+
{{ results.teacher_ratio }}
+

{{ _('Teacher-Student Ratio') }}

+

{{ _('Personalized attention for every learner') }}

+
+
+ + +
+

{{ _('5-Year NECTA Performance') }}

+
+
+
+
{{ results.current_year }}
+
{{ results.current_pass_rate }}%
+
+
+
+ {{ results.improvement }}% +
+
{{ _('improvement since') }} {{ results.start_year }}
+
+
+ +
+ {% for year in results.years %} +
+
{{ year.year }}
+
+
{{ year.pass_rate }}%
+
+ {% endfor %} +
+
+
+
+
+
+ + +
+
+

{{ _('Academic Departments') }}

+

+ {{ _('Our comprehensive curriculum is organized into specialized departments, each with expert faculty and modern facilities') }} +

+ +
+ {% for department in subjects %} +
+
+
+ +
+

{{ department.name }}

+
+ +
    + {% for subject in department.subjects %} +
  • + + {{ subject }} +
  • + {% endfor %} +
+ +
+

{{ _('Department Head') }}:

+
+
+ +
+ {{ department.head }} +
+
+
+ {% endfor %} +
+
+
+ + +
+
+
+

{{ _('Curriculum & Programs') }}

+ +
+
+

{{ _('Form 1-4 Curriculum') }}

+

+ {{ _('Our comprehensive curriculum follows the Tanzanian National Curriculum while incorporating international best practices:') }} +

+ +
    +
  • +
    + +
    + {{ _('Core subjects in Mathematics, Sciences, Languages, and Social Sciences') }} +
  • +
  • +
    + +
    + {{ _('Practical skills development through ICT, Entrepreneurship, and Life Skills') }} +
  • +
  • +
    + +
    + {{ _('Project-based learning and research opportunities') }} +
  • +
  • +
    + +
    + {{ _('Career guidance and university preparation programs') }} +
  • +
+ + + {{ _('Download Curriculum Guide') }} + +
+ +
+

{{ _('Special Programs') }}

+ +
+
+
+
+ +
+

{{ _('STEM Program') }}

+
+

+ {{ _('Advanced studies in Science, Technology, Engineering, and Mathematics with specialized labs and competitions') }} +

+
+ +
+
+
+ +
+

{{ _('Global Citizenship') }}

+
+

+ {{ _('International exchange programs, Model UN, and global awareness curriculum') }} +

+
+ +
+
+
+ +
+

{{ _('Digital Literacy') }}

+
+

+ {{ _('Comprehensive ICT education with coding, robotics, and digital creativity courses') }} +

+
+
+
+
+
+
+
+ + +
+
+
+

{{ _('Academic Calendar') }}

+ + {{ _('Download Full Calendar') }} + +
+ +
+ + + + + + + + + + + {% for term in calendar %} + + + + + + + {% endfor %} + +
{{ _('Term') }}{{ _('Start Date') }}{{ _('End Date') }}{{ _('Key Events') }}
{{ term.name }}{{ term.start_date|format_date }}{{ term.end_date|format_date }} +
    + {% for event in term.events %} +
  • {{ event }}
  • + {% endfor %} +
+
+
+ +
+

{{ _('Upcoming Academic Events') }}

+ +
+ {% for event in upcoming_events %} +
+
+ {{ event.term }} + {{ event.date|format_date }} +
+

{{ event.title }}

+

{{ event.description }}

+
+ {% endfor %} +
+
+
+
+ + +
+
+

{{ _('Learning Resources') }}

+ +
+
+
+ +
+

{{ _('Syllabus Guides') }}

+

{{ _('Detailed subject syllabi and learning objectives') }}

+ {{ _('View Resources') }} +
+ +
+
+ +
+

{{ _('E-Learning Portal') }}

+

{{ _('Access to online courses, materials, and assignments') }}

+ {{ _('Login to Portal') }} +
+ +
+
+ +
+

{{ _('University Prep') }}

+

{{ _('Resources for university applications and scholarships') }}

+ {{ _('Explore Options') }} +
+ +
+
+ +
+

{{ _('Download Center') }}

+

{{ _('Timetables, syllabi, and academic forms') }}

+ {{ _('Browse Files') }} +
+
+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/admin/application_detail.html b/templates/admin/application_detail.html new file mode 100644 index 0000000000000000000000000000000000000000..fc6efc0a2b3011acecaf0ac83a1d19bb0f2b91cc --- /dev/null +++ b/templates/admin/application_detail.html @@ -0,0 +1,290 @@ + +{% extends "admin/base.html" %} + +{% block admin_title %}{{ _('Application') }} #{{ application.id|truncate(8) }}{% endblock %} + +{% block admin_content %} +
+ +
+
+

+ {{ application.first_name }} {{ application.last_name }} + + {{ application.status|title }} + +

+

+ {{ _('Applying for') }}: {{ application.applying_grade }} • + {{ _('Submitted on') }}: {{ application.submission_date|format_date('full') }} +

+
+ +
+ +
+ +
+
+
+ + +
+ +
+ + +
+
+ +
+ +
+ +
+
+ +
+ +
+
+ + +
+ + + +
+

{{ _('Student Details') }}

+ +
+
+

{{ _('Full Name') }}

+

{{ application.first_name }} {{ application.last_name }}

+
+ +
+

{{ _('Date of Birth') }}

+

{{ application.birthdate|format_date('full') }}

+
+ +
+

{{ _('Gender') }}

+

{{ application.gender|title }}

+
+ +
+

{{ _('Nationality') }}

+

{{ application.nationality or 'N/A' }}

+
+ +
+

{{ _('Current School') }}

+

{{ application.current_school or 'N/A' }}

+
+ +
+

{{ _('Applying for Grade') }}

+

{{ application.applying_grade or 'N/A' }}

+
+
+
+ + + + + + + + + +
+
+
+ + + + +{% endblock %} \ No newline at end of file diff --git a/templates/admin/applications.html b/templates/admin/applications.html new file mode 100644 index 0000000000000000000000000000000000000000..5114205a08850f8ab7f128a8909a5ed24bfa7f32 --- /dev/null +++ b/templates/admin/applications.html @@ -0,0 +1,146 @@ + +{% extends "admin/base.html" %} + +{% block admin_title %}{{ _('Applications') }}{% endblock %} + +{% block admin_content %} +
+
+

{{ _('Manage Applications') }}

+ +
+
+ +
+ +
+
+ +
+ +
+ +
+
+
+
+ + {% if applications %} +
+ + + + + + + + + + + + + + {% for app in applications %} + + + + + + + + + + {% endfor %} + +
{{ _('ID') }}{{ _('Name') }}{{ _('Parent') }}{{ _('Grade') }}{{ _('Status') }}{{ _('Submitted') }}{{ _('Actions') }}
+ {{ app.id|truncate(8) }} + + {{ app.first_name }} {{ app.last_name }} + + {{ app.parent_name }}
+ {{ app.parent_email }} +
+ {{ app.applying_grade }} + + + {{ app.status|title }} + + + {{ app.submission_date|format_date('medium') }} + + + + + + + +
+
+ + {% if total_pages > 1 %} +
+
+ {{ _('Showing') }} {{ (current_page-1)*APPLICATIONS_PER_PAGE + 1 }} + {{ _('to') }} {{ min(current_page*APPLICATIONS_PER_PAGE, (applications|length)) }} + {{ _('of') }} {{ applications|length }} {{ _('results') }} +
+
+ {% if current_page > 1 %} + + {{ _('Previous') }} + + {% endif %} + + {% for page_num in range(1, total_pages+1) %} + + {{ page_num }} + + {% endfor %} + + {% if current_page < total_pages %} + + {{ _('Next') }} + + {% endif %} +
+
+ {% endif %} + {% else %} +
+ +

{{ _('No applications found') }}

+

{{ _('Try changing your filters or search criteria') }}

+
+ {% endif %} +
+ + +{% endblock %} \ No newline at end of file diff --git a/templates/admin/base.html b/templates/admin/base.html new file mode 100644 index 0000000000000000000000000000000000000000..43bf41896e0cec8a9de80c1c707be484e3fff968 --- /dev/null +++ b/templates/admin/base.html @@ -0,0 +1,60 @@ + + + + + + + {{ _('Admin Panel') }} | {{ school_name }} + + + + +
+ + + + +
+
+

{% block admin_title %}{% endblock %}

+
+ {{ _('Logged in as') }} admin +
+
+ +
+ {% with messages = get_flashed_messages(with_categories=true) %} + {% if messages %} + {% for category, message in messages %} +
+ {{ message }} +
+ {% endfor %} + {% endif %} + {% endwith %} + + {% block admin_content %}{% endblock %} +
+
+
+ + \ No newline at end of file diff --git a/templates/admin/content.html b/templates/admin/content.html new file mode 100644 index 0000000000000000000000000000000000000000..fe0ed7b8d443bc08fdce6ed843ed86587685c7d8 --- /dev/null +++ b/templates/admin/content.html @@ -0,0 +1 @@ + diff --git a/templates/admin/dashboard.html b/templates/admin/dashboard.html new file mode 100644 index 0000000000000000000000000000000000000000..141a08c8de40da5f49a45e0f098c26ea7e4cb30c --- /dev/null +++ b/templates/admin/dashboard.html @@ -0,0 +1,76 @@ + +{% extends "admin/base.html" %} + +{% block admin_title %}{{ _('Dashboard') }}{% endblock %} + +{% block admin_content %} +
+
+

{{ _('Total Applications') }}

+

{{ stats.total }}

+
+
+

{{ _('Submitted') }}

+

{{ stats.submitted }}

+
+
+

{{ _('Accepted') }}

+

{{ stats.accepted }}

+
+
+

{{ _('Rejected') }}

+

{{ stats.rejected }}

+
+
+ +
+

{{ _('Recent Applications') }}

+ {% set recent_apps = load_data('applications')|sort(attribute='submission_date', reverse=True)|slice(5) %} + {% if recent_apps %} +
+ + + + + + + + + + + + {% for app in recent_apps %} + + + + + + + + {% endfor %} + +
{{ _('ID') }}{{ _('Name') }}{{ _('Grade') }}{{ _('Status') }}{{ _('Date') }}
+ + {{ app.id|truncate(8) }} + + + {{ app.first_name }} {{ app.last_name }} + + {{ app.applying_grade }} + + + {{ app.status|title }} + + + {{ app.submission_date|format_date('medium') }} +
+
+ {% else %} +

{{ _('No applications found') }}

+ {% endif %} +
+{% endblock %} \ No newline at end of file diff --git a/templates/admin/login.html b/templates/admin/login.html new file mode 100644 index 0000000000000000000000000000000000000000..42fa5d6adde20c298fea07ff4a72649bbc397e75 --- /dev/null +++ b/templates/admin/login.html @@ -0,0 +1,61 @@ + + + + + + + {{ _('Admin Login') }} | {{ school_name }} + + + + +
+
+
+

{{ school_name }}

+

{{ _('Administrator Portal') }}

+
+ +
+ {% with messages = get_flashed_messages(with_categories=true) %} + {% if messages %} + {% for category, message in messages %} +
+ {{ message }} +
+ {% endfor %} + {% endif %} + {% endwith %} + +
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+
+
+
+ +
+

{{ _('For authorized personnel only. Unauthorized access is prohibited.') }}

+
+
+ + \ No newline at end of file diff --git a/templates/admin/manage_content.html b/templates/admin/manage_content.html new file mode 100644 index 0000000000000000000000000000000000000000..50303c03a5f3d9a9cf987ce323499a290cc10458 --- /dev/null +++ b/templates/admin/manage_content.html @@ -0,0 +1 @@ + diff --git a/templates/admin/settings.html b/templates/admin/settings.html new file mode 100644 index 0000000000000000000000000000000000000000..1135c45a87dd8ddda943d78fdba1f87af8ffa46c --- /dev/null +++ b/templates/admin/settings.html @@ -0,0 +1,43 @@ + +{% extends "admin/base.html" %} + +{% block admin_title %}{{ _('Admin Settings') }}{% endblock %} + +{% block admin_content %} +
+
+

{{ _('Account Settings') }}

+

{{ _('Update your administrator account details') }}

+
+ +
+
+
+
+ + +
+ +
+ + +
+ +
+ + +
+
+ +
+ +
+
+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/admissions.html b/templates/admissions.html new file mode 100644 index 0000000000000000000000000000000000000000..d17428dcebf15275fd852e993abe7580379ce652 --- /dev/null +++ b/templates/admissions.html @@ -0,0 +1,184 @@ +{% extends "base.html" %} + +{% block content %} + +
+
+

{{ _('Admissions') }}

+

{{ _('Join our community of learners and achievers. Start your journey with Munishi School today.') }}

+
+
+ + +
+
+
+

{{ _('Admissions Process') }}

+ +
+ {% for step in process.steps %} +
+
+ {{ loop.index }} +
+
+

{{ step.title }}

+

{{ step.description }}

+ {% if step.date %} +

+ {{ _('Date') }}: {{ step.date|format_date('full') }} +

+ {% endif %} + {% if step.deadline %} +

+ {{ _('Deadline') }}: {{ step.deadline|format_date('full') }} +

+ {% endif %} +
+
+ {% endfor %} +
+
+
+
+ + +
+
+
+ +
+

{{ _('Admission Requirements') }}

+
    + {% for requirement in process.requirements %} +
  • + + {{ requirement }} +
  • + {% endfor %} +
+
+ + +
+

{{ _('Fee Structure') }}

+
+ + + + + + + + + {% for fee in fees %} + + + + + {% endfor %} + + + + + +
{{ _('Description') }}{{ _('Amount') }}
{{ fee.description }}{{ fee.amount|format_currency }}
{{ _('Total Annual Fees') }}{{ fees|sum(attribute='amount')|format_currency }}
+
+ + {{ _('Download Full Fee Structure') }} + +
+
+
+
+ + +
+
+

{{ _('Scholarships & Bursaries') }}

+ +
+ {% for scholarship in scholarships %} +
+
+ +
+

{{ scholarship.name }}

+

{{ scholarship.description }}

+ + {{ _('Download Application') }} + +
+ {% endfor %} +
+
+
+ + +
+
+

{{ _('Admissions Downloads') }}

+ +
+
+ + + + + + + + + + + {% for download in downloads %} + + + + + + + {% endfor %} + +
{{ _('Document') }}{{ _('Description') }}{{ _('File Size') }}{{ _('Download') }}
{{ download.name }}{{ download.description }}{{ download.size }} + + {{ _('Download') }} + +
+
+
+
+
+ +
+
+
+

{{ _('Ready to Apply?') }}

+

+ {{ _('Begin your journey with Munishi School today. Our online application makes the process simple and straightforward.') }} +

+ + + +
+

{{ _('Application Support') }}

+

+ + admissions@munishischool.ac.tz +

+

+ + +255 22 123 4567 (Admissions Office) +

+
+
+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/admissions/application_success.html b/templates/admissions/application_success.html new file mode 100644 index 0000000000000000000000000000000000000000..17a69cc488a29c1630a2d0d43309dcf07f3b34e4 --- /dev/null +++ b/templates/admissions/application_success.html @@ -0,0 +1,58 @@ +{% extends "base.html" %} + +{% block content %} +
+
+
+
+ +
+

{{ _('Application Submitted Successfully!') }}

+ +
+

{{ _('Application Details') }}

+

+ {{ _('Application ID') }}: {{ application_id }} +

+

+ {{ _('We have received your application for admission to Munishi School. Our admissions team will review your application and contact you within 7-10 business days.') }} +

+
+ +
+

{{ _('Next Steps') }}

+
    +
  • + + {{ _('Review of your application documents') }} +
  • +
  • + + {{ _('Possible request for additional information') }} +
  • +
  • + + {{ _('Scheduling of entrance examination (if applicable)') }} +
  • +
  • + + {{ _('Admission decision notification via email') }} +
  • +
+
+ + +
+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/admissions/apply.html b/templates/admissions/apply.html new file mode 100644 index 0000000000000000000000000000000000000000..428760e791aa065f0712866db6d37825bf31eff1 --- /dev/null +++ b/templates/admissions/apply.html @@ -0,0 +1,184 @@ +{% extends "base.html" %} + +{% block content %} +
+
+
+

{{ _('Admissions Application') }}

+

+ {{ _('Thank you for your interest in Munishi School. Please complete the form below to apply for admission.') }} +

+ +
+ +
+

{{ _('Student Information') }}

+ +
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+
+ + +
+

{{ _('Parent/Guardian Information') }}

+ +
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+
+ + +
+

{{ _('Additional Information') }}

+ +
+
+ + +

{{ _('Please provide details of any medical conditions or allergies we should be aware of') }}

+
+ +
+ + +

{{ _('List schools attended in the last 3 years with dates') }}

+
+ +
+ + +

{{ _('Sports, arts, clubs, or other activities of interest') }}

+
+ +
+ + +
+
+
+ + +
+

{{ _('Required Documents') }}

+

+ {{ _('Please upload the following documents in PDF or image format (max 2MB each)') }} +

+ +
+
+ + +

{{ _('Clear copy of birth certificate') }}

+
+ +
+ + +

{{ _('Most recent report cards or transcripts') }}

+
+ +
+ + +

{{ _('From a teacher or principal (optional but recommended)') }}

+
+ +
+ + +

{{ _('Recent color photo') }}

+
+
+
+ + +
+
+ + +
+ +
+ + + {{ _('Cancel and Return') }} + +
+
+
+
+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/admissions/view_application.html b/templates/admissions/view_application.html new file mode 100644 index 0000000000000000000000000000000000000000..f08e8a756d66743596241c0510151f2e8f315a19 --- /dev/null +++ b/templates/admissions/view_application.html @@ -0,0 +1,147 @@ +{% extends "base.html" %} + +{% block content %} +
+
+
+
+
+

{{ _('Application Review') }}

+

{{ _('Application ID') }}: {{ application.id }}

+
+
+ + {{ application.status|capitalize }} + + {{ _('Submitted on') }} {{ application.submission_date }} +
+
+ + +
+ +
+

{{ _('Student Information') }}

+
+

{{ _('Full Name') }}: {{ application.first_name }} {{ application.last_name }}

+

{{ _('Date of Birth') }}: {{ application.birthdate }}

+

{{ _('Gender') }}: {{ application.gender|capitalize }}

+

{{ _('Nationality') }}: {{ application.nationality }}

+

{{ _('Current School') }}: {{ application.current_school }}

+

{{ _('Applying for Grade') }}: {{ application.applying_grade|replace('form', 'Form ') }}

+

{{ _('Medical Conditions') }}: {{ application.medical_conditions or 'None reported' }}

+
+
+ + +
+

{{ _('Parent/Guardian Information') }}

+
+

{{ _('Name') }}: {{ application.parent_name }}

+

{{ _('Email') }}: {{ application.parent_email }}

+

{{ _('Phone') }}: {{ application.parent_phone }}

+

{{ _('Address') }}: {{ application.address }}

+

{{ _('Emergency Contact') }}: {{ application.emergency_contact }}

+
+
+ + +
+

{{ _('Academic Information') }}

+
+

{{ _('Previous Schools') }}:

+

{{ application.previous_schools }}

+ +

{{ _('Extracurricular Interests') }}:

+

{{ application.extracurriculars or 'None reported' }}

+ +

{{ _('Why Join Munishi') }}:

+

{{ application.why_join }}

+
+
+ + +
+

{{ _('Submitted Documents') }}

+
+ {% if application.birth_certificate %} +
+

{{ _('Birth Certificate') }}

+ + {{ _('View Document') }} + +
+ {% endif %} + + {% if application.academic_records %} +
+

{{ _('Academic Records') }}

+ + {{ _('View Document') }} + +
+ {% endif %} + + {% if application.recommendation_letter %} +
+

{{ _('Recommendation Letter') }}

+ + {{ _('View Document') }} + +
+ {% endif %} + + {% if application.photo %} +
+

{{ _('Student Photo') }}

+ + {{ _('View Photo') }} + +
+ {% endif %} +
+
+
+ + +
+

{{ _('Admissions Committee') }}

+
+ + + + +
+ +
+ + +
+ +
+ + +
+
+
+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000000000000000000000000000000000000..1fb0e0f25258dfe36c7cf273783ba078abc3e0c8 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,338 @@ + + + + + + {% block title %}{{ school_name }} | {% block subtitle %}Excellence in Education{% endblock %}{% endblock %} + + + + + + + + + {% block extra_css %}{% endblock %} + + + +
+
+ EN + SW +
+
+ + +
+ + + + +
+ + +
+ {% with messages = get_flashed_messages(with_categories=true) %} + {% if messages %} +
+ {% for category, message in messages %} +
+
+ + {{ message }} +
+ +
+ {% endfor %} +
+ {% endif %} + {% endwith %} + + {% block content %}{% endblock %} +
+ + + + + + + + + + + {% block extra_js %}{% endblock %} + + \ No newline at end of file diff --git a/templates/contact.html b/templates/contact.html new file mode 100644 index 0000000000000000000000000000000000000000..a9fd1772b882c7f4bc16fb7ff1e96eaa298d8a2d --- /dev/null +++ b/templates/contact.html @@ -0,0 +1,104 @@ +{% extends "base.html" %} + +{% block content %} + +
+
+

{{ _('Contact Us') }}

+

{{ _('We would love to hear from you. Reach out to us with any questions or inquiries.') }}

+
+
+ + +
+
+
+ +
+

{{ _('Send Us a Message') }}

+
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+
+ + +
+

{{ _('Get In Touch') }}

+ +
+ +
+

{{ _('Main Campus') }}

+
+ +

{{ address }}

+
+
+
+ +
+
+
+ + +
+

{{ _('Contact Departments') }}

+
+ {% for department in departments %} +
+
+

{{ department.name }}

+

{{ department.email }}

+
+ + + +
+ {% endfor %} +
+
+ + +
+

{{ _('Office Hours') }}

+
    +
  • + {{ _('Weekdays') }}: + {{ office_hours.weekdays }} +
  • +
  • + {{ _('Saturday') }}: + {{ office_hours.saturday }} +
  • +
  • + {{ _('Sunday') }}: + {{ office_hours.sunday }} +
  • +
+
+
+
+
+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/contact_success.html b/templates/contact_success.html new file mode 100644 index 0000000000000000000000000000000000000000..17312eb242d9b3eeec4ca5f22a52533cddcb81d0 --- /dev/null +++ b/templates/contact_success.html @@ -0,0 +1,17 @@ +{% extends "base.html" %} + +{% block content %} +
+
+
+ +
+

{{ _('Thank You!') }}

+

{{ _('Your message has been successfully sent.') }}

+

{{ _('We will get back to you as soon as possible.') }}

+ + {{ _('Return to Homepage') }} + +
+
+{% endblock %} \ No newline at end of file diff --git a/templates/events.html b/templates/events.html new file mode 100644 index 0000000000000000000000000000000000000000..70f4d75c0c4f3f2c738b602ed2fe0d41ba1b0ded --- /dev/null +++ b/templates/events.html @@ -0,0 +1,345 @@ +{% extends "base.html" %} + +{% block content %} + +
+
+

{{ _('Events Calendar') }}

+

{{ _('Discover upcoming activities, celebrations, and important dates at Munishi School') }}

+
+
+ + +
+
+
+
+
+

{{ _('Filter Events') }}

+
+
+ + + + + +
+
+
+
+
+ + +
+
+
+

{{ _('School Events Calendar') }}

+
+ + October 2023 + +
+
+ +
+
+
{{ _('Sun') }}
+
{{ _('Mon') }}
+
{{ _('Tue') }}
+
{{ _('Wed') }}
+
{{ _('Thu') }}
+
{{ _('Fri') }}
+
{{ _('Sat') }}
+ + +
+
+
+
+ + +
+
1
+
+
+
2
+
+
+
3
+
+ + +
+
4
+
+ +
+
+
5
+
+
+
+
6
+
+
+
7
+
+
+
8
+
+
+
9
+
+
+
10
+
+
+
11
+
+
+
12
+
+
+
+
13
+
+
+
14
+
+
+
15
+
+
+
16
+
+
+
17
+
+
+
18
+
+
+
19
+
+
+
20
+
+
+
+
21
+
+
+
22
+
+
+
+
23
+
+
+
+
24
+
+
+
25
+
+
+
26
+
+
+
27
+
+
+
28
+
+
+
29
+
+
+
30
+
+
+
31
+
+
+
+
+
+ + +
+
+
+

{{ _('Upcoming Events') }}

+
+ +
+
+ +
+ {% for event in events %} +
+
+
+ +
+
+ {{ event.category }} +
+
+ {{ event.time }} +
+
+
+

{{ event.title }}

+
+ + {{ event.date|format_date('full') }} + + {{ event.location }} +
+

{{ event.description }}

+
+ {% for tag in event.tags %} + + {{ tag }} + + {% endfor %} +
+ {{ _('View Details') }} +
+
+ {% endfor %} +
+ + +
+
+ + +
+
+

{{ _('Past Events') }}

+

+ {{ _('Relive memorable moments from our school community') }} +

+ +
+
+ {% for event in past_events %} +
+
+
+ +
+
+
+

{{ event.title }}

+
+ + {{ event.date|format_date('medium') }} +
+

{{ event.description|truncate(120) }}

+ {{ _('See Photos') }} +
+
+ {% endfor %} +
+ + +
+
+
+ + +
+
+

{{ _('Annual Events') }}

+

+ {{ _('Traditions that bring our community together year after year') }} +

+ +
+
+
+
+ +
+

{{ _('Graduation Ceremony') }}

+

{{ _('Celebrating our graduating students and their achievements') }}

+
+ {{ _('Every November') }} +
+
+ +
+
+ +
+

{{ _('Sports Day') }}

+

{{ _('Annual inter-house sports competition with athletic events') }}

+
+ {{ _('Every March') }} +
+
+ +
+
+ +
+

{{ _('Science Fair') }}

+

{{ _('Showcasing student innovations and scientific projects') }}

+
+ {{ _('Every July') }} +
+
+ +
+
+ +
+

{{ _('Cultural Festival') }}

+

{{ _('Celebrating Tanzania\'s diverse cultural heritage') }}

+
+ {{ _('Every September') }} +
+
+
+
+
+
+ + +
+
+
+

{{ _('Host an Event at Munishi') }}

+

+ {{ _('Our facilities are available for educational, cultural, and community events') }} +

+ +
+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/home.html b/templates/home.html new file mode 100644 index 0000000000000000000000000000000000000000..6ae1ae1b80ff79fde84450c43dbf0bb4d7f1f9d0 --- /dev/null +++ b/templates/home.html @@ -0,0 +1,193 @@ +{% extends "base.html" %} + +{% block content %} + +
+
+
+
+
+
+ +
+
+

+ {{ _('Inspiring') }} {{ _('Excellence') }}, + {{ _('Nurturing') }} {{ _('Futures') }} +

+

+ {{ _('At Munishi School, we empower students to become innovative thinkers, compassionate leaders, and responsible global citizens.') }} +

+ +
+ +
+
+
+ +
+

{{ _('Academic Excellence') }}

+

{{ _('Ranked among the top schools nationally with exceptional examination results.') }}

+
+ +
+
+ +
+

{{ _('Inclusive Community') }}

+

{{ _('A diverse, welcoming environment where every student is valued and supported.') }}

+
+ +
+
+ +
+

{{ _('Innovative Learning') }}

+

{{ _('State-of-the-art facilities and modern teaching methodologies for the 21st century.') }}

+
+
+
+
+ + +
+
+
+

{{ _('Latest News') }}

+ {{ _('View All News') }} +
+ +
+ {% for item in news %} +
+
+
+ +
+
+
+ {{ item.date|format_date }} +

{{ item.title }}

+

{{ item.excerpt }}

+ {{ _('Read More') }} +
+
+ {% endfor %} +
+ +
+

{{ _('Upcoming Events') }}

+ {{ _('View All Events') }} +
+ +
+
+ {% for event in events %} +
+
+
{{ event.date|format_date('full', 'first') }}
+
{{ event.date|format_date('full', 'second') }}
+
+
+

{{ event.title }}

+

{{ event.description|truncate(100) }}

+
+ + {{ event.time or _('All Day') }} + + {{ event.location or school_name }} +
+
+
+ {% endfor %} +
+
+
+
+ + +
+
+

{{ _('What Our Community Says') }}

+ +
+
+
+
A
+
+

{{ _('Amina Juma') }}

+

{{ _('Parent') }}

+
+
+

{{ _('"The transformation in my daughter since joining Munishi has been remarkable. She\'s more confident and passionate about learning."') }}

+
+ + + + + +
+
+ +
+
+
D
+
+

{{ _('David Omondi') }}

+

{{ _('Alumni') }}

+
+
+

{{ _('"Munishi prepared me not just academically, but for life. The leadership opportunities I had shaped my career path."') }}

+
+ + + + + +
+
+ +
+
+
J
+
+

{{ _('John Mwamba') }}

+

{{ _('Student') }}

+
+
+

{{ _('"I love the balance between academics and extracurriculars. The robotics club has been life-changing for me!"') }}

+
+ + + + + +
+
+
+
+
+ + +
+
+
+

{{ _('Ready to Join the Munishi Family?') }}

+

+ {{ _('Applications for the 2024 academic year are now open. Limited spaces available.') }} +

+ +
+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/news.html b/templates/news.html new file mode 100644 index 0000000000000000000000000000000000000000..9588c8e41af6029e6a80bd81f71afe41ef5b52a1 --- /dev/null +++ b/templates/news.html @@ -0,0 +1,181 @@ +{% extends "base.html" %} + +{% block content %} + +
+
+

{{ _('News & Announcements') }}

+

{{ _('Stay updated with the latest happenings at Munishi School') }}

+
+
+ + +
+
+
+
+
+

{{ _('Filter News') }}

+
+
+ + + + + +
+
+
+
+
+ + +
+
+
+ {% for item in news %} +
+
+
+ +
+
+ {{ item.category }} +
+
+ {{ item.date|format_date }} +
+
+
+

{{ item.title }}

+

{{ item.excerpt }}

+ + {{ _('Read Full Story') }} + + +
+
+ {% endfor %} +
+
+
+ + +
+
+

{{ _('Featured Stories') }}

+ +
+
+
+
+ +
+
+
+ + {{ _('Featured') }} + +

{{ _('Munishi Students Win National Science Competition') }}

+

+ {{ _('Our Form 3 students took first place in the National Science Fair with their innovative water purification project, competing against 50 schools nationwide.') }} +

+
+ + {{ _('Achievement') }} + + + {{ _('Science') }} + + + {{ _('Competition') }} + +
+
+ + {{ _('Published: October 15, 2023') }} + + {{ _('By School Communications') }} +
+ {{ _('Read Full Story') }} +
+
+
+
+
+ + +
+ +
+ + +
+
+
+

{{ _('Stay Updated') }}

+

+ {{ _('Subscribe to our newsletter and never miss important announcements, events, or news from Munishi School') }} +

+ +
+ + +
+ +

+ {{ _('We respect your privacy. Unsubscribe at any time.') }} +

+
+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/student_life.html b/templates/student_life.html new file mode 100644 index 0000000000000000000000000000000000000000..959bec7a8edc48555d8b162bf28c7789c215a391 --- /dev/null +++ b/templates/student_life.html @@ -0,0 +1,335 @@ +{% extends "base.html" %} + +{% block content %} + +
+
+

{{ _('Student Life') }}

+

{{ _('Beyond academics: Discover a vibrant community of activities, clubs, and opportunities') }}

+
+
+ + +
+
+
+

{{ _('Clubs & Societies') }}

+ {{ _('View All Clubs') }} +
+ +
+ {% for club in clubs %} +
+
+
+ +
+
+ {{ club.category }} +
+
+
+

{{ club.name }}

+

{{ club.description }}

+
+
+ + {{ club.members }} {{ _('members') }} +
+ {{ _('Learn More') }} +
+
+
+ {% endfor %} +
+
+
+ + +
+
+
+

{{ _('Sports & Athletics') }}

+ {{ _('View All Sports') }} +
+ +
+
+

{{ _('Competitive Sports') }}

+
+ {% for sport in sports.competitive %} +
+
+ +
+ {{ sport.name }} +
+ {% endfor %} +
+
+ +
+

{{ _('Recreational Activities') }}

+
+ {% for activity in sports.recreational %} +
+
+ +
+ {{ activity.name }} +
+ {% endfor %} +
+
+
+ +
+

{{ _('Sports Achievements') }}

+ +
+ {% for achievement in sports.achievements %} +
+
+ +
+

{{ achievement.title }}

+

{{ achievement.description }}

+
+ {{ achievement.date }} +
+
+ {% endfor %} +
+
+
+
+ + +
+
+

{{ _('Arts & Culture') }}

+ +
+
+

{{ _('Performing Arts') }}

+
+ {% for art in arts.performing %} +
+
+ +
+
+

{{ art.name }}

+

{{ art.description }}

+ {% if art.upcoming %} +
+ {{ art.upcoming }} +
+ {% endif %} +
+
+ {% endfor %} +
+
+ +
+

{{ _('Visual Arts') }}

+
+ {% for art in arts.visual %} +
+
+ +
+
+

{{ art.name }}

+

{{ art.description }}

+ {% if art.exhibition %} +
+ {{ art.exhibition }} +
+ {% endif %} +
+
+ {% endfor %} +
+
+
+ +
+
+
+
+
{{ _('Gallery') }}
+
{{ _('Student Works') }}
+
+
+
+

{{ _('Annual Art Exhibition') }}

+

+ {{ _('Join us for the opening of our student art exhibition showcasing the creative talents of our visual arts students. Featuring paintings, sculptures, digital art, and photography.') }} +

+
+ + {{ _('October 15-30, 2023') }} + + {{ _('School Art Gallery') }} +
+ {{ _('View Gallery Online') }} +
+
+
+
+
+ + +
+
+

{{ _('Leadership & Service') }}

+ +
+
+
+ +
+

{{ _('Community Service') }}

+

+ {{ _('Students contribute over 5,000 service hours annually to local community projects') }} +

+ {{ _('Join a Project') }} +
+ +
+
+ +
+

{{ _('Student Council') }}

+

+ {{ _('Elected student leaders who represent the student body and organize school events') }} +

+ {{ _('Meet the Council') }} +
+ +
+
+ +
+

{{ _('Global Initiatives') }}

+

+ {{ _('International partnerships, Model UN, and global awareness campaigns') }} +

+ {{ _('Explore Programs') }} +
+
+ +
+

{{ _('Upcoming Events') }}

+ +
+ {% for event in activities %} +
+
+ + {{ event.category }} + + {{ event.date|format_date }} +
+

{{ event.title }}

+

{{ event.description }}

+
+ + {{ event.time }} + + {{ event.location }} +
+
+ {% endfor %} +
+ + +
+
+
+ + +
+
+

{{ _('Student Voices') }}

+ +
+
+

{{ _('Blog Highlights') }}

+ +
+ {% for blog in blogs %} +
+

{{ blog.title }}

+
+ {{ _('By') }} {{ blog.author }} + • + {{ blog.date|format_date }} +
+

{{ blog.excerpt }}

+ {{ _('Read Full Post') }} +
+ {% endfor %} +
+ + {{ _('Visit Student Blog') }} +
+ +
+

{{ _('Photo Gallery') }}

+ +
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+ + +
+
+
+
+ + +
+
+
+

{{ _('Get Involved in Student Life') }}

+

+ {{ _('Join a club, try out for a team, or start your own initiative. There\'s something for everyone!') }} +

+ +
+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/style.css b/templates/style.css new file mode 100644 index 0000000000000000000000000000000000000000..a8006318388398f1ef203cd5793159dfb1311434 --- /dev/null +++ b/templates/style.css @@ -0,0 +1,265 @@ +/* static/css/style.css */ +:root { + --primary: #1a4d8c; + --secondary: #f9a826; + --accent: #e74c3c; + --light: #f8f9fa; + --dark: #343a40; +} + +body { + font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + color: #333; + line-height: 1.6; +} + +/* Accessibility enhancements */ +a:focus, button:focus { + outline: 3px solid var(--secondary); + outline-offset: 2px; +} + +.skip-link { + position: absolute; + top: -40px; + left: 0; + background: var(--primary); + color: white; + padding: 8px; + z-index: 100; +} + +.skip-link:focus { + top: 0; +} + +/* Header */ +.navbar-brand img { + max-height: 70px; +} + +.navbar .nav-link { + font-weight: 500; + padding: 0.5rem 1rem; + transition: all 0.3s; + position: relative; +} + +.navbar .nav-link:hover { + color: var(--primary); +} + +.navbar .nav-link:after { + content: ''; + position: absolute; + width: 0; + height: 2px; + bottom: 0; + left: 0; + background-color: var(--secondary); + transition: width 0.3s; +} + +.navbar .nav-link:hover:after, +.navbar .nav-link.active:after { + width: 100%; +} + +/* Hero Section */ +.hero { + background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../images/hero-bg.jpg') center/cover no-repeat; + color: white; + padding: 100px 0; + text-align: center; +} + +.hero h1 { + font-weight: 700; + font-size: 3rem; + text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); +} + +.hero p { + font-size: 1.2rem; + max-width: 700px; + margin: 20px auto; +} + +/* Cards */ +.card { + border: none; + border-radius: 10px; + overflow: hidden; + box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); + transition: transform 0.3s, box-shadow 0.3s; + height: 100%; +} + +.card:hover { + transform: translateY(-10px); + box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15); +} + +.card-img-top { + height: 200px; + object-fit: cover; +} + +.card-title { + color: var(--primary); + font-weight: 700; +} + +/* News section */ +.news-card .date { + color: var(--secondary); + font-weight: 600; +} + +/* Buttons */ +.btn-primary { + background-color: var(--primary); + border-color: var(--primary); +} + +.btn-primary:hover { + background-color: #0d3a6e; + border-color: #0d3a6e; +} + +.btn-secondary { + background-color: var(--secondary); + border-color: var(--secondary); + color: #fff; +} + +.btn-secondary:hover { + background-color: #e59400; + border-color: #e59400; +} + +/* Section titles */ +.section-title { + position: relative; + margin-bottom: 40px; + text-align: center; +} + +.section-title:after { + content: ''; + display: block; + width: 80px; + height: 4px; + background: var(--secondary); + margin: 15px auto 0; +} + +/* Testimonials */ +.testimonial { + background: var(--light); + padding: 30px; + border-radius: 10px; + position: relative; +} + +.testimonial:after { + content: '"'; + position: absolute; + top: 20px; + left: 20px; + font-size: 5rem; + color: rgba(0, 0, 0, 0.05); + font-family: Georgia, serif; +} + +.testimonial .author { + font-weight: 600; + color: var(--primary); + margin-top: 20px; +} + +/* Footer */ +footer { + background: linear-gradient(to right, #0a3a6d, #1a4d8c); +} + +footer h5 { + position: relative; + padding-bottom: 15px; +} + +footer h5:after { + content: ''; + position: absolute; + left: 0; + bottom: 0; + width: 50px; + height: 2px; + background: var(--secondary); +} + +footer a { + color: #ddd; + text-decoration: none; + transition: color 0.3s; +} + +footer a:hover { + color: var(--secondary); +} + +.social-links a { + display: inline-block; + width: 40px; + height: 40px; + background: rgba(255, 255, 255, 0.1); + border-radius: 50%; + text-align: center; + line-height: 40px; + transition: all 0.3s; +} + +.social-links a:hover { + background: var(--secondary); + transform: translateY(-5px); +} + +/* WhatsApp Button */ +.whatsapp-button { + position: fixed; + bottom: 30px; + right: 30px; + width: 60px; + height: 60px; + background: #25d366; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + color: white; + font-size: 2rem; + box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); + z-index: 1000; + transition: all 0.3s; +} + +.whatsapp-button:hover { + transform: scale(1.1); + box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3); + color: white; +} + +/* Responsive adjustments */ +@media (max-width: 768px) { + .hero { + padding: 60px 0; + } + + .hero h1 { + font-size: 2.2rem; + } + + .navbar-brand img { + max-height: 50px; + } +} \ No newline at end of file diff --git a/templates/test_downloads.html b/templates/test_downloads.html new file mode 100644 index 0000000000000000000000000000000000000000..002a3845db9c8ed0832c7cbb53b93eeb56b96478 --- /dev/null +++ b/templates/test_downloads.html @@ -0,0 +1,17 @@ +{% extends "base.html" %} + +{% block content %} +
+

Available Download Files

+
    + {% for file in files %} +
  • {{ file }}
  • + {% else %} +
  • No files found in downloads directory
  • + {% endfor %} +
+

+ Path: {{ base_path }} +

+
+{% endblock %} \ No newline at end of file diff --git a/translations/en/LC_MESSAGES/messages.po b/translations/en/LC_MESSAGES/messages.po new file mode 100644 index 0000000000000000000000000000000000000000..643fa25cb59cfc1cc6140d42ff21cfddbe444375 --- /dev/null +++ b/translations/en/LC_MESSAGES/messages.po @@ -0,0 +1,35 @@ +msgid "" +msgstr "" +"Project-Id-Version: Munishi School Website\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "Home" +msgstr "Home" + +msgid "About Us" +msgstr "About Us" + +msgid "Admissions" +msgstr "Admissions" + +msgid "Academics" +msgstr "Academics" + +msgid "Student Life" +msgstr "Student Life" + +msgid "News & Events" +msgstr "News & Events" + +msgid "Contact" +msgstr "Contact" + +msgid "Welcome to" +msgstr "Welcome to" + +msgid "Providing quality education since 1975" +msgstr "Providing quality education since 1975" + +msgid "Learn About Admissions" +msgstr "Learn About Admissions" \ No newline at end of file diff --git a/translations/sw/LC_MESSAGES/messages.po b/translations/sw/LC_MESSAGES/messages.po new file mode 100644 index 0000000000000000000000000000000000000000..ad7c1464d6b44b2b7db1afa71cf324303aee01a3 --- /dev/null +++ b/translations/sw/LC_MESSAGES/messages.po @@ -0,0 +1,35 @@ +msgid "" +msgstr "" +"Project-Id-Version: Munishi School Website\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "Home" +msgstr "Nyumbani" + +msgid "About Us" +msgstr "Kuhusu Sisi" + +msgid "Admissions" +msgstr "Uandikishaji" + +msgid "Academics" +msgstr "Masomo" + +msgid "Student Life" +msgstr "Maisha ya Wanafunzi" + +msgid "News & Events" +msgstr "Habari na Matukio" + +msgid "Contact" +msgstr "Mawasiliano" + +msgid "Welcome to" +msgstr "Karibu" + +msgid "Providing quality education since 1975" +msgstr "Kutoa elimu bora tangu 1975" + +msgid "Learn About Admissions" +msgstr "Jifunze Kuhusu Uandikishaji" \ No newline at end of file diff --git a/venv/.gitignore b/venv/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..49b53dcfd66bcbbee1f9f854a995842a8263d3d3 --- /dev/null +++ b/venv/.gitignore @@ -0,0 +1,2 @@ +# Created by venv; see https://docs.python.org/3/library/venv.html +* diff --git a/venv/Lib/site-packages/Flask_Babel-2.0.0.dist-info/INSTALLER b/venv/Lib/site-packages/Flask_Babel-2.0.0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/venv/Lib/site-packages/Flask_Babel-2.0.0.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/venv/Lib/site-packages/Flask_Babel-2.0.0.dist-info/LICENSE b/venv/Lib/site-packages/Flask_Babel-2.0.0.dist-info/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..562f7eb602f1966cfa4276aaf8d5956959091acc --- /dev/null +++ b/venv/Lib/site-packages/Flask_Babel-2.0.0.dist-info/LICENSE @@ -0,0 +1,31 @@ +Copyright (c) 2010 by Armin Ronacher. + +Some rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + +* The names of the contributors may not be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/venv/Lib/site-packages/Flask_Babel-2.0.0.dist-info/METADATA b/venv/Lib/site-packages/Flask_Babel-2.0.0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..b84866141d8b00e5953df3819fc708e46c277efe --- /dev/null +++ b/venv/Lib/site-packages/Flask_Babel-2.0.0.dist-info/METADATA @@ -0,0 +1,57 @@ +Metadata-Version: 2.1 +Name: Flask-Babel +Version: 2.0.0 +Summary: Adds i18n/l10n support to Flask applications +Home-page: http://github.com/python-babel/flask-babel +Author: Armin Ronacher +Author-email: armin.ronacher@active-4.com +Maintainer: Tyler Kennedy +Maintainer-email: tk@tkte.ch +License: BSD +Platform: UNKNOWN +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Web Environment +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Description-Content-Type: text/markdown +Requires-Dist: pytz +Requires-Dist: Flask +Requires-Dist: Babel (>=2.3) +Requires-Dist: Jinja2 (>=2.5) +Provides-Extra: dev +Requires-Dist: pytest ; extra == 'dev' +Requires-Dist: pytest-mock ; extra == 'dev' +Requires-Dist: bumpversion ; extra == 'dev' +Requires-Dist: ghp-import ; extra == 'dev' +Requires-Dist: sphinx ; extra == 'dev' +Requires-Dist: Pallets-Sphinx-Themes ; extra == 'dev' + +# Flask Babel + +![Tests](https://github.com/python-babel/flask-babel/workflows/Tests/badge.svg?branch=master) +[![PyPI](https://img.shields.io/pypi/v/flask-babel.svg?maxAge=2592000)](https://pypi.python.org/pypi/Flask-Babel) + +Implements i18n and l10n support for Flask. This is based on the Python +[babel][] module as well as [pytz][] both of which are installed automatically +for you if you install this library. + +# Documention + +The latest documentation is available [here][docs]. + +[babel]: https://github.com/python-babel/babel +[pytz]: https://pypi.python.org/pypi/pytz/ +[docs]: https://flask-babel.tkte.ch/ +[semver]: https://semver.org/ + + diff --git a/venv/Lib/site-packages/Flask_Babel-2.0.0.dist-info/RECORD b/venv/Lib/site-packages/Flask_Babel-2.0.0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..a1e86a756f34bed4fe365e4cdb47fa4ed3104596 --- /dev/null +++ b/venv/Lib/site-packages/Flask_Babel-2.0.0.dist-info/RECORD @@ -0,0 +1,11 @@ +Flask_Babel-2.0.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +Flask_Babel-2.0.0.dist-info/LICENSE,sha256=pSYQCnBHI3Ngo5S6T3CugBtQ_5uMm55z53lUgKWfa34,1457 +Flask_Babel-2.0.0.dist-info/METADATA,sha256=PAc5Px_xpOvXOxW8pLJ7Hr5BlDu8sEECZZkGTXShwRo,2145 +Flask_Babel-2.0.0.dist-info/RECORD,, +Flask_Babel-2.0.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +Flask_Babel-2.0.0.dist-info/WHEEL,sha256=EVRjI69F5qVjm_YgqcTXPnTAv3BfSUr0WVAHuSP3Xoo,92 +Flask_Babel-2.0.0.dist-info/top_level.txt,sha256=2CI1eTvkPSxyDsmIAjCSzvyC9vye6AnqevE4ByOoGpg,12 +flask_babel/__init__.py,sha256=pVPkON7P5p2JBIUJwkZb1uaGvrT81hlaf-MkcwTn88c,24625 +flask_babel/__pycache__/__init__.cpython-313.pyc,, +flask_babel/__pycache__/speaklater.cpython-313.pyc,, +flask_babel/speaklater.py,sha256=moGrHeg_M-c5sqUdmudwnKZ55-FH-Uh4iktpjiHGSpo,1669 diff --git a/venv/Lib/site-packages/Flask_Babel-2.0.0.dist-info/REQUESTED b/venv/Lib/site-packages/Flask_Babel-2.0.0.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/venv/Lib/site-packages/Flask_Babel-2.0.0.dist-info/WHEEL b/venv/Lib/site-packages/Flask_Babel-2.0.0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..83ff02e961fce5ad7befce746ff02635e1616315 --- /dev/null +++ b/venv/Lib/site-packages/Flask_Babel-2.0.0.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.35.1) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/venv/Lib/site-packages/Flask_Babel-2.0.0.dist-info/top_level.txt b/venv/Lib/site-packages/Flask_Babel-2.0.0.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..1f96fff9eaa0f8a6c933025c9a2da4a576a6ced3 --- /dev/null +++ b/venv/Lib/site-packages/Flask_Babel-2.0.0.dist-info/top_level.txt @@ -0,0 +1 @@ +flask_babel diff --git a/venv/Lib/site-packages/MarkupSafe-3.0.2.dist-info/INSTALLER b/venv/Lib/site-packages/MarkupSafe-3.0.2.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/venv/Lib/site-packages/MarkupSafe-3.0.2.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/venv/Lib/site-packages/MarkupSafe-3.0.2.dist-info/LICENSE.txt b/venv/Lib/site-packages/MarkupSafe-3.0.2.dist-info/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..c4700f975c9f76ccf9dec953157a92c549f450cc --- /dev/null +++ b/venv/Lib/site-packages/MarkupSafe-3.0.2.dist-info/LICENSE.txt @@ -0,0 +1,28 @@ +Copyright 2010 Pallets + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/venv/Lib/site-packages/MarkupSafe-3.0.2.dist-info/METADATA b/venv/Lib/site-packages/MarkupSafe-3.0.2.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..0b762b7b6892bb4f83b6e503633fbd249a43b3cb --- /dev/null +++ b/venv/Lib/site-packages/MarkupSafe-3.0.2.dist-info/METADATA @@ -0,0 +1,92 @@ +Metadata-Version: 2.1 +Name: MarkupSafe +Version: 3.0.2 +Summary: Safely add untrusted strings to HTML/XML markup. +Maintainer-email: Pallets +License: Copyright 2010 Pallets + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Project-URL: Donate, https://palletsprojects.com/donate +Project-URL: Documentation, https://markupsafe.palletsprojects.com/ +Project-URL: Changes, https://markupsafe.palletsprojects.com/changes/ +Project-URL: Source, https://github.com/pallets/markupsafe/ +Project-URL: Chat, https://discord.gg/pallets +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Web Environment +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content +Classifier: Topic :: Text Processing :: Markup :: HTML +Classifier: Typing :: Typed +Requires-Python: >=3.9 +Description-Content-Type: text/markdown +License-File: LICENSE.txt + +# MarkupSafe + +MarkupSafe implements a text object that escapes characters so it is +safe to use in HTML and XML. Characters that have special meanings are +replaced so that they display as the actual characters. This mitigates +injection attacks, meaning untrusted user input can safely be displayed +on a page. + + +## Examples + +```pycon +>>> from markupsafe import Markup, escape + +>>> # escape replaces special characters and wraps in Markup +>>> escape("") +Markup('<script>alert(document.cookie);</script>') + +>>> # wrap in Markup to mark text "safe" and prevent escaping +>>> Markup("Hello") +Markup('hello') + +>>> escape(Markup("Hello")) +Markup('hello') + +>>> # Markup is a str subclass +>>> # methods and operators escape their arguments +>>> template = Markup("Hello {name}") +>>> template.format(name='"World"') +Markup('Hello "World"') +``` + +## Donate + +The Pallets organization develops and supports MarkupSafe and other +popular packages. In order to grow the community of contributors and +users, and allow the maintainers to devote more time to the projects, +[please donate today][]. + +[please donate today]: https://palletsprojects.com/donate diff --git a/venv/Lib/site-packages/MarkupSafe-3.0.2.dist-info/RECORD b/venv/Lib/site-packages/MarkupSafe-3.0.2.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..4ddfeecf2c30f628f2c40bba5a8e042a495f5e69 --- /dev/null +++ b/venv/Lib/site-packages/MarkupSafe-3.0.2.dist-info/RECORD @@ -0,0 +1,14 @@ +MarkupSafe-3.0.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +MarkupSafe-3.0.2.dist-info/LICENSE.txt,sha256=RjHsDbX9kKVH4zaBcmTGeYIUM4FG-KyUtKV_lu6MnsQ,1503 +MarkupSafe-3.0.2.dist-info/METADATA,sha256=nhoabjupBG41j_JxPCJ3ylgrZ6Fx8oMCFbiLF9Kafqc,4067 +MarkupSafe-3.0.2.dist-info/RECORD,, +MarkupSafe-3.0.2.dist-info/WHEEL,sha256=-v_yZ08fSknsoT62oIKG9wp1eCBV9_ao2rO4BeIReTY,101 +MarkupSafe-3.0.2.dist-info/top_level.txt,sha256=qy0Plje5IJuvsCBjejJyhDCjEAdcDLK_2agVcex8Z6U,11 +markupsafe/__init__.py,sha256=pREerPwvinB62tNCMOwqxBS2YHV6R52Wcq1d-rB4Z5o,13609 +markupsafe/__pycache__/__init__.cpython-313.pyc,, +markupsafe/__pycache__/_native.cpython-313.pyc,, +markupsafe/_native.py,sha256=2ptkJ40yCcp9kq3L1NqpgjfpZB-obniYKFFKUOkHh4Q,218 +markupsafe/_speedups.c,sha256=SglUjn40ti9YgQAO--OgkSyv9tXq9vvaHyVhQows4Ok,4353 +markupsafe/_speedups.cp313-win_amd64.pyd,sha256=7MA12j0aUiSeNpFy-98h_pPSqgCpLeRacgp3I-j00Yo,13312 +markupsafe/_speedups.pyi,sha256=LSDmXYOefH4HVpAXuL8sl7AttLw0oXh1njVoVZp2wqQ,42 +markupsafe/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 diff --git a/venv/Lib/site-packages/MarkupSafe-3.0.2.dist-info/WHEEL b/venv/Lib/site-packages/MarkupSafe-3.0.2.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..8f7c5e9283f1b64787bfa7f3968c53f699d7f933 --- /dev/null +++ b/venv/Lib/site-packages/MarkupSafe-3.0.2.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: setuptools (75.2.0) +Root-Is-Purelib: false +Tag: cp313-cp313-win_amd64 + diff --git a/venv/Lib/site-packages/MarkupSafe-3.0.2.dist-info/top_level.txt b/venv/Lib/site-packages/MarkupSafe-3.0.2.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..75bf729258f9daef77370b6df1a57940f90fc23f --- /dev/null +++ b/venv/Lib/site-packages/MarkupSafe-3.0.2.dist-info/top_level.txt @@ -0,0 +1 @@ +markupsafe diff --git a/venv/Lib/site-packages/babel-2.17.0.dist-info/INSTALLER b/venv/Lib/site-packages/babel-2.17.0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/venv/Lib/site-packages/babel-2.17.0.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/venv/Lib/site-packages/babel-2.17.0.dist-info/LICENSE b/venv/Lib/site-packages/babel-2.17.0.dist-info/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..6ddae98eb657f0b21ae58bbb16aafd323c91ff0f --- /dev/null +++ b/venv/Lib/site-packages/babel-2.17.0.dist-info/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2013-2025 by the Babel Team, see AUTHORS for more information. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/venv/Lib/site-packages/babel-2.17.0.dist-info/METADATA b/venv/Lib/site-packages/babel-2.17.0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..8cdc84622292aafd05645f2075af2631a7698f2a --- /dev/null +++ b/venv/Lib/site-packages/babel-2.17.0.dist-info/METADATA @@ -0,0 +1,54 @@ +Metadata-Version: 2.2 +Name: babel +Version: 2.17.0 +Summary: Internationalization utilities +Home-page: https://babel.pocoo.org/ +Author: Armin Ronacher +Author-email: armin.ronacher@active-4.com +Maintainer: Aarni Koskela +Maintainer-email: akx@iki.fi +License: BSD-3-Clause +Project-URL: Source, https://github.com/python-babel/babel +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Web Environment +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Requires-Python: >=3.8 +License-File: LICENSE +Requires-Dist: pytz>=2015.7; python_version < "3.9" +Provides-Extra: dev +Requires-Dist: tzdata; sys_platform == "win32" and extra == "dev" +Requires-Dist: backports.zoneinfo; python_version < "3.9" and extra == "dev" +Requires-Dist: freezegun~=1.0; extra == "dev" +Requires-Dist: jinja2>=3.0; extra == "dev" +Requires-Dist: pytest-cov; extra == "dev" +Requires-Dist: pytest>=6.0; extra == "dev" +Requires-Dist: pytz; extra == "dev" +Requires-Dist: setuptools; extra == "dev" +Dynamic: author +Dynamic: author-email +Dynamic: classifier +Dynamic: description +Dynamic: home-page +Dynamic: license +Dynamic: maintainer +Dynamic: maintainer-email +Dynamic: project-url +Dynamic: provides-extra +Dynamic: requires-dist +Dynamic: requires-python +Dynamic: summary + +A collection of tools for internationalizing Python applications. diff --git a/venv/Lib/site-packages/babel-2.17.0.dist-info/RECORD b/venv/Lib/site-packages/babel-2.17.0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..3f3c2e00165dba50f89ae491a952d99a4f2e3a00 --- /dev/null +++ b/venv/Lib/site-packages/babel-2.17.0.dist-info/RECORD @@ -0,0 +1,1132 @@ +../../Scripts/pybabel.exe,sha256=uaSjgd5qStuInMfYtGKfAP0qKAnCikpF-lLEcTAJTTw,108410 +babel-2.17.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +babel-2.17.0.dist-info/LICENSE,sha256=eAGoT-gRJ5yzUL20-xj5TDaxjvgT-mqsBDtsbTlITQ0,1531 +babel-2.17.0.dist-info/METADATA,sha256=xbADd4FX7x9g3Jol93V9dBRbALmMLlTVcQCDcl12nnw,2032 +babel-2.17.0.dist-info/RECORD,, +babel-2.17.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91 +babel-2.17.0.dist-info/entry_points.txt,sha256=Y2Cr1P3E8Yt7kqzvVz4wnTvD1H3-BVD4FOkVqHIGBfc,750 +babel-2.17.0.dist-info/top_level.txt,sha256=mQO3vNkqlcYs_xRaL5EpRIy1IRjMp4N9_vdwmiemPXo,6 +babel/__init__.py,sha256=Ow3KHphrtw4WSFK-FzacGR8JVX5JQZ1YCdfJKD8UYS0,882 +babel/__pycache__/__init__.cpython-313.pyc,, +babel/__pycache__/core.cpython-313.pyc,, +babel/__pycache__/dates.cpython-313.pyc,, +babel/__pycache__/languages.cpython-313.pyc,, +babel/__pycache__/lists.cpython-313.pyc,, +babel/__pycache__/localedata.cpython-313.pyc,, +babel/__pycache__/numbers.cpython-313.pyc,, +babel/__pycache__/plural.cpython-313.pyc,, +babel/__pycache__/support.cpython-313.pyc,, +babel/__pycache__/units.cpython-313.pyc,, +babel/__pycache__/util.cpython-313.pyc,, +babel/core.py,sha256=QbuWyWBg4RJlYQ5Avg-ci71j4ZQ07VUGhhVxdI9y-Qo,45371 +babel/dates.py,sha256=fJCaifpved33Rf5T1thxxPG6d3MmPU99wnIO2RAA-mc,76378 +babel/global.dat,sha256=wRYHp_nSwZk6S1S0kn3g20zHAYm2vr7ThmvV7uqDqgM,459316 +babel/languages.py,sha256=2LDTV9WizAuZVam0vfw-Q-QKYCQpF5DxLbmVoat7TKI,2844 +babel/lists.py,sha256=Y4m1gScEDZlHAweDb-H5J6bEhlzTFmhKCWywS2h6V8M,4361 +babel/locale-data/LICENSE.unicode,sha256=tMCujvBPcFn5bOW74EZ_n-b22Bu-E1F3Ad_rlh-00LY,2033 +babel/locale-data/aa.dat,sha256=CI5kOVaXWX2CQoHT6AXhrOMwFPCiQyd7Wke2QBJ1UtE,2795 +babel/locale-data/aa_DJ.dat,sha256=VKjSgKVsftG91nj0-AQMYFuF_p4YAGfRkgAvycB2EYU,1112 +babel/locale-data/aa_ER.dat,sha256=6b6qROwoeOq0-batM1Z7Ji2gvGDogl3ODcftt1Jkm9g,637 +babel/locale-data/aa_ET.dat,sha256=piwFu94H7e-jPwd4ZaWiDc-j2nAH_GiC5UZ2IxMx7bs,635 +babel/locale-data/ab.dat,sha256=xeio1NLBNIAXcafnonWjO3w0zofwM-aKr0-RiaL7pRQ,95311 +babel/locale-data/ab_GE.dat,sha256=b5be2Uv1YtP-bkMasJMzoQPxJPNLFqifXnCiK8rCyLE,635 +babel/locale-data/af.dat,sha256=pO9_3BpJSQAJ3gZ_j6ZdUpGq3zqEv6CIZZ-CpJTXwr4,144732 +babel/locale-data/af_NA.dat,sha256=zif__TyNY44mSCYOCrrglsyr_H31JhBNPwSJftg8200,1450 +babel/locale-data/af_ZA.dat,sha256=6lT-mLg7LRtyAEhWhiF2xVtiPyzEa28U6hsFw_BMrZE,635 +babel/locale-data/agq.dat,sha256=JJbF6NFR9qwwQTrIyrLh04DFJniIqDuFsbmHDGu5ThM,16628 +babel/locale-data/agq_CM.dat,sha256=hYtg7pRw7J6TsYHvhlEEv7DqpyXoK3KS9DAqtYtgBX0,636 +babel/locale-data/ak.dat,sha256=L73y_ylhZy39SlEaAwA4jCqP_92qLvIlsagl-o2RlKE,116224 +babel/locale-data/ak_GH.dat,sha256=tM-OSpXWyBwZFfKPVStWBbFv3dwNj_7AqcBz4ONrOQs,616 +babel/locale-data/am.dat,sha256=TddfeRISFvzjTFpB-vH3gjSKs2r8iT3CYckrriibXZY,173260 +babel/locale-data/am_ET.dat,sha256=2VZDSh5bY9vLLuTqcKYG66p5OYlvPRPX58rpNTFWPok,635 +babel/locale-data/an.dat,sha256=a1gEztcqWoMLW3f5_jlDxcPsYY-ItHKVud7gjisrS4E,28050 +babel/locale-data/an_ES.dat,sha256=rQuq-zKj7-fCjY-5fGGoGJT1x60pAyCEAVEswXPnHrI,653 +babel/locale-data/ann.dat,sha256=fUenvOdPjqayLEiVDRNncK8SOBi9gAGAdxMuOATlsI0,737 +babel/locale-data/ann_NG.dat,sha256=0i2K6cv6eCurgFgwtiCr09hYwZCA1kHkQaKnDyCD86M,617 +babel/locale-data/apc.dat,sha256=G96W-ebLqQlTuPN3-VqSfAY-GF0K99c6uXHza5f4e2g,1564 +babel/locale-data/apc_SY.dat,sha256=tagFeQz8BA9Pc7RMqkce1ZalfKIBjqg0SR4NlpGQaaM,679 +babel/locale-data/ar.dat,sha256=yAijlkkaH-RgRQidvCyNBkpi9Z7OTC9cNfIbKo4n4gk,288582 +babel/locale-data/ar_001.dat,sha256=hRKDI3wzxO5T191MfSdCn_MZ6ckM2Rz_r__0JZqS00s,1707 +babel/locale-data/ar_AE.dat,sha256=hEbIYUoNE5mRLOVXhmkGsvT0NAcq-rxs51VIMMzG9LY,982 +babel/locale-data/ar_BH.dat,sha256=FoQ2c3E3TDqKcioarWBvLi_MllJmSd_56r0U45_gHWw,720 +babel/locale-data/ar_DJ.dat,sha256=qbNam_QAmhobsIUfJLCL9pe146SvcmNIE_L3cWpmkBs,698 +babel/locale-data/ar_DZ.dat,sha256=_Y-JLC5hincnxze7sGmEpb7N4JnBh7LdFdaVPcSMDvM,1263 +babel/locale-data/ar_EG.dat,sha256=qE3gLQ6BzLaBOPNJVgaBhPQiIL2kQ4AiD_jLl7o52IM,720 +babel/locale-data/ar_EH.dat,sha256=a0xJdGJYzGFzfvwxZVDP7yURlTm93FQSTQ5qp3XDMYo,658 +babel/locale-data/ar_ER.dat,sha256=l-WjJfxm7kP05-Hnr5PingHaKWJ46ScfW4KEBcwD5HM,679 +babel/locale-data/ar_IL.dat,sha256=O3UYAjf4BB3NdcSQTn-RzNjyj4kzTBhX3q7E8-9Aihw,1264 +babel/locale-data/ar_IQ.dat,sha256=7-DnoHqsoBDe-ZXe0rIcEotb-F_CFyChc73dwnXuUoE,1975 +babel/locale-data/ar_JO.dat,sha256=hT1z-Me5SOjul3BHFubcqlyEk9H57fwD4EFENddiVt8,1398 +babel/locale-data/ar_KM.dat,sha256=Zx5XtfTuRPiW6iViOjeal_Fq-18EA7GuERViMP1_mc4,1230 +babel/locale-data/ar_KW.dat,sha256=1wSXHTcgFKwhNciVS8IvGKvkzzqOIMBFykEJEQXdhEE,720 +babel/locale-data/ar_LB.dat,sha256=-SuXO6LdhXNi4f_PHNrlxl8iXX47perQ_oS19bwRGpI,1414 +babel/locale-data/ar_LY.dat,sha256=2OxSGD1gkiWPcaRHd1qQv9ifG82WEjGahKqhsoFXfnY,1249 +babel/locale-data/ar_MA.dat,sha256=hTOwsXC8tsJxBVlksxmAMlIkn4kK50juJa6TuAPFkp0,1559 +babel/locale-data/ar_MR.dat,sha256=Kq7uT5LxvYXnGWz-cVcI6yDNximu9hZIpoKydmVse78,1359 +babel/locale-data/ar_OM.dat,sha256=HVOqTfoH3JVTHJL-yDBiIafNfckU7CIcO_sIzXBffKw,720 +babel/locale-data/ar_PS.dat,sha256=F-HZRPcMe_tJ8r9V01h-7mQ0UKQxQmuWuXNSi94MVMM,1336 +babel/locale-data/ar_QA.dat,sha256=UKfLpyX856fNgeifdr22wXpDncirWJi9NxqfSnS-7fw,720 +babel/locale-data/ar_SA.dat,sha256=8WE8HwCwO-OT_G2JBSgmPWSzyHOdIA3zajXPbBZr2Tg,24787 +babel/locale-data/ar_SD.dat,sha256=f7aUKlrKmmC7ijTjVwn5r9m3mfZfEob1a7GHVCj4Qxk,720 +babel/locale-data/ar_SO.dat,sha256=4LD_gds2VsvxdFHpFo56CxTFenzNdvEkMofc4oTGBTU,677 +babel/locale-data/ar_SS.dat,sha256=T6eeWPeFejmBC7InKqg-6qmWoer1vjl6srHe_5ybkDU,700 +babel/locale-data/ar_SY.dat,sha256=u42uhje_zt806WlUMpp5sIdi1yjw3Yv7vYbl6aELsyc,1398 +babel/locale-data/ar_TD.dat,sha256=OG7NYtRrJiDeRt7HP-B4ta5ri-6fdSnYomppfy2A4ec,658 +babel/locale-data/ar_TN.dat,sha256=xO974NyO5T-pRs-5b55sfQFGIwU2Y4q3VQUeqtqWf80,1201 +babel/locale-data/ar_YE.dat,sha256=vu8wYJgzcJ1douKfKLx3-hAg1sjndD5_PTHWG_bzRL0,720 +babel/locale-data/arn.dat,sha256=JB-QfwCOVQbVrLRlq2LMxU6SHO-V4ZaU2_0W15-0Rfs,721 +babel/locale-data/arn_CL.dat,sha256=cf_JrdIAxFwbltVwtloNC9527Du7zaoBDM-_KmctSvE,636 +babel/locale-data/as.dat,sha256=xoTmhieoAVjw59h2-_pLp0wjfZPVvYMV6qDSJjLrjq8,209876 +babel/locale-data/as_IN.dat,sha256=bE-OZ0Y3d2-QtD23ztjluSsFk1_RFNYMFzKgBC3waw4,658 +babel/locale-data/asa.dat,sha256=zzPu7L8RV8SVEKqeRiGIoWLBCJkeS0acDh0pYq87qMI,15492 +babel/locale-data/asa_TZ.dat,sha256=U0GU10aP58LxCeqyjl69RQCZi_6tTQxm2vni6XVkoqY,617 +babel/locale-data/ast.dat,sha256=_Qeoc0gz1ag9MkmNIuv4ufVjk0fH5xtW4M7vp8ST4hY,168961 +babel/locale-data/ast_ES.dat,sha256=51kFxigV5COuiPiNisp-OBFYMith5rUgBmU48rGk7Hc,654 +babel/locale-data/az.dat,sha256=2EcwMc8qIqCW_F0Ic2XjFQthkCGyfLNzJzJZU99ZcaA,173802 +babel/locale-data/az_Arab.dat,sha256=IGBla73oKavlLHhtIW37idHxTkmQWZ-S8NE54b65d4k,7499 +babel/locale-data/az_Arab_IQ.dat,sha256=VsM0-KQPCP4MUw-2wMsBv-F467cr2Bup3jfxx8Fc3ZE,678 +babel/locale-data/az_Arab_IR.dat,sha256=ROb0gFTPwK5CcjpQMB7CJ662eld9sZj7IA6QMrvxgto,678 +babel/locale-data/az_Arab_TR.dat,sha256=EV6cNf3keBNREHkfF98GGZGOZz4L5dxf8pFbujInaQY,635 +babel/locale-data/az_Cyrl.dat,sha256=ru4QYee174toLQsGPJn-d6xe65FsLQ87vBV9AW0o4D8,35540 +babel/locale-data/az_Cyrl_AZ.dat,sha256=GRZjR-gp6JYeLNxoiAKNdv9bkTmS1bpYnRJ0c9YIGws,635 +babel/locale-data/az_Latn.dat,sha256=aK2ziytg5Ig6GYk9tVCq4BEyV6UYy9Ip7F1_i4Pq1jw,2258 +babel/locale-data/az_Latn_AZ.dat,sha256=GRZjR-gp6JYeLNxoiAKNdv9bkTmS1bpYnRJ0c9YIGws,635 +babel/locale-data/ba.dat,sha256=Ly1V4wBNM4KCDGtuy9oCug4fZzVNEFqXOI8XKhkWFOQ,732 +babel/locale-data/ba_RU.dat,sha256=8YcwUOx3h4BcSfUIumKJ4wcFyiSgBM74SqenVIQUKi8,653 +babel/locale-data/bal.dat,sha256=mYMTNzej_lac3GimNq9dYgLY3Q4RtXpEvUkQ-zfzVqw,12849 +babel/locale-data/bal_Arab.dat,sha256=25CVl5rF7FqKEeHzAmt0BccVI_ODqmMP86KqQ4i6PL8,934 +babel/locale-data/bal_Arab_PK.dat,sha256=sy4tpUtN1St5yFoTp8C6-vi2bFGPjSaG_zDbY16Q988,636 +babel/locale-data/bal_Latn.dat,sha256=X9sEvC7SU0VUFnapzFKUq0nvc1az1c9lHmrCPHPCg4U,116909 +babel/locale-data/bal_Latn_PK.dat,sha256=sy4tpUtN1St5yFoTp8C6-vi2bFGPjSaG_zDbY16Q988,636 +babel/locale-data/bas.dat,sha256=hts2-gooZheGxndoyiVM9NwFrAitthfb4IPr7TtYb2U,16673 +babel/locale-data/bas_CM.dat,sha256=WBq-_rOvkBnT5pBaCyq844LLSRReQzg2HM0u7GmhKKM,636 +babel/locale-data/be.dat,sha256=8L6Q0C4wjbLMC9I7ltFoY1prATuRd-8nn0udprYBI6A,272322 +babel/locale-data/be_BY.dat,sha256=yN4Rf2-HqinMscTfe4jKEYpsCEaddHce6K25ol595Ag,635 +babel/locale-data/be_TARASK.dat,sha256=93xDxO06nuAugpWjrnx6C5k8Fs26HIAolUcUPuoHhbg,104118 +babel/locale-data/bem.dat,sha256=zBh5HxY-hRgaQd95anmqMAPP0UVzSV7JdcuqtJ78t1c,5782 +babel/locale-data/bem_ZM.dat,sha256=nQvsLK0FOSlgf6wspQdbj00IveO62c2Mvxjzn4eHGSs,617 +babel/locale-data/bew.dat,sha256=mfKR23PSPyS0AHxbaSuMvufZZQlMICxDGuPv78MtDbU,122095 +babel/locale-data/bew_ID.dat,sha256=JWKbnUQc4ZsJYTcBFypK3gSyFRK6Kp8UFEqdytnPMnM,636 +babel/locale-data/bez.dat,sha256=_saESrmbxsbQnGLACykFIs-aLUC-N7IigpyPWGLBebI,16300 +babel/locale-data/bez_TZ.dat,sha256=OwcKelhUxQWu-8Jm9nf2vCay6-8LQvg-ueZSN_mrGz0,617 +babel/locale-data/bg.dat,sha256=ofd_Tv4onIP1cE1pVO-171ySR9JJXuHKzpWqc-vtLP8,227940 +babel/locale-data/bg_BG.dat,sha256=CERFyuC4Dw9BfAZapqaq69iKAp7rBXWNCkLWAL5tAhQ,653 +babel/locale-data/bgc.dat,sha256=gW0lkQNX_h1SATbqzIqe0twmGqqfigkbqo7gvBCG1AI,2493 +babel/locale-data/bgc_IN.dat,sha256=hO39nPiyUx1kfCdagpCQ8lzPLycjdfk59jFQgsd3Qec,659 +babel/locale-data/bgn.dat,sha256=8RKzmGYGYkn5IF7NHRgPtaI9ozwCeEKoUE4aXQpItKY,28964 +babel/locale-data/bgn_AE.dat,sha256=5jo7AWXMNdiiEf-RqzB5xRVj0R89NFdwq5RAIEAeeRE,636 +babel/locale-data/bgn_AF.dat,sha256=UXCb78n57adZBdKHEGnhbmeVYppzlSscVOWnQNxfJOQ,679 +babel/locale-data/bgn_IR.dat,sha256=iXxyPD5Z-ouDWFpOE2atoi6-HHGoD6PNaT9c-TH6x7o,679 +babel/locale-data/bgn_OM.dat,sha256=3O0CzFrjWxOQFdN6-lDhCxRngoXfadd_dwYoVyjK9jA,679 +babel/locale-data/bgn_PK.dat,sha256=gdVUcc-isHd9lf0S-AmFoPIMwDZ8ay6NY4o1udWI6Yo,636 +babel/locale-data/bho.dat,sha256=JQAEhmajFwUOKB7ACN1-ZPcoKcXJaq0-FhsFCVcvn_8,2875 +babel/locale-data/bho_IN.dat,sha256=UcL_aZq35dOHME0Fux9zyt9B6BOTxyR5UvaGWKLs1jE,659 +babel/locale-data/blo.dat,sha256=I0gfsGv80xf7do-oxzjkh2or934YxYgDMkM9RHf7UXk,168499 +babel/locale-data/blo_BJ.dat,sha256=LM79oUzVI4JtLYEUklfbQxoweFAslN9jS-Ex-dya0mE,617 +babel/locale-data/blt.dat,sha256=6G2E9osBy9OrG1iUKLD9cwcRk3IV7fT11iI8zFkLaeo,723 +babel/locale-data/blt_VN.dat,sha256=vpTQEJYssmuBUn_pYqx7ZtYONNNz02_oBYlDMdWqKAc,636 +babel/locale-data/bm.dat,sha256=K0dLlxoDfJb4QLwa_D0SXfrbD53Xed_EJ21843fY9hY,15798 +babel/locale-data/bm_ML.dat,sha256=PAGrUwc1S6q32DDHTu5LkePFXe_M_i_WxIY4oLuUnzw,616 +babel/locale-data/bm_Nkoo.dat,sha256=UiQ-oKSXYmbnUj9nNXi-9Afx2taBc5EiN-JM1huGOno,2805 +babel/locale-data/bm_Nkoo_ML.dat,sha256=PAGrUwc1S6q32DDHTu5LkePFXe_M_i_WxIY4oLuUnzw,616 +babel/locale-data/bn.dat,sha256=00cRKYrwyk5snhrekLj0TQBVzZlV_PjQ0aLlsApgwxw,219185 +babel/locale-data/bn_BD.dat,sha256=mVW90kQmhDcwzKmkmgNAt5iMq1pLWmNndNID9fspVjY,635 +babel/locale-data/bn_IN.dat,sha256=Y4d5tMv6rG2A1fTcfN7-cMeZ1iH8XuqdZgpEBUy_FTg,4035 +babel/locale-data/bo.dat,sha256=2eVqnOFPv04Ix-1FVPHlDQ9UVTQC1JtC7-5lQ89aX7A,20102 +babel/locale-data/bo_CN.dat,sha256=xOnyre81Z1IHnWV5mJH0x313h-ZWu84hIXcMuB50IT0,635 +babel/locale-data/bo_IN.dat,sha256=GvYCgtrOD5zYYsfMtVmkCv8-y6His8Lg7iuytEGjnMI,1307 +babel/locale-data/br.dat,sha256=rBs1Bp9H6Q4ECO2mouoJmnCW0ux5CLPx1zy32GvpkCo,272612 +babel/locale-data/br_FR.dat,sha256=3oVDdZd7Xf4Q-hwmYraF42SM_3NtvSoiZlmlh6gSNOs,653 +babel/locale-data/brx.dat,sha256=0L8rfQwjwtj3y5M5zzdEB10way4I9P2m8A2E0mTIcac,160164 +babel/locale-data/brx_IN.dat,sha256=NKuJh0cEhRQasy6JAGUi5HbqdnhhEFTQ_7osgtdG5Iw,659 +babel/locale-data/bs.dat,sha256=YVLbXGLHf6QZ9vYnCjxjO3uBImuYnoxR-cEuBPVbP_w,213968 +babel/locale-data/bs_Cyrl.dat,sha256=oqFwEFFfYqyzkVvswj8CR2B_RCb51Myv8jQaDDjz0u8,219235 +babel/locale-data/bs_Cyrl_BA.dat,sha256=oA7rsQckE_IxCpXXB3F3KWQwM3WZTR7WAdYxJN98oeM,635 +babel/locale-data/bs_Latn.dat,sha256=6L9SY85hONRHO4Jz389C2Ziy7llKcDoyVNiE96ozCJ8,1990 +babel/locale-data/bs_Latn_BA.dat,sha256=oA7rsQckE_IxCpXXB3F3KWQwM3WZTR7WAdYxJN98oeM,635 +babel/locale-data/bss.dat,sha256=n9LaBwBIJ7adjJ63G7Q9o00llhPJtkgmeEp08nAa4D4,978 +babel/locale-data/bss_CM.dat,sha256=TD7ixCHREfOLDsDJn8FY5YqGYH9czdEzdULCIl_0GhM,636 +babel/locale-data/byn.dat,sha256=qT32E4jh6H_qm7HYSsAbKmaKluaLrGNXNl3F3FivncE,13403 +babel/locale-data/byn_ER.dat,sha256=oAaZEqMJuTbMITO-ZO6gg8qjwROukzh5VgjtLp6rqD4,617 +babel/locale-data/ca.dat,sha256=CIT0-7X7_e8RKWRrhLSmG-aBC2D51-hvRrTV-7iBav8,184038 +babel/locale-data/ca_AD.dat,sha256=tsLumbhbbeXw627WKi-sQdSTFwNpcSRvJIEYcrOMqOM,653 +babel/locale-data/ca_ES.dat,sha256=T-zv3FfnCJA2WUQTeBADKV82ghY-r60wk8mXtD9wbnI,653 +babel/locale-data/ca_ES_VALENCIA.dat,sha256=7Q59_PX0VWyLsDkC-qscZ-dKJ9AFzz7kCzJz4fTdBWY,2976 +babel/locale-data/ca_FR.dat,sha256=5HUFYUl5QRaUMwJxGLIqUhDO4_wF_crrr346wJmEOZo,672 +babel/locale-data/ca_IT.dat,sha256=Zh2rtOq8MIDC2CQXWnhp5HOvPfXNxhRGnnZViOgc1Mg,653 +babel/locale-data/cad.dat,sha256=XxlMk1b9CWE3wERhhQQN0wxW7iq8Mrngb05RXenmaSI,2476 +babel/locale-data/cad_US.dat,sha256=FWV1sofgr9no5P9yBxNDLeKWoQd80XEYEilmLwamkSc,654 +babel/locale-data/cch.dat,sha256=J4S73psT7C_cXs1VNNYow47plBodQ4PKINC59kzvfAw,2430 +babel/locale-data/cch_NG.dat,sha256=0adhw9xNMlVEqDVKvHe4HCPtbjcw5NSo4ny_pOjl0-4,617 +babel/locale-data/ccp.dat,sha256=Jn_O5MwN6DMGxNrXUpdrhT_z5ZOYh3-Sm5yGUcV8bII,207292 +babel/locale-data/ccp_BD.dat,sha256=f00776fnI484B-mzW0rY22KNkzV6wtmk7uxrSK_x9bU,636 +babel/locale-data/ccp_IN.dat,sha256=jMJimrQrx-b96hBSLi8sOyHtYRwNZryt-he0rhwEZ2s,659 +babel/locale-data/ce.dat,sha256=yuopW5QCq1u8E1Rs0hEOv_y1uvbem_P3lK-_AvU5zLE,135403 +babel/locale-data/ce_RU.dat,sha256=NgNmp1uFnm2MT-s_yx_V8KuW1dSR6_SEWf4NcqrAL9o,653 +babel/locale-data/ceb.dat,sha256=fwgJPAV6TfvyavZUW-9pKeLUacMuH03hCkSkHdIGm8I,100779 +babel/locale-data/ceb_PH.dat,sha256=Z2zXPyNI3Yu3QcGL6lT1nIsl04vDDLFvyd9GeucDtqA,636 +babel/locale-data/cgg.dat,sha256=vgLxp4dDUjKyHy-36IvfaPEy6IiXbDiMKShuEKJuXHU,15621 +babel/locale-data/cgg_UG.dat,sha256=HZBma4MFuX2Q7sk-SOYk5OUkbMXWWr_tEInOqPboNYs,640 +babel/locale-data/cho.dat,sha256=hWEL5XrIWAnqjYSb78iPaj2xh34KDcPYAMc46S7ZLuU,795 +babel/locale-data/cho_US.dat,sha256=T3CacgkE-uKPi0CV7fbcCLTNfdjEco_A50vYciuXGGI,654 +babel/locale-data/chr.dat,sha256=4a6eJjX1JZ-inCk-J8gHJq1QtoK3FpOXhOlQMDbHjwM,187187 +babel/locale-data/chr_US.dat,sha256=wZE2RrJ-5jjUQa1RCJgL7hkXdsU3t91orD-ULDYMXSM,654 +babel/locale-data/cic.dat,sha256=KgrmFl1fudc1tdR_g39YkGR6bcIedQMFnUjh831VIhM,2732 +babel/locale-data/cic_US.dat,sha256=DvW1XJS1hEp_W_5ol0pIECeUb3RqXsyieKVS8J6caJ4,654 +babel/locale-data/ckb.dat,sha256=s6wh2TRjabPo4G64RMoQD_J7FK77RBwsK8R0TH1xytI,35553 +babel/locale-data/ckb_IQ.dat,sha256=Osgu1RAUf2yQpZ-nNBKMxTFJnH32ItLg0kVVzjNfmeo,679 +babel/locale-data/ckb_IR.dat,sha256=6wWzlZWn7oDmGIdnF7UtCfIcUgQ1zvMxtAcEw4bbM-g,1231 +babel/locale-data/co.dat,sha256=NbKZ99wTpG7Y64LnyxTQJIo5SYQaUAOybc68DN6IbUY,12637 +babel/locale-data/co_FR.dat,sha256=DAmwXn4n1mRSsT17-DcU0vdVSI_JfVR8oGOnj7hTFHk,653 +babel/locale-data/cs.dat,sha256=o7qnhuIqxpPIfD-oyVLsvpmhtRiIOzgJBoMaZvyvPL4,247800 +babel/locale-data/cs_CZ.dat,sha256=keaiqSsGtB_axj8FvdYDOCDmlg2PbQMI6qnW-2mFUTY,653 +babel/locale-data/csw.dat,sha256=a31wJpIkcegvNW9_O8LfIY4-HK0zpLn4MBUEBb9C3PQ,20303 +babel/locale-data/csw_CA.dat,sha256=aWccZHGNU7G4JJdlGRnqyqm0ROubX0rwI9SnH_EhAxU,636 +babel/locale-data/cu.dat,sha256=mlGQkibxBcukKPAJawHruBMuw21x1j42ebTnraxW55w,16865 +babel/locale-data/cu_RU.dat,sha256=GcbqgE8Mlglk5EGGSVcCR-Zb8AmCqHGE8cbmAUSbpdY,653 +babel/locale-data/cv.dat,sha256=BUqS-4RvAuycOlAm_k33eV98VCp5bIUmrWUqjhmsqls,198348 +babel/locale-data/cv_RU.dat,sha256=oVPRtcHzmRmkAy26Bv1jLiWmm0P18ruvHlCQ5F3IFY4,653 +babel/locale-data/cy.dat,sha256=-bN00WqRhdnCL9VdnGgtUtwbmZ7n2r96oZdLuxSP8KM,276313 +babel/locale-data/cy_GB.dat,sha256=dyPULIteKk9gP7lGQiDtsiH5QDqNdlxMdK__2dq90dg,653 +babel/locale-data/da.dat,sha256=VUVxNljiubvj3e_PhimeMLBVZlAt1GT2bAfnyYu671E,171756 +babel/locale-data/da_DK.dat,sha256=qNTw1H8WXsV8qGBHxu6noCUOV3BcoR63ERJF8Xc86Ls,653 +babel/locale-data/da_GL.dat,sha256=9BNeKX1-U4NDr3pBU1ZnCGAasdYZjBMsvpdS5uTf9qs,616 +babel/locale-data/dav.dat,sha256=LBf1uH_Q7632sBVhZgQSrdn5LU2pyIU389h4LircJM4,15690 +babel/locale-data/dav_KE.dat,sha256=MfFFEDT6fib5be-EmziiEF0NAnEV6lXD7svYtHUtmn0,636 +babel/locale-data/de.dat,sha256=l6ABVg2zXPX9Ws9g2-Weve05S46ii0hnbuCViS6mtmA,178630 +babel/locale-data/de_AT.dat,sha256=OhoRvklFcyYUJXplBoK2rAITKRi6r81lwOaixIuffcA,2010 +babel/locale-data/de_BE.dat,sha256=wvdWykhix9Slofcjm2tx2aEhMjffmMLsNrd8709NIR0,653 +babel/locale-data/de_CH.dat,sha256=PH2rDxHA3lpTBkPMCwWjapEDJtgrkHhq2_pAdSKSiXE,4091 +babel/locale-data/de_DE.dat,sha256=SM44YjGlqgh7bKlXvUdt53t9hnCX5o46ujI4IrGPpeI,653 +babel/locale-data/de_IT.dat,sha256=ALPY2QGlR9-kphEk4KggHVS51fQwEDVRd7aHLIiP9fw,1448 +babel/locale-data/de_LI.dat,sha256=FnGRiippDTTFRFswU_4PblQruAuWuPEpa8cGbXPJpbE,1413 +babel/locale-data/de_LU.dat,sha256=QAkvLfyKmZdQVfkk2BbE2AMisK1i7yhRetcApqn4dxA,1067 +babel/locale-data/dje.dat,sha256=6NxQgBas9S5kmjbRcbcuuIIxKaI5_MlfmSUltxJuraY,15530 +babel/locale-data/dje_NE.dat,sha256=lU1vag_HJ4OrbYNYWFXuSdtqLwSlwBbvD6Tg-hl36e4,617 +babel/locale-data/doi.dat,sha256=JrHDjsVlGntLL6qYf9NH52BWAGCSGeGVaHg_rgUiGkM,47442 +babel/locale-data/doi_IN.dat,sha256=-q_oAqvdTizFG1DB_1p8sZVyjbaFFQ_FFPtNCyVn9ZA,659 +babel/locale-data/dsb.dat,sha256=KvZxymKZ5ZbxQ-4gS_uvnNkrYMYn3D-BKz0MGAn5488,203926 +babel/locale-data/dsb_DE.dat,sha256=Z2Dzjx7eXscEBEAb-ymvb1GKP4GVNCt5L4i-BYC_vrE,654 +babel/locale-data/dua.dat,sha256=lmO8ssPF9bIgTU2SM_SzrGWodmsGsmbS485uZNDasq4,4827 +babel/locale-data/dua_CM.dat,sha256=Z3vD8WEr2Wlqqt39anvKXVhz4_yBSm4t5BoAaEz9PgE,636 +babel/locale-data/dv.dat,sha256=-1zCv4GXiRHdWjQk0qXWNPSf4FX4Zp-Ij2jwgz5BsGk,2225 +babel/locale-data/dv_MV.dat,sha256=lvuU5gj3vDykU2ftU1_4Lza-130DB6_ZwylDrdb_GlY,635 +babel/locale-data/dyo.dat,sha256=w71HDmFfCuKN9nUJnuqpHR9DDAmPLkwIu9E0abhYjWM,9854 +babel/locale-data/dyo_SN.dat,sha256=Z6N-NIVcKkx6sFUm8LfN74usyZfgeI6swJL_A_XbBcc,617 +babel/locale-data/dz.dat,sha256=dbPhCcTpoQh6szaBA4TN5eCi3sbG1UBvlQQxtMGHLEU,85026 +babel/locale-data/dz_BT.dat,sha256=KWd6cypWse4XfXbY4BmTlxGjlnRksYNcQYi_iyXluKw,635 +babel/locale-data/ebu.dat,sha256=S8bggVknCbVHw5x9aJQGB9kUBFNcwj9EONHRNtbaWCA,15583 +babel/locale-data/ebu_KE.dat,sha256=GEcGqVmH0WwgP1BCsd9vnSGxGXl8ON4UPTRbyeaNDfw,636 +babel/locale-data/ee.dat,sha256=xJ5vpKJa546rTvKKQI75-HvYmu6VjEedXENlPSeDgCg,88730 +babel/locale-data/ee_GH.dat,sha256=SkQi-aVmtqi3S99DUTLQzZqUE4LrAIWuy25QuZqYAfI,616 +babel/locale-data/ee_TG.dat,sha256=7y8-rDvag7_EQtEObq3fpHaRedVmuEREnQwjktmLwgk,1168 +babel/locale-data/el.dat,sha256=pMPkYRvK3y4IF93Z-127ZF_-_P_QV-_460LgZAHCw9o,247970 +babel/locale-data/el_CY.dat,sha256=POPjzTYMuP7Ijf1S88cAFR0ge9Id_sSRNembKdhk2aE,635 +babel/locale-data/el_GR.dat,sha256=S32Cm-1ENgLL_lDecCDI4qDfyd3wlQ1JbUwOnW1whm8,653 +babel/locale-data/el_POLYTON.dat,sha256=lkcs2uXW6mWXztmsAXnapnSuQ6gkns1WwsVgrg-24Uo,14964 +babel/locale-data/en.dat,sha256=C0EMuCmMqd7xbacUUkDzM6xvzhEWWQgbd0sIPvX5QbA,217633 +babel/locale-data/en_001.dat,sha256=X7NFTy08b5AyR9I6BDy79hP3x_nq018WoQmMSzR5S1U,31614 +babel/locale-data/en_150.dat,sha256=cjKCV1ZLhNY4TvqJF8BXvQR1jVUBFrdjL1RKSnBa0vc,1851 +babel/locale-data/en_AE.dat,sha256=T2jBGVJpPTUgTICdaQnAVjSsYCVkQLfjabyStaPl2CU,4164 +babel/locale-data/en_AG.dat,sha256=POWSM98pRq9k7lqCsxr-MS9PA-zLoOVUKUcI9iXtKq4,654 +babel/locale-data/en_AI.dat,sha256=7iwWKftqPdOdWJ7v94jsre2ZIq2cDpbVGAs_ScBztbs,1206 +babel/locale-data/en_AS.dat,sha256=M-N7v6BuP47wkTFmv5by1w42IQCUiSqKbaVTXtnwF8Q,635 +babel/locale-data/en_AT.dat,sha256=05-bVy1aMFWZlHMBC86A7OVy1zlhJw7hsjyvIOjxE70,1309 +babel/locale-data/en_AU.dat,sha256=kEhWopkI0vkAChxsUmnaAX4htgJ36t9hiVtaS6t5Gvk,20023 +babel/locale-data/en_BB.dat,sha256=J8vppKlBp03jJvVuVp6Z4GMc_N0BukeQ8f8q14y8fwU,635 +babel/locale-data/en_BE.dat,sha256=0JXHgqUIWZYe88FYC97spm2TqyIaNOwDJBt3LBmUF7A,1547 +babel/locale-data/en_BI.dat,sha256=AbdI5FjEqQLOMbBtD3wLW_7AccuOwY9MZUFpMF1uEco,1189 +babel/locale-data/en_BM.dat,sha256=cZE8sxf44ETY6nCxOgbvJN2RhABZrRaP8SjwsbSepuE,654 +babel/locale-data/en_BS.dat,sha256=sGvlF2LPwG5eVA3IuH8-4S5X7BrvQ5LcgZ8gfAkkwwc,752 +babel/locale-data/en_BW.dat,sha256=k5bc9gYBdl_8ZyCelrlS9ZenMzs8cdfl2MxeCnOAr88,2850 +babel/locale-data/en_BZ.dat,sha256=LJsn2M0RWMbxDmGRxs2lk2ZvkgoguwPf7oLBYQydU4A,2979 +babel/locale-data/en_CA.dat,sha256=za7pG-TGpows2k_XJL8dpzLVs1oOSMKN3zwyG79OAqI,37924 +babel/locale-data/en_CC.dat,sha256=34a3Vb57hT2reRvwn0Ud1nXkoYQJoPmaqh1n5qflFdI,1187 +babel/locale-data/en_CH.dat,sha256=Nfkwk2HNOccSH8Co5SWYnFdHWEDEpKNPQ2o9a67vt_k,1866 +babel/locale-data/en_CK.dat,sha256=gvU21BSAugpjE7CT3xnpHML6oRgHPaBoq7W11YbG-1U,1187 +babel/locale-data/en_CM.dat,sha256=r_7Yzep6S0ZOFvk_TORm5Qhi55yjehVQAotaLnn7igQ,1437 +babel/locale-data/en_CX.dat,sha256=lKYbIRS6r-WMUd1ewX7Q4TpX0PBVcsYN7Cs263_xosM,1187 +babel/locale-data/en_CY.dat,sha256=kQZfhQdPfdBeePOngn-4CpA3ZJ7Th-lmZ-jOrBe115o,635 +babel/locale-data/en_DE.dat,sha256=oI3TmMDoQZsGddvDb0fbbwd_LdTeFbFPdFkZhst2q7Y,1027 +babel/locale-data/en_DG.dat,sha256=xtjjxkuFB7I4p3n0f4Evz631RtMQhIzpoYwUzOzICqA,1168 +babel/locale-data/en_DK.dat,sha256=pE7x4MDJvZGFnqQqXMCDWoMV3Ovu2qH-QO2oYNvgL4Y,2425 +babel/locale-data/en_DM.dat,sha256=gbriVhXcdXi5GWmpgWdGB1LUwI2yquuLk1khkzpo1UU,654 +babel/locale-data/en_Dsrt.dat,sha256=Ttd13uhdXKMHpNCWaH5q74JJ3fok1gV4MFIGd1fGxRk,38656 +babel/locale-data/en_Dsrt_US.dat,sha256=p8c_L5tEvzYmacz0tmq58Wsbfp9wMV_PBgz5R_v7I-k,653 +babel/locale-data/en_ER.dat,sha256=U1vYaQVwnVgfmO9l2_GjBnAhHrShbiHU_E-hAclDvck,887 +babel/locale-data/en_FI.dat,sha256=i4gKdljmc9cXO-E1IT6JGmq2JsRRH71sKe3yUmkhIa8,2357 +babel/locale-data/en_FJ.dat,sha256=k-hXekogcQzt00qXdcWODsHbg7Vh9U8Vx84bERd8CHM,672 +babel/locale-data/en_FK.dat,sha256=r6OGl7mX4ep5aeFMlhog6Xr--kDKFEVhDcepSJBYZWw,1210 +babel/locale-data/en_FM.dat,sha256=88mCYM5_VDSYpJ_mV4AStjiDpKAo_1W7GbmKcI9f_sk,616 +babel/locale-data/en_GB.dat,sha256=2qd2bKhxJeiwIneKwRmH89UCmnYfBdpOFvL02en-YKU,3440 +babel/locale-data/en_GD.dat,sha256=c2ap41e5x-OY5dEYZ5wD4ByRbEzlx0845R1lPBLnJus,635 +babel/locale-data/en_GG.dat,sha256=qhfvbRdldEA4467X0_8N09HwT1ZRPJJtb7Evpvbbarg,1273 +babel/locale-data/en_GH.dat,sha256=bBpzsHl9QhNAQ7hrUtKb6TwGvZYibXQwXfuJVgLMlZ0,889 +babel/locale-data/en_GI.dat,sha256=veSOVDagnkTwyqxP4u5mOkRG8_W4MCZ5ptMBoGOg9SE,1228 +babel/locale-data/en_GM.dat,sha256=jfHQeiMTDNgnIpx3WZ9hOpCR_LXCYLLrVN4SUakudi8,885 +babel/locale-data/en_GU.dat,sha256=WDR_uybAkUii6RHT2x62pzCLvX4bMstibEztBvLSuxI,715 +babel/locale-data/en_GY.dat,sha256=TDiVa4YSapsK9rjQN3ATnrj3m267l35pqRLI7r5bLFc,694 +babel/locale-data/en_HK.dat,sha256=meLPc5_3zahna_xycXEf75TrW5_4BHuqMQcMyoo1eYQ,2315 +babel/locale-data/en_ID.dat,sha256=b8R7owdV-fl30WrUhFz-1YGHiFweaoYs_bBFr9pGhD0,3172 +babel/locale-data/en_IE.dat,sha256=ZNe5XFbdM4UnYu6KaGYHggQqzIVCWwWof5C5ktTsHn4,2094 +babel/locale-data/en_IL.dat,sha256=O4-JPTBiiLezF-iUSDu73id-0VWlSiE0ie8z9qRaxq8,1424 +babel/locale-data/en_IM.dat,sha256=u3JX9jrrsW_G5RQXHsQIGl6ikVduckeldeS_FjKG5Y0,1273 +babel/locale-data/en_IN.dat,sha256=2d4aWIy6Q72ExhZHnku5HKbKmSSavvB7zkflqlBsRQA,14809 +babel/locale-data/en_IO.dat,sha256=TOM0TxdcWcu1wyBXJxsrE-uCIZsbYTCmUkTdfCaOO-E,1168 +babel/locale-data/en_JE.dat,sha256=IxL3Ry70pMOXDbCwU6LZllHXZmg8XHbjocavEWvb9jY,1273 +babel/locale-data/en_JM.dat,sha256=Z9GFZ6aFGEvIEzlbOlA5bBBvxgcxXx6s_7AxPMp2Yg4,1666 +babel/locale-data/en_KE.dat,sha256=oJa3lUdjavkdhkMK_bcnJ08waK9lfIRs8mFkG0JYf-4,1458 +babel/locale-data/en_KI.dat,sha256=3yfkrwv7Yd9yxDNnXz9Sv8ghbDvqczZTAELr3uGNYn0,635 +babel/locale-data/en_KN.dat,sha256=cFebccXOrQo2X1zmHoHYB2vzXynoroYImJTMnK9j3h0,635 +babel/locale-data/en_KY.dat,sha256=slmSWk0IEz_UK7PfHX4KyHlf_iBRfuoOWVuEB0aKaYI,733 +babel/locale-data/en_LC.dat,sha256=jUYdKd248Jkj5XVxXXbvXnfxu4BH_3s4Ld-O67qbPkE,635 +babel/locale-data/en_LR.dat,sha256=ribT8_azFjDC8uzIsOwkGTjfgEiFlSG_wAb_wG1Fmnw,885 +babel/locale-data/en_LS.dat,sha256=2HtV3gUrynDl2mVvqywMfff8VnVjz2ryoNS7D2n5T9c,885 +babel/locale-data/en_MG.dat,sha256=dtMrsBqOpwQExs7dVukbUzWojz_6swx5Ng6OXdKxsSs,1438 +babel/locale-data/en_MH.dat,sha256=NZjQknLyokLgJRNPicAZ55_VoRCATz_WvAxMo_I-HOg,1368 +babel/locale-data/en_MO.dat,sha256=UJVR7td-vlRY_a36ZWbxr_PcK6egIUQSKoky3DeAmEA,830 +babel/locale-data/en_MP.dat,sha256=Sd2vA3CdR_GBw1vQQQBfKIY0asJGsVUwZ6gD-h7Or8o,1349 +babel/locale-data/en_MS.dat,sha256=BXrA3odGnWSeR6404L85ErqMKxTnRCZ16UWL2RpD7TY,1187 +babel/locale-data/en_MT.dat,sha256=sODJaESHndxdT9SYZcnESDA6G6oln6n9NCojeHhKvJg,1990 +babel/locale-data/en_MU.dat,sha256=SefoZho0XzSzzU_Y_-udWPCuRgz8ujdUVkL7hhzZO8Q,1438 +babel/locale-data/en_MV.dat,sha256=Spp5zsOCHzCeZOyUdYqXoqmSoIJ0pxRR3b3nI27jvTs,2034 +babel/locale-data/en_MW.dat,sha256=5d20Ih8j6iwBY545I4nObBWdv9FL37nE-ggfpGeXSVs,886 +babel/locale-data/en_MY.dat,sha256=nUwwM17W9W78nnbXGmrx2zComZQ9Fg_pu3va9wPZzvY,716 +babel/locale-data/en_NA.dat,sha256=-yNAAmx38RoVJt3YRH7Tp1xO9o3GsSVDU6uF_GKhGb0,885 +babel/locale-data/en_NF.dat,sha256=6LqhwHyOnkQA4TNvseuiE1a5Ov7DV3y46CZ0ENcibXE,1187 +babel/locale-data/en_NG.dat,sha256=dvbDZYdlkmhF-IU8M6s2p_kHswy8HhdmR3LLc4EhePI,1439 +babel/locale-data/en_NL.dat,sha256=dDCtXReh9uMfUOVqGWaWjfV1-dLe5_yj-o_HrKZGMeM,1192 +babel/locale-data/en_NR.dat,sha256=ZiUNBY0c1T3LQP-qGmtuxLW2Jfc-lcVTuWpB2jxfAGI,1187 +babel/locale-data/en_NU.dat,sha256=jU4HXz_3l5k-luPPsjZmZBsdOVB5ZfkN1Xuk5i2pduc,1187 +babel/locale-data/en_NZ.dat,sha256=z_qul-H3zQn0Q_lrrHceySj1m2TQaaJZd3QMXE31CcA,2340 +babel/locale-data/en_PG.dat,sha256=WV6D2yT-4GX6ftbnUkK-ihfNg8Y-ImX1Af56okx8LTA,635 +babel/locale-data/en_PH.dat,sha256=oPz_wDvxfCHBpkBUaZ0RiwtPrLtx-9IigR0TIK1b-IM,635 +babel/locale-data/en_PK.dat,sha256=KS_KXItkhkUULbKd9mHdWD9ok4WjZbVSXhU8e5u8blo,2074 +babel/locale-data/en_PN.dat,sha256=qpEWWX0fvhzV6gcX_SHNbJW7E-5FikKwXrQAP9BWmXc,1187 +babel/locale-data/en_PR.dat,sha256=bpAu9yoeKxzQTF5Be7AfXtyE3wax0eP0m-Eu-Cr0jKE,635 +babel/locale-data/en_PW.dat,sha256=--3_iiNqupR9R3ccq5foj9HzkADBEwBYdKE_AxLZD3w,714 +babel/locale-data/en_RW.dat,sha256=Et3hOZwaSDECrCzypgYq1QxKxxnB3XYziIeEe_WiY7c,1438 +babel/locale-data/en_SB.dat,sha256=h9TJ69YThzzLGTh49BBEmRBxSiZhZpQrVJif0QglLVs,635 +babel/locale-data/en_SC.dat,sha256=omYtCZBrLl8fHuT6XInezdetV7WqWZVYriJRnlWKbTg,1188 +babel/locale-data/en_SD.dat,sha256=ozd3rV_icr8p2H9V6StOSMkoHBPNBsXsay1GMRWZ1zs,928 +babel/locale-data/en_SE.dat,sha256=96guhEOzGr2Lcbd3xZ4j7HTj-0H0oaGMQIbI9a_5g48,1502 +babel/locale-data/en_SG.dat,sha256=u9U5CLnqs0iJmSnMsPBHF71HQLpFM3siADzZeC7iaJ0,2096 +babel/locale-data/en_SH.dat,sha256=rBm_0zxjHnEVzs_CPCyuz5LpI9isA2S6copUuNbxCcM,1210 +babel/locale-data/en_SI.dat,sha256=kkeEkPnW48iNoiwNZb0KV29DPU0oVNuENTi_Wmp2ALc,1046 +babel/locale-data/en_SL.dat,sha256=4hJLAAnyuEVVQZ13NC7wZ0JYJQ3rvX0SsOAp0OoW7_U,886 +babel/locale-data/en_SS.dat,sha256=C4kpyEFjyKT9-6wt2pGl4125aN0Bp0wpcYBrr62nPOc,908 +babel/locale-data/en_SX.dat,sha256=7vESruRIiaBqWxuSRpIE2U6PgWwJ9mxgbjjH_XAraa0,1190 +babel/locale-data/en_SZ.dat,sha256=A9wkzZ5cFffcEf1FobYRPxR1EAFwqQvqELsqRpNleOg,885 +babel/locale-data/en_Shaw.dat,sha256=5NskTfYsGHZ63w2s3eYrzrogPpVZeqY3wd60hViYIbo,4774 +babel/locale-data/en_Shaw_GB.dat,sha256=uAIWlJ5gr_NR6lncmMaBrjXUPhZ33rGsXoHz8hrd_E0,653 +babel/locale-data/en_TC.dat,sha256=UWqEc9zpN3NdS1dymbUv2iGKhLkH65Kk9uNFxdXGnOw,616 +babel/locale-data/en_TK.dat,sha256=qz4RHtHQ6cNjB8xW8_BIHdzW1cEcQuyJfdqFIybXAs0,1187 +babel/locale-data/en_TO.dat,sha256=OehJQf8kvWi7A-Rwo2hPjs1Z9pTdg7_Hyx_ewWxbLQ8,636 +babel/locale-data/en_TT.dat,sha256=L23iDn_zvh16iPE5uBlLCRvECSozqyzU9W2OcSjYogE,654 +babel/locale-data/en_TV.dat,sha256=3sj3NCjQg-9UOdTz7wDJRpjx57bI0bntpmx0T50OK9E,1187 +babel/locale-data/en_TZ.dat,sha256=5Q87mjSEaCMmWeWwtesb9lJw2tIWOsvyScG1CqSpWvs,1439 +babel/locale-data/en_UG.dat,sha256=aQLfdbfozsYhK3EG9JXVxsmT4B7UvfSzNBo7kO2WSsc,1462 +babel/locale-data/en_UM.dat,sha256=qd26Sl5bJTEgHU25hvskp4LMxvRJByLOSvUikqz0J4I,653 +babel/locale-data/en_US.dat,sha256=p8c_L5tEvzYmacz0tmq58Wsbfp9wMV_PBgz5R_v7I-k,653 +babel/locale-data/en_US_POSIX.dat,sha256=U8r77o6qQID3Sd5FiZqukSpQnq4LV1BDwHUeuNZjW10,1321 +babel/locale-data/en_VC.dat,sha256=ES4c4Xt6OvJDhxoAZpWR2HFbtyENOl9CrV7XFCBs-MY,635 +babel/locale-data/en_VG.dat,sha256=sqiVUOEtDV2pAc5DzGl76qV1mL5K-UWhMRzG-Ff6r30,616 +babel/locale-data/en_VI.dat,sha256=AGffygfBAafQMxKAAoxt6kwmbES4R_ybbXRV2tHpy04,653 +babel/locale-data/en_VU.dat,sha256=ji2cRB8B-c8uJR7L56HzbkiTR8eJZziVTMcEzuiK2g0,636 +babel/locale-data/en_WS.dat,sha256=gowKsveED3UIWyLgnSWxyE6qq87lH2dMgOVLDGCEcBk,656 +babel/locale-data/en_ZA.dat,sha256=uoSLsVWiMu6x-DYwISGhEwveg0kVsDwgnIhq2Jn0hXo,3411 +babel/locale-data/en_ZM.dat,sha256=8y814a5GtYcC5gvh3YBlcYf5Imr0yNEIV_v8jH3SXqk,885 +babel/locale-data/en_ZW.dat,sha256=GUDDEesQRkUuLyyDlnJ3MGlGzG-kDPxt8OTIqVRKDyw,3320 +babel/locale-data/eo.dat,sha256=kSIbuCrTJF0ZuNV8FzhyheJT33iKwteIHLaYgdfPO4I,101326 +babel/locale-data/eo_001.dat,sha256=3-tP9zaTDfbBBjpd2qKVIhS7WWbmtVKGGW_BmGIhrHQ,850 +babel/locale-data/es.dat,sha256=c62rMW3rHT7taFSTKPt8je50jtFex4sL8nvuVey9224,191377 +babel/locale-data/es_419.dat,sha256=s-JLmJhGKoIbnsjZm-6UXnDsAsgFhIKk9OJk7SPR_oI,27973 +babel/locale-data/es_AR.dat,sha256=rFeyqcUDLb3yYYWMuCP8R4O1n4rT1XCeayaIaoPaOPY,7087 +babel/locale-data/es_BO.dat,sha256=9zgEUshMb69M3LZS_3TOk4kGOt73fnB2UWWR7HPFAgk,1477 +babel/locale-data/es_BR.dat,sha256=oCD_7IoQ5w-C-YXpQ_wBcS0wUkcY268QDcg5y7Vo7KU,1207 +babel/locale-data/es_BZ.dat,sha256=Z3ZskA42UBcpOPDI66F6YBTvzt-g61PmxhiEpdGXpwA,1206 +babel/locale-data/es_CL.dat,sha256=tpiiCMc68Ab3YYDqi_zh0dw_IfsZmLciylujbf72XqQ,4848 +babel/locale-data/es_CO.dat,sha256=_ZNmqQnEj8EoNse4lJuK0Qrg1ZnPSgUVCPCNo7K6FE4,7436 +babel/locale-data/es_CR.dat,sha256=GknsR2O3LbFhHagGvUvgNgBVCVbXZxk-yzivTPR-Q_0,1308 +babel/locale-data/es_CU.dat,sha256=N-TqpCs34sjlEMeJgvrfOSpmnnlGxuuGtSBSaUKDbvg,656 +babel/locale-data/es_DO.dat,sha256=HMY1U9RiyiBlQKc_kUERQ-GHqWCgjaqrBY0mKUE9Gp4,2700 +babel/locale-data/es_EA.dat,sha256=V4UU6BM3pjbuEleLA_MaJtWl8IejNcHzUM660pfKa80,616 +babel/locale-data/es_EC.dat,sha256=i6oUe_5GL6b8ZnbnORW1csbq1-qgo6VN0Z6x9G2xIWk,2941 +babel/locale-data/es_ES.dat,sha256=fd1TSjdlf2lSMxwi0NhYGR2eyiABBaSJvhLlwLO46j0,653 +babel/locale-data/es_GQ.dat,sha256=a7A-hqM9wNt51_CdpjzU8aT9KEeMz165-MyhkWyqJOM,638 +babel/locale-data/es_GT.dat,sha256=zk_WqHmzYsoIAiErSYC9G62MlbgAuySSTAPZLtOX__c,4132 +babel/locale-data/es_HN.dat,sha256=71FLaDfVW5pgllY-BoQoPaDjJ4lvhs_Fi9EBmJQjZj0,3051 +babel/locale-data/es_IC.dat,sha256=hwey8h4GM8i25i-YZR_K-jvCij95wZqr0zdTIKauP58,616 +babel/locale-data/es_MX.dat,sha256=6jxhdWleuQwI_O1FZOl2I5DEwUs3oXjAhJhyBmBCMGM,25204 +babel/locale-data/es_NI.dat,sha256=cF62A52GuQD-QU9-jBmK_8AJ5pZ1W_nJ7NwraSAhMvA,1227 +babel/locale-data/es_PA.dat,sha256=fBNNQGv937Iu4OPHxSuYtPu8M-u6xhUmG0LtMbxDC0E,2775 +babel/locale-data/es_PE.dat,sha256=G6ZcerCUvlSGQmeysFNtMNJEZwPAerVqwOG2hHUpZ_U,7244 +babel/locale-data/es_PH.dat,sha256=fEMZmVPQb97bBjEtCVMLn9JUtosTePmRuQqhpfNYkZQ,1248 +babel/locale-data/es_PR.dat,sha256=wPOPeV-O9rnLzNHObqs9JEUo2ouyqmaiXqtsxHtKpWM,3307 +babel/locale-data/es_PY.dat,sha256=KXiw-rkQCdcoeTv0t0SnA8ioZrHQYfPxen8491aSq80,4442 +babel/locale-data/es_SV.dat,sha256=JM9uw_EVtB6J8bH_Nz0GL_yr6ehay4uAPm4OJIiUmfw,1260 +babel/locale-data/es_US.dat,sha256=ifZ5PL9mZhnqv3E6uRoRS2Sqlkgyz53m2RJs9wDcpMY,22533 +babel/locale-data/es_UY.dat,sha256=31KdHVEWnE6fWuHa7KOdTLcmlWXn8M5liZZMDWlaVrk,2703 +babel/locale-data/es_VE.dat,sha256=kyxdQ51DhLNf6dQauAPw4vOlpjftw9CQgc3yH_uAoKc,2509 +babel/locale-data/et.dat,sha256=eTq6nG039wKW81vnFtx-qzaWVo0wiUey2Y2ZUQLl49k,175652 +babel/locale-data/et_EE.dat,sha256=JpcyzIDpGwHlLSiInuYO3HfxkMEFsDPBeMc-B8Rj3MM,653 +babel/locale-data/eu.dat,sha256=lEQD4nzng6_Fmu8zQtkrvoFWV5AvUaCpOaAlv7vknt4,178023 +babel/locale-data/eu_ES.dat,sha256=ABS9lrwjRkWenVB4fNrwKpr0mOuMF_eOlOrSrobcDl4,653 +babel/locale-data/ewo.dat,sha256=tHyC9Uj5Gkz_nGEiTCFjXn3veej5z1GUhr-j-Dl2vgE,16881 +babel/locale-data/ewo_CM.dat,sha256=likxlZJqzYOVxcG4oSUQLTiH5DjGjdAFsJPIjnnj2Iw,636 +babel/locale-data/fa.dat,sha256=ci_F95dki3wTXhl10yqZP7IomDg1FHIOArxqTEMUEyk,192269 +babel/locale-data/fa_AF.dat,sha256=3lXNqz0r7fjXSYzqZBKGD5gtS0cPs-lx1ExY_s1ucfk,8639 +babel/locale-data/fa_IR.dat,sha256=nPuexwzRHDb9TFMjILK_V43sVIzbcn_fgp0msY3eFQ8,678 +babel/locale-data/ff.dat,sha256=gT8MoHYFJcGDoVjBCYPzsrkMTKylOjXkE64Sc0L-rvM,15911 +babel/locale-data/ff_Adlm.dat,sha256=GbwYyVBbA8SAJP-1BYMW4b3HXivgi8HvRDzIaKuJtvg,326252 +babel/locale-data/ff_Adlm_BF.dat,sha256=eYQLbHvxtEqcJCMbXSkqN2dRSuYHVc6Tg9kOUKayJQs,637 +babel/locale-data/ff_Adlm_CM.dat,sha256=b3VqkcWqXc7s1hCxN60dd-yBRXkcXfMMQ0uAJKmSsg8,656 +babel/locale-data/ff_Adlm_GH.dat,sha256=r1CRe9Z8kZ3B3PDxmZQbvgpsEcY3OjJek9Z_S8FBb5Y,1236 +babel/locale-data/ff_Adlm_GM.dat,sha256=ZM17aBc8xznEjoP4f7HRCHaKn-DIxCSDGkL6GvDYvDw,1232 +babel/locale-data/ff_Adlm_GN.dat,sha256=HWkLsTj8Sd0fWYuYysHhShl08hg0iAvSXhPjy-rUjB0,616 +babel/locale-data/ff_Adlm_GW.dat,sha256=vIUl_C4PZSWmypeEmnsAUbGN2dSquM3nEOdBs22_qNE,637 +babel/locale-data/ff_Adlm_LR.dat,sha256=277rY6zAWlxetFe0D0JpVEY9MNcQiJU9kt1jRoiXE7g,1232 +babel/locale-data/ff_Adlm_MR.dat,sha256=qz618w1XY_zwZ27nB6LBgbzsjsh4UinfnuOVx2bqLgk,1233 +babel/locale-data/ff_Adlm_NE.dat,sha256=waY1EIQKuOkVzrtJ-t-5VY7cK2uKL0SIBO0PQbx4x9Y,637 +babel/locale-data/ff_Adlm_NG.dat,sha256=9UdHELj5G90YopBKktxDyWVQyLxl5f7P3ToBElwlvCo,658 +babel/locale-data/ff_Adlm_SL.dat,sha256=7jLKofwQBRggP61keprrbfFGXvrcJPIOvwEVmUNjcTI,1233 +babel/locale-data/ff_Adlm_SN.dat,sha256=nGazz6Tun3D-XsO6SljxQeeBuzvAb1sBQw21IbkDQKo,637 +babel/locale-data/ff_Latn.dat,sha256=APyNmlFYRwCQOlboY58qsqiF57rrI3F4fHu-uQTdt4g,866 +babel/locale-data/ff_Latn_BF.dat,sha256=Nym5keR3dDPMJBFr7ZyW2cuuY-qTMkdHzXnIHSmfD4Y,616 +babel/locale-data/ff_Latn_CM.dat,sha256=rWaVAF6D5gv_hDhNmSGbcWGpPV7X4gp53FBMXyMjT-8,635 +babel/locale-data/ff_Latn_GH.dat,sha256=-kMvFNIQyikTD2dFakV81ghSR2H584AigLgtmrzlhN8,1231 +babel/locale-data/ff_Latn_GM.dat,sha256=1Air8sk0wb0McqLZXDWIYQeiKgPusBaVjr4zk54IaoU,1227 +babel/locale-data/ff_Latn_GN.dat,sha256=7R-6dXYMBdveo2-9Vc7CjIA2H6y_hGJVbfVGIaJUgbI,636 +babel/locale-data/ff_Latn_GW.dat,sha256=2kbqhzcDeSPQxefHxynmrv2tmFVnWdRNjO7I3AZ6lxk,616 +babel/locale-data/ff_Latn_LR.dat,sha256=MQxcDQnMZC5hN52abzqCjVIL9Z5mA9wOyTqGPP4Oj0g,1227 +babel/locale-data/ff_Latn_MR.dat,sha256=CDUb5owq0Ntsd2lIZJejvYxOjl-NOUPP-v3tgVj1_qU,1228 +babel/locale-data/ff_Latn_NE.dat,sha256=R8C0fI8ql5XpnT29CrwBG8rgdHB1AASDBSdvqIqIQ1o,616 +babel/locale-data/ff_Latn_NG.dat,sha256=00rtiYbJD_ci8-0M4ye95rzGpbyX8qQ-dmFFIajAtRQ,637 +babel/locale-data/ff_Latn_SL.dat,sha256=UaWOeokdbSoxG0JUyyGWkDyz70sXy-cZbc3lXZxmQK0,1228 +babel/locale-data/ff_Latn_SN.dat,sha256=mPVac9iCnwNay8c7Ko3uUvg48lfyfEZrvhpyEFFGmFk,616 +babel/locale-data/fi.dat,sha256=Vd-z6RH112cP0k5AGOlAoYU1U0f5mpQQkiHypB844Jw,204853 +babel/locale-data/fi_FI.dat,sha256=cpbJU4KKG8OWbmLnc9TKTdzmpoi2AJh_Pu1cHhDwVSM,653 +babel/locale-data/fil.dat,sha256=g0INTCXppDgjTGgBHy9hqQ8Mcw7G9K3XLTLyVshWuuA,144724 +babel/locale-data/fil_PH.dat,sha256=JjoZt3zNxy1X6RnHoxUKOMzT-xMh3tGZBRq8cvrBwqA,636 +babel/locale-data/fo.dat,sha256=4P7HQxbB7uhYUyAt1rFID1mHXUe9zlQBvWCt8LDRhNM,148411 +babel/locale-data/fo_DK.dat,sha256=HUuarLNFSsV_gN2fg-OqrPr-6Ry6KFgitCp173jxAOM,674 +babel/locale-data/fo_FO.dat,sha256=SLeNQ33QTZ92kXCzQcFfo-OgwZVFPJKIeRivuvz0zo8,653 +babel/locale-data/fr.dat,sha256=HvPCR3ft-_VxUpJsVp1wKU8aiJ7eCKZEz9XZVlM5jek,213357 +babel/locale-data/fr_BE.dat,sha256=ODfkJC5kWWEEkjr1UV8AaLtKKc4sPCUxlIGkEDkTr6s,1085 +babel/locale-data/fr_BF.dat,sha256=7piWVeMMrZ-YbO9MNqJAu7ZeIdueVnhg07eeMwJHy94,616 +babel/locale-data/fr_BI.dat,sha256=R4kaU1OtMcNIcibkw8OFGP6FaYMxt2uKMRyidkEqbiA,637 +babel/locale-data/fr_BJ.dat,sha256=sel3fdwegY5W4NRg32t4MuXoqpGqTAGO_ffCF2NPggE,616 +babel/locale-data/fr_BL.dat,sha256=n-MRZjeHNkRMwCtGgPZq52Lj0ijntBsxfskC324i2k4,616 +babel/locale-data/fr_CA.dat,sha256=Nu60QdYyJaiQnz1EbBLSWIO86Rf57q3FWoU7ywZMKQ4,72420 +babel/locale-data/fr_CD.dat,sha256=HWaY-wrLseHcf0fGlRkAWt118iQjRZaTGlqs7G23ZrU,1138 +babel/locale-data/fr_CF.dat,sha256=wxzk0Nf6_pKO2VDivQprUY9WvaxRSkrfQBoUE1UVrAA,616 +babel/locale-data/fr_CG.dat,sha256=zP3HTP-nqZjG-OD_DLrDEPPbB3t9g4T2kHVzI-HxhaU,616 +babel/locale-data/fr_CH.dat,sha256=DiO5jczUyCwTWpWSoxVHE6kLMXQPru-XotJQLDInjKw,2876 +babel/locale-data/fr_CI.dat,sha256=TrHL8hQRuJI3Auxe3aTHYa_rljyUvT_s0q-jdSJflJM,616 +babel/locale-data/fr_CM.dat,sha256=31oDAmeRb3F8a4fvVn1QJyIbrla04w8kfC4oQO0vwkk,1970 +babel/locale-data/fr_DJ.dat,sha256=Jqu2FOJQD41B6fLSBEc_Wf-dIQ-B6MWlT0m1buQnmxo,1248 +babel/locale-data/fr_DZ.dat,sha256=uOe9lbjO51q30G0UMs5nKrMLta5CtLW2Fg4dvsfRX3M,1290 +babel/locale-data/fr_FR.dat,sha256=bwtjtv0NG-lxlXO7fJd6r--l38WKaQmqlmn7PpXJdJs,653 +babel/locale-data/fr_GA.dat,sha256=rMwS-msXjMO5T5k1BP2B2S9B_dYvDHlP8HMS-Lq8XU0,616 +babel/locale-data/fr_GF.dat,sha256=x97-H7H0h4_MUTpjMdrkYB790vBvPKKxmnUTu-FOwLg,719 +babel/locale-data/fr_GN.dat,sha256=6KVlBWrF76ZhgyYg47F1TcR8_fbE5Ii2pJzPhmbr3Pk,636 +babel/locale-data/fr_GP.dat,sha256=W99xHjqPQj_NJ1X34ismj8A4xeZcHu_vyqH8tIwXgeI,653 +babel/locale-data/fr_GQ.dat,sha256=Ogf5NI4zMvbVROeIb8F6h1NxJNKOqY4fKU6G2SPJXDk,616 +babel/locale-data/fr_HT.dat,sha256=S2Vvt2b9Wu4dY5Tsd9xxFAx_RLcWXCGf_XeSSQFYbKQ,1836 +babel/locale-data/fr_KM.dat,sha256=ChLpzCyulxYg8Qmm5HK8YkK203GRSUEBNPSl8war7lA,636 +babel/locale-data/fr_LU.dat,sha256=0sYBhn8-9lvfOrU-ZEIbnO5v03qQOQq4wXCKp70b2sw,729 +babel/locale-data/fr_MA.dat,sha256=Um7dK7MvHkPB_h_r0pk47rMFCng1LWFgIekS7cDX9ZE,1098 +babel/locale-data/fr_MC.dat,sha256=IfTCZ89rqHzUxdKyIz86Zs_VUH2zc5JAvntdhyKsNR0,653 +babel/locale-data/fr_MF.dat,sha256=xU0grNJKWgpfArwpLt7vuOpSTSkyPx3o6gFkmZLCxd4,616 +babel/locale-data/fr_MG.dat,sha256=A9zYBbE6gIWuGDPxv92ReIcR49gtIEYaEkCj9ZONHHI,636 +babel/locale-data/fr_ML.dat,sha256=-PoWsHBtnaZisIOqZyaEFmwooRXb2R2xEMe6DYad_sk,1153 +babel/locale-data/fr_MQ.dat,sha256=45qWAev4p2ZaFVky1Qlrw5q907PDfbRJq9q2UACahm8,653 +babel/locale-data/fr_MR.dat,sha256=mVSOABz3cRa1-HEeUKW13sLw1ZR6PmB9h_DPfZsK4Uc,1228 +babel/locale-data/fr_MU.dat,sha256=c4ERuS1GI8h7waxcW6BRtloW7BThLlgqdYTf31Ioh_U,636 +babel/locale-data/fr_NC.dat,sha256=Su2DaGZPnLCaONmgosMYke9kH6dP8xJ8wJF6P5xrJq4,616 +babel/locale-data/fr_NE.dat,sha256=D6ghYGdDXlhaVQ5gAr8wWHxEHYR7mBs0QaiNL5nfxWM,616 +babel/locale-data/fr_PF.dat,sha256=oPN2EBo1hpLjlpDYPB51qEAx_4HNMWG5-Bh9JN6Kal0,616 +babel/locale-data/fr_PM.dat,sha256=gEP6Ay7r-p7uIjOGXP8eCa62yujlTBntENdeNd9KKes,616 +babel/locale-data/fr_RE.dat,sha256=pxNaLi-BUbe3E-Xf5ZXPoeut9NdT0D9OGEgmoSWZEr0,1055 +babel/locale-data/fr_RW.dat,sha256=gP8mpM7gx_X_9NKDm8B9PuTg83jwT5Nn3NOKPpVhi3w,636 +babel/locale-data/fr_SC.dat,sha256=qvz0N08LKCsPCPDZK1NmAhhzmaszBQ8mSlDbAsEwAoI,636 +babel/locale-data/fr_SN.dat,sha256=n6ijBmMl-ztuCLSePI-Q3yIyhzejn7KvRw5ZqjDoXsA,1018 +babel/locale-data/fr_SY.dat,sha256=tpDovgZ3aK7OumRwbntHTknV-tRL_HjcPK1aQINC-x8,1290 +babel/locale-data/fr_TD.dat,sha256=1H47veWKRj_iV9CxHMz7x7tfrL8IYdQaRWhTV455efw,1208 +babel/locale-data/fr_TG.dat,sha256=r_E5Vnj0Kb5CG16ApHFls4UreDeO7-o3uzpQdJjpbRM,616 +babel/locale-data/fr_TN.dat,sha256=hcGRJ2UjuFEFJqb1BDglGsXY8jCEIdM8--OrU3OqRhc,1228 +babel/locale-data/fr_VU.dat,sha256=FYYsiaoM8QZeClMnQzLiLZNXW9hULz-rCgRTYWvrIvs,1228 +babel/locale-data/fr_WF.dat,sha256=jn6VFRw_qpJFxpO-I6C9nhz_wRZ8cV2b2XRBgSzi710,616 +babel/locale-data/fr_YT.dat,sha256=x0WpQCLoqrLY3_nCF7JlcuekkoUtcpE4llC8kRmeRmY,616 +babel/locale-data/frr.dat,sha256=Itmd93DOwAMGcTkWE83BWDS1oXEVckX0EE6mSiOKyoA,102994 +babel/locale-data/frr_DE.dat,sha256=2ohnodzECbJBUTEta36Ts4amZKl2_LDhuD0-Hu5JBo0,654 +babel/locale-data/fur.dat,sha256=pvg46WO2uwbg27leWyWYXkoqYFiaE1u9Txsd_iZJeC8,32441 +babel/locale-data/fur_IT.dat,sha256=PpDH1opUDjndOtvpPadiOtITGyGxKZY0ziEhb-4HKbE,654 +babel/locale-data/fy.dat,sha256=zJce96OaCoG-oKfhQFisyjgVEK3pNVtF9RT-f9h7y1g,108200 +babel/locale-data/fy_NL.dat,sha256=I_M2hFVCAaVAL90yVMloW2eYmzO5C3NZztfEDAes3_I,653 +babel/locale-data/ga.dat,sha256=rx5MLgtNUisB9V7gu0e2dNyCXF2H9KhLVULuYvLNUh0,261523 +babel/locale-data/ga_GB.dat,sha256=NKphVJhmH8egga1dgfO-hSRVFhbxms2JvGMU3ybgj_Q,653 +babel/locale-data/ga_IE.dat,sha256=P948T1Tl4B7kL1T-uxii27q4IWO3yQQ5emTLv7iHvW8,653 +babel/locale-data/gaa.dat,sha256=W9tUKmjglnSUxVlpiGA0clKmagjmzgF1Fwj_UPmg8Ik,33806 +babel/locale-data/gaa_GH.dat,sha256=FF7vo24vzA2ru3t8py246uanyOqyoSkpD65F7KFTXlA,617 +babel/locale-data/gd.dat,sha256=AtSvR97H05LvFNLHpLsb7tOgKYaOjYvWFOLaDDH6xMk,280763 +babel/locale-data/gd_GB.dat,sha256=weaRul21diYZoqLk7SXacBy8GD1bH30cQO6AHejilPM,653 +babel/locale-data/gez.dat,sha256=6gIHA3BFc3-A6-dOq0pc6bqP2ej6kmG9Xvwa0EEhoMo,12743 +babel/locale-data/gez_ER.dat,sha256=MKpSW7Upkpe42Q2mbJStbjtnrW6Kyo8Tg0zXAxnHWqM,638 +babel/locale-data/gez_ET.dat,sha256=93QTSMihpcfFyRhttFplgAcsAhzrPjlbrz5HI4feRSc,636 +babel/locale-data/gl.dat,sha256=N2zvS1gg8f3l6SOLqIIiKCBsbxAcArFclISemEyGx7Y,153642 +babel/locale-data/gl_ES.dat,sha256=us8xWRQnNTO_KC42-FOU2cnLCNl96591qnxZ4exq5Fc,653 +babel/locale-data/gn.dat,sha256=2CbBgzd3kHlm8uIpKVV3yurmEXB_yNUfM2NKTFV95dU,2477 +babel/locale-data/gn_PY.dat,sha256=tArgCo85T_BUNmPc4sXVRz8X5wcHJmBS6XP0r8dPgA0,635 +babel/locale-data/gsw.dat,sha256=TGHS38pKauNWMdFFsCyCJ_9p17aLt14jMA56gxTDBM4,95265 +babel/locale-data/gsw_CH.dat,sha256=fQlRCd1MJ_gI6rcnkrU-lUE7ZM4syRLh-suMRT0DCOk,654 +babel/locale-data/gsw_FR.dat,sha256=vHNQ1q9Zyf6xLfsJpmqpaX1iHerMRt1dsJSPQdQDoTE,654 +babel/locale-data/gsw_LI.dat,sha256=dsg7TA7MECMrbTXC7i7zXIjrEoqrF2jZ_ckGiTMholo,654 +babel/locale-data/gu.dat,sha256=5A_T6q__RzuWdGg9Sfte2wOqRw_Adz-LJMJJzFJ87cg,208242 +babel/locale-data/gu_IN.dat,sha256=shXUMyk4ogB8uJPazALoReGyLqRXSYOeVBVMn313_Y4,658 +babel/locale-data/guz.dat,sha256=491I3x6EkMG0roSEKI3sHxtaweXWNXhXyk4vsG-LzDg,15427 +babel/locale-data/guz_KE.dat,sha256=Uz_x0_YFKJHDkSd46SvuIfO7W0c-uqYnasmmLNib3WU,636 +babel/locale-data/gv.dat,sha256=Ye3v_q7SrnCeiOVw1r7NRcTtUZ3RwOr1ZKs6skxYTos,3960 +babel/locale-data/gv_IM.dat,sha256=bXOsSoV303kSUECHz2xd5HhASRI-XCjqjxnxpk0Bt10,634 +babel/locale-data/ha.dat,sha256=fVfNqCuIXaCTV5E9XNMNVROCwgalJ8f4MKfEvKun3Ao,150526 +babel/locale-data/ha_Arab.dat,sha256=AUoCyyrZDTrf5SEZ2SRizimC11NMSCyonIkMRer1PxY,2197 +babel/locale-data/ha_Arab_NG.dat,sha256=oYJYqTkaDX2p4IJ9j3sEJT49dcVn_f9JyjO0rUJTmAc,616 +babel/locale-data/ha_Arab_SD.dat,sha256=7DD6pzCmpEdjwbTMAbAb_vJey6Qh0tIeSs8LjEpJxBo,678 +babel/locale-data/ha_GH.dat,sha256=Cwfuh0nEMJu4LGZmdOXJHp_5fZRdpTIODJ_Tpd83uPM,1231 +babel/locale-data/ha_NE.dat,sha256=glKzRtSaovyoiyBc-vjFbJ0wNuxfga49w_zeK3ANtvU,616 +babel/locale-data/ha_NG.dat,sha256=oYJYqTkaDX2p4IJ9j3sEJT49dcVn_f9JyjO0rUJTmAc,616 +babel/locale-data/haw.dat,sha256=aNXNxqponTYIxzV21MX0jIzG73qbhbNO6px2WGael6o,10375 +babel/locale-data/haw_US.dat,sha256=W2qJBTNdETpoN-Ue0UYbqyblj-gIbQNOUMr01RwJ2fw,654 +babel/locale-data/he.dat,sha256=o6AACO6FcY_o6bcUuLkcWgbWIT77K8N8BTBDLY0hk7A,217062 +babel/locale-data/he_IL.dat,sha256=KpQ8sod_QOZ94Tr0tfhlATzVVsrqXck6eq7txoQgCbc,678 +babel/locale-data/hi.dat,sha256=TZ6kgfAZH0cuoX3Y7FpTEFJUEmlrSGccY9nWPDk27C8,221948 +babel/locale-data/hi_IN.dat,sha256=UMkxSHgYSdX-hPgYa7rOOzft7xtJwcM0m5nTphUe9xM,658 +babel/locale-data/hi_Latn.dat,sha256=Dn0MJdILlsVYU9R5BJFSPGGr1a35jF4k9ebJMKLX69U,30945 +babel/locale-data/hi_Latn_IN.dat,sha256=UMkxSHgYSdX-hPgYa7rOOzft7xtJwcM0m5nTphUe9xM,658 +babel/locale-data/hnj.dat,sha256=ryXdpBMEUzFyZ_u_YiqAK689QOsEuUO_Auyuhty_4jY,2117 +babel/locale-data/hnj_Hmnp.dat,sha256=6GekZXtZVXtGcI_zk6NqXq3WxMnOx83IpRlJOyUws6s,746 +babel/locale-data/hnj_Hmnp_US.dat,sha256=OydEowg2bNVks5nd5ij7ZJqqQT0ztYv4HL1ZZ4gNajw,654 +babel/locale-data/hr.dat,sha256=kdzKpWmyLAIFw7D5DPKG7aHUQjYlM5fctcBLRoHeujg,207636 +babel/locale-data/hr_BA.dat,sha256=E_S8FRdn0yszTWFg9RlqTV5zEwCc7-qtod45Ud8LHyI,1188 +babel/locale-data/hr_HR.dat,sha256=PqaNYKNdTFgfgmeiINdYp2d3q8qpfkCUs1y4ZHmsphA,635 +babel/locale-data/hsb.dat,sha256=w5bDS336hxU-RChl4QgaayXgMgN_VBUh5GJXznPI_Bs,206887 +babel/locale-data/hsb_DE.dat,sha256=_ELT9KBswSqeyiwbcsP9nFY793FE8PQzEu_2w78Amro,654 +babel/locale-data/hu.dat,sha256=dmS-7GInw1eGbifjgMyXc1m1nBg6dK6IOJIDoLb_Epo,147032 +babel/locale-data/hu_HU.dat,sha256=r3RZskHfUdk1Ba226wqBHAoRMXorlh-IkWLlnY_mBTs,653 +babel/locale-data/hy.dat,sha256=R6n2G8QdkkxlAxBgpTK7l-cPhwHg03vIG1pwmWVrCV4,202316 +babel/locale-data/hy_AM.dat,sha256=r1Bb6WWX2QxVlLP5vRVgox0HgoDOosA-h3oYKLeZMIY,635 +babel/locale-data/ia.dat,sha256=Wa4yDTDv9TA2Imo69v_49GqgV8LvQP1iuWGq6LFAMOk,133538 +babel/locale-data/ia_001.dat,sha256=fzAkHPu7PNj2TOl-kQcJLIdlEK6z-KfVFUVcy-YF5Zg,941 +babel/locale-data/id.dat,sha256=CfCCzK3VV98obeH7x1Ueax-xYczfCwextwJ7aetTQ5A,126977 +babel/locale-data/id_ID.dat,sha256=GvwO35RP_Y8vswE60ItYMQa7XUOBXGLk8tvL8kSJkY4,635 +babel/locale-data/ie.dat,sha256=9nzS8srJ9Mze83D7nKqXSlGvjOtu7utOyAJCLaffEm4,77957 +babel/locale-data/ie_EE.dat,sha256=93dmapYNE5HEAfIRwL_HjNV4fpCJhy1CseggbriCXL0,653 +babel/locale-data/ig.dat,sha256=ts_BawFD_ves9B7kX6GAIxwBY8FP4jNmkZidIdAVaDA,78550 +babel/locale-data/ig_NG.dat,sha256=2MR603ed1L8Y_aZhXPk7K7J8bgQPE4xvvpn8R9Jodiw,616 +babel/locale-data/ii.dat,sha256=WBkpukOuFcoryzq0QnHhdafGfad_u9vdJy0JO9vo-iI,7477 +babel/locale-data/ii_CN.dat,sha256=Vr_Oe23kFnz-EDfl7XeDv6GeTY0LSK-VV6UJpzU8yJE,635 +babel/locale-data/io.dat,sha256=laqBHV7QB933VjLibEOmRezXV9StwhKVzKvWp8e62YA,932 +babel/locale-data/io_001.dat,sha256=T6zZvvSVOcdpy3fhXbdPAWmHCvDTluick2U8_hUDu2E,912 +babel/locale-data/is.dat,sha256=r9gnQpf81NqPVskVKUiSGWa6VU3_NXzJcna1Gho28d8,163097 +babel/locale-data/is_IS.dat,sha256=f3tUj_oYhQ6_tGnn8yda4PZfqChiHmcZXo_nMDCtzSQ,653 +babel/locale-data/it.dat,sha256=n8pxKaMuS2ekD7EOSV-3PmVfdzm9NqxF5zA073x5itU,173579 +babel/locale-data/it_CH.dat,sha256=Tvtge1s4BcbCeKJmPBiSbtbf_qv8wrw3Eb4Dc1sF3dE,2942 +babel/locale-data/it_IT.dat,sha256=-e6EK0A6gEd_G4_BHlmd8_caQ-k_JrEemNgdA0czhsQ,653 +babel/locale-data/it_SM.dat,sha256=xjE63TohE8bjkNiOh-BhOkuB9YWpQ0n2rrBMJoAql5E,653 +babel/locale-data/it_VA.dat,sha256=wwsl_eAmNu9m2JPZnpBwFVh4gsk5AM9lSx8UAXhrMlE,653 +babel/locale-data/iu.dat,sha256=vZIG1AsqwcrTA6zfwBeQydVAn5qDQXT8yTK8wvbaVAA,3209 +babel/locale-data/iu_CA.dat,sha256=C449KxuskTW8w7z56Vv602QRYsQ90O0WbazR7VqlDa8,635 +babel/locale-data/iu_Latn.dat,sha256=oYsdWLomYvVJg6kIQIKYOdSGWyrEHftc2U9bZ0sHFD8,904 +babel/locale-data/iu_Latn_CA.dat,sha256=C449KxuskTW8w7z56Vv602QRYsQ90O0WbazR7VqlDa8,635 +babel/locale-data/ja.dat,sha256=86xPBOY1H1e0fLC6g_61R_ipS4QGbB9sXst_JwwdAWo,179695 +babel/locale-data/ja_JP.dat,sha256=o2pbFmlkEZjV7CHE9cYENYVv2kQA8texhNDhEecgQ9w,635 +babel/locale-data/jbo.dat,sha256=2eB9ymOoFb8abB-v7ISAGcAg4HEEMmpuseHIXFgtqkU,1008 +babel/locale-data/jbo_001.dat,sha256=wwLKEXJOwULYD-q92kQdvpiwW2fgis5YcsP2mT4tnT0,746 +babel/locale-data/jgo.dat,sha256=9X63SqWqQ7TK7Z2RKaQwFBP9sMog_4cQN5Sr_KBlyL0,9031 +babel/locale-data/jgo_CM.dat,sha256=1lDyjZLpK6fS6oSpfnVLdYd2IUgGlUQfF53BDdK7TLY,636 +babel/locale-data/jmc.dat,sha256=lRstulkfCj6kDI8VLH_3GS4awAqVsylMU1hvvWH7kJg,15374 +babel/locale-data/jmc_TZ.dat,sha256=fODp_OsVygbH0UoRsx4HHcXrde02bRKc-hy80sDkcK4,617 +babel/locale-data/jv.dat,sha256=SucM3ZDoHXO7PsbOYNLdx0UmQqWUll2i1hDqn-zJY9U,103138 +babel/locale-data/jv_ID.dat,sha256=G3zTSeqWMngemp5lAcghudTcv-i8egZS12P0-T1DNXw,635 +babel/locale-data/ka.dat,sha256=dIskDjc7ZdRZ1rGJIHxOP_47WO_cdjLDx4eltYETbUE,230234 +babel/locale-data/ka_GE.dat,sha256=zzw4NZBk8dsHIBeEzB3Vtf2_1nC4DhqblLoBUXfNHN8,635 +babel/locale-data/kaa.dat,sha256=KjLQ7_UT8pqVmgqy5BXJHe9hbPceKi6AIyefM4_0pYU,17585 +babel/locale-data/kaa_Cyrl.dat,sha256=zW7tFPX2CPo0NwR2o1DCKu8Tsvm-Aef9RAuy6AcaJXs,693 +babel/locale-data/kaa_Cyrl_UZ.dat,sha256=DugGAZvImbUSHvvGmGw0ekXXBj34vEjSkHhSxVXbc-g,636 +babel/locale-data/kaa_Latn.dat,sha256=zW7tFPX2CPo0NwR2o1DCKu8Tsvm-Aef9RAuy6AcaJXs,693 +babel/locale-data/kaa_Latn_UZ.dat,sha256=DugGAZvImbUSHvvGmGw0ekXXBj34vEjSkHhSxVXbc-g,636 +babel/locale-data/kab.dat,sha256=ykLRvdRtHpY8y7JDHOgC03KxAyvAfxzYQUl44CKKr6s,121528 +babel/locale-data/kab_DZ.dat,sha256=v6fd0kyletm1kfN2ibSUh6oddckpLHjPd_qrq6FQpd8,679 +babel/locale-data/kaj.dat,sha256=tKKi4eYHT0zEJLSHi2DefEGyTTu4RCKpnANu7NQhAPg,2696 +babel/locale-data/kaj_NG.dat,sha256=1RODrBAPxCrrlTgfhpdz-VxQkTdjJEJYHaJEsOgQsNk,617 +babel/locale-data/kam.dat,sha256=br3FOMP0rS2tAq1tSXwYq197v2XXHqWtX_TM-39QP1k,15506 +babel/locale-data/kam_KE.dat,sha256=8AQQhHQdaI4rBKXfTivg884XIDfZlbDEQM28KwvB2Og,636 +babel/locale-data/kcg.dat,sha256=dOZR1bP8sPbhD2Mk496Twz8MOivgGQoliuDMAWSO9fY,2549 +babel/locale-data/kcg_NG.dat,sha256=jCObRZa-t9Khgx_M8ps0PLbeit7rPCFtHeCOhtfCnOY,617 +babel/locale-data/kde.dat,sha256=cFVUYeayn6-kMX6PwQQ3J8rpHMql07_V7lSluInC2x8,15810 +babel/locale-data/kde_TZ.dat,sha256=2sfb3gejYM15YtZeRrc0AJgdaJhqgbVJ9c9yF9SlJmg,617 +babel/locale-data/kea.dat,sha256=o2awnBismFEWQemtUPASmZMVLlOkJNDtuD6egmvMatw,76097 +babel/locale-data/kea_CV.dat,sha256=LyzxPE6yP0f9hdD4uvu8CvEp8nmcmRDVuRI8YxBQ5wM,617 +babel/locale-data/ken.dat,sha256=PMrEuqYRQIhbpP2dPowHOL_NKKFpEBd8qNUV_NpZnDw,719 +babel/locale-data/ken_CM.dat,sha256=jNEojAAtQqJMkEq84kxHU5hGOVQCOW_hnGQScxycYMo,636 +babel/locale-data/kgp.dat,sha256=OKx1ZbBdHw75AdzrT-petm32Dj8wJdtUQH_oai7v0qI,184092 +babel/locale-data/kgp_BR.dat,sha256=FNSYAqPhkzoZzholxTydgasgkuw7jgxCfyKDbeRiLt4,636 +babel/locale-data/khq.dat,sha256=OcW4Zprt-WlTePo7DzquB-yS8vwfPqjaijpkrX5l75w,15753 +babel/locale-data/khq_ML.dat,sha256=ViqThOcZTHZBtebV8LJY-DXdWVX5jAR5pdlBrTKws2Q,617 +babel/locale-data/ki.dat,sha256=vffpb6Wy7TN__hZQH1SJYi81AxamhBnEK_XBCiF3OFc,15451 +babel/locale-data/ki_KE.dat,sha256=PNoxhP-WLxW2vH3fS8N9Nuy0tVimMP-ZAaCfLfnfDN0,635 +babel/locale-data/kk.dat,sha256=93jtpKcfiQBRbyeOyJgqETZXGOntosB2nGedgHShM1w,200871 +babel/locale-data/kk_Arab.dat,sha256=TBsZm6iLJ_dw2mNxDdQk95jELZ87mArNl12iktCwKwo,222820 +babel/locale-data/kk_Arab_CN.dat,sha256=HCoaBi32ENdpJx5usXdBR9aR__MHFeKV-wTo_53tQNk,635 +babel/locale-data/kk_Cyrl.dat,sha256=z3n_4vbUD_OcZhi9Tm8vkSu9h4RUgavZ_CFrujFbuWE,1584 +babel/locale-data/kk_Cyrl_KZ.dat,sha256=eaQW7Va1z2L34hs-D9QgrmyvOo4Lpy2uxxvxms6kL4s,635 +babel/locale-data/kk_KZ.dat,sha256=eaQW7Va1z2L34hs-D9QgrmyvOo4Lpy2uxxvxms6kL4s,635 +babel/locale-data/kkj.dat,sha256=IYeF4Uoeb0kfxooFLFcqmdIwGWbWh0MUfBpztTxWFEw,3373 +babel/locale-data/kkj_CM.dat,sha256=gqHwzVPG_Lo3svaIVe0Kfhj4DaKtstOxJJhUGvvpSbI,636 +babel/locale-data/kl.dat,sha256=D8SSjxLZliXOxyTxpC1x7jYbFQn4WbSV3lfotFFt3Jw,47570 +babel/locale-data/kl_GL.dat,sha256=c49k11GtBG8-vExsQNo_d1pFaQm0LYmXl7QcMSTEApA,616 +babel/locale-data/kln.dat,sha256=pldtRERWUhEOA85_zeFJfshpMl6gtgdELjGyNGtJzOo,17427 +babel/locale-data/kln_KE.dat,sha256=ZhkKgZ2lTdWAvWVOJEFlp4ASvjk2hcyTc2_P9s3mykQ,636 +babel/locale-data/km.dat,sha256=TueDML7PuHjlME0Bew9xgkFSFIxBOsJTzpMwyjyvuXs,176653 +babel/locale-data/km_KH.dat,sha256=bnykdq-RYJ0ZwajV5dFBVtM4anVkLjXutFdUxKByQ2o,635 +babel/locale-data/kn.dat,sha256=n0AHHLkpl4FIYeiSCEMDJF9mFr5nCgHcV8HSCOKz8yw,267281 +babel/locale-data/kn_IN.dat,sha256=rx1LJYeAP8xU6MIU3yhHLuije5OQWL_wzz5glztIdi0,658 +babel/locale-data/ko.dat,sha256=tYIinjTM5ZLw-AvWerUR8h4FRQ09LGfoRNyutl2iMLI,154621 +babel/locale-data/ko_CN.dat,sha256=U_q1api28ucaC-ABOBb822CgSq4nywhMN02uS7TCREI,1187 +babel/locale-data/ko_KP.dat,sha256=BCMOKQSzXNnjAUWfZZ8pbFoSDBed9tnnatyqIePNWio,816 +babel/locale-data/ko_KR.dat,sha256=CJqKij0oULIeCIG8McohdnhEsfJxUwmJHOpJY1bLrNY,635 +babel/locale-data/kok.dat,sha256=1pS0SXgetR-9DHtL71PAw2VIRp51a9KfxoSnw3BoxFs,179992 +babel/locale-data/kok_Deva.dat,sha256=EP15THeV74hd5G3DDXlwIHzxQvpECa67TioBGaur3l8,693 +babel/locale-data/kok_Deva_IN.dat,sha256=GiRy8Q6VCULzgIxNPFEZzABKOg13Un-DblBwXnBSeEk,659 +babel/locale-data/kok_Latn.dat,sha256=jVrQX1SeylbWO6B3ana7r9r1sRvMyOvBVwPfyXxB4uM,29867 +babel/locale-data/kok_Latn_IN.dat,sha256=GiRy8Q6VCULzgIxNPFEZzABKOg13Un-DblBwXnBSeEk,659 +babel/locale-data/kpe.dat,sha256=AHR_ZG1p518D4yulM_cs5E58iMsVXKk4Hi6k0V0IDhQ,1331 +babel/locale-data/kpe_GN.dat,sha256=7eabSFmszupn0IlzP6TRg1-7FZS9AB3JdBkDgJtIs64,1210 +babel/locale-data/kpe_LR.dat,sha256=4O2gzHn_orogC0qOiIyIox-JjyA73hEAe_fZ3Fj5tYc,617 +babel/locale-data/ks.dat,sha256=KySSApsfBfxM26TaXsK2gChd3noV1e5l41gUsaC3DA4,111691 +babel/locale-data/ks_Arab.dat,sha256=fzDL_rCiC-BqymPhF6GBX-d5uVkvZCE4e8JS2L8cjRU,850 +babel/locale-data/ks_Arab_IN.dat,sha256=-OE8PBigMDH8zQrxiaffmabm91Mi8-OVdDR2JEK8xPA,658 +babel/locale-data/ks_Deva.dat,sha256=weXN4SV8247g4MW8R7MHXM6sKk1qhf2Wmowls_zowAM,12510 +babel/locale-data/ks_Deva_IN.dat,sha256=-OE8PBigMDH8zQrxiaffmabm91Mi8-OVdDR2JEK8xPA,658 +babel/locale-data/ksb.dat,sha256=vbB4JVStmpZIu9_vi6f9-Dt40sN2wPvF9Y2JzJJ9oEY,15356 +babel/locale-data/ksb_TZ.dat,sha256=PvWBMUhpMhV27zE9BCEJW8oMqRXWK-6VwmSsXZDMTPY,617 +babel/locale-data/ksf.dat,sha256=IIgvqtnlTxMmLSk38JyZe0PA5gLEX86ZDcaVIULp7Zc,15952 +babel/locale-data/ksf_CM.dat,sha256=0OOsuUS0S_AUxUPySFQOZVbPcB3F2I4yzHZm63YypDU,636 +babel/locale-data/ksh.dat,sha256=M6W02xiGUibDW13RIB7psbwMA2wdNYQHz3Bp9XljhZ0,76781 +babel/locale-data/ksh_DE.dat,sha256=EhgYIJQaC3LGiWrcE2sdfUC8LOWJnciWORi_yoRkOvw,654 +babel/locale-data/ku.dat,sha256=beByrhXjB8iRhaNGxkQaxnUckutus3MJ61Pm-Ro8SqU,117087 +babel/locale-data/ku_TR.dat,sha256=LoNyoL-poYXgqejDzB9-zI_0TIJF3amwyzcs6UnHUII,635 +babel/locale-data/kw.dat,sha256=x5JFxfv4DvLd5Xnq5J7JlbcffhYNXwIn5-Jp3Q5QV5A,7242 +babel/locale-data/kw_GB.dat,sha256=ol7LWhJJFNoNkFEjtk4x1PpLkML9UbuVmZAuG47LokY,653 +babel/locale-data/kxv.dat,sha256=AMdZKJIlfkcpSetPdGRHX8LLN0O1s14NAtDzekSi01E,69503 +babel/locale-data/kxv_Deva.dat,sha256=MlejiNswS_LJAemj-vyEyvXc2SyminqNCWbaq3eceKk,86834 +babel/locale-data/kxv_Deva_IN.dat,sha256=Z43Yc1G4Bsmu7KukFfgXfIl1Cq2Rqa7RQQNYygE5Aak,659 +babel/locale-data/kxv_Latn.dat,sha256=XqtuF9yh0tBrDPoRpZj_1Mw-QUqt98klOlgZXh7qPus,693 +babel/locale-data/kxv_Latn_IN.dat,sha256=Z43Yc1G4Bsmu7KukFfgXfIl1Cq2Rqa7RQQNYygE5Aak,659 +babel/locale-data/kxv_Orya.dat,sha256=lsjWswZU3LWmYNE5tLn9cla-WSbdfqAoltC_OvxtR28,85964 +babel/locale-data/kxv_Orya_IN.dat,sha256=Z43Yc1G4Bsmu7KukFfgXfIl1Cq2Rqa7RQQNYygE5Aak,659 +babel/locale-data/kxv_Telu.dat,sha256=rXJrWxHMFrPeheoNt9NvKLzNoGLpNXiHpc4PsuS4tX0,88218 +babel/locale-data/kxv_Telu_IN.dat,sha256=Z43Yc1G4Bsmu7KukFfgXfIl1Cq2Rqa7RQQNYygE5Aak,659 +babel/locale-data/ky.dat,sha256=PAH_ov1xcnJAie5ltB3I_XAUJsrE_8tFwFlOjorRBts,179889 +babel/locale-data/ky_KG.dat,sha256=CdtjRR2iZgfG5pdz13MX-EHTDtN6BdLeZwGCmrZnrkU,635 +babel/locale-data/la.dat,sha256=0TAdiOxADg0C2AeIj5RRxiLgMbVO-PqRMf4GAm1M4dE,33982 +babel/locale-data/la_VA.dat,sha256=dhULocaXyJGitrljd1w688DTmezcmmY8YcoKsT30n34,653 +babel/locale-data/lag.dat,sha256=mtjtyLHLCfoUr4STtBqLXOxLnZ0igugTC9fZiyJZk8E,16281 +babel/locale-data/lag_TZ.dat,sha256=LlfEls8DDvoVp07MYnFdLBPUhkJs2kzwUDk45BZIO-g,617 +babel/locale-data/lb.dat,sha256=lUGm84DfwLgQ3vC0mL_foFf5dSZZKDTIuwCRf5BjgVs,135641 +babel/locale-data/lb_LU.dat,sha256=s0AY2-F7BqA4tMcRPjCfbzbXRbHsKnD6uIQGSkulCT8,653 +babel/locale-data/lg.dat,sha256=LnMo-qAcWHbbAuRmCTz4_nBGHgUx0aojWG7C8TFn__Q,15834 +babel/locale-data/lg_UG.dat,sha256=nyn_HKdBHGkHlbjlDX28L5Z9k59MKFqvmVL3vg222s0,639 +babel/locale-data/lij.dat,sha256=Ic982St82mPMfuQqqLswPtOy8LlglfcLYk_ftIDM65Q,129648 +babel/locale-data/lij_IT.dat,sha256=rtPerU7ltwkHHc7HErfwJfX8TDSCpTHvBzwKBdSt4x4,654 +babel/locale-data/lkt.dat,sha256=U_yXNWWJkqlepaZ9kS-FVOAHQKVmc0vhwgWgFRzXnqc,11180 +babel/locale-data/lkt_US.dat,sha256=ywWg9m80tNjumAxGNrBwYhXhc28rC4OSdyvkdXAKs5Y,654 +babel/locale-data/lld.dat,sha256=2JBQPu8T-cMVqzVOFs0Vz-0hU2RtHMyTvj0F8wPl2EU,95451 +babel/locale-data/lld_IT.dat,sha256=rHSiZg_-Ba6si2LONUCmQ841RxcX2p7V1jDSuwNNBg4,654 +babel/locale-data/lmo.dat,sha256=GYoR98Ap5hosG9bfENEA3sCkR-msF_KvxV2nLydjs9s,1659 +babel/locale-data/lmo_IT.dat,sha256=Xg4Qvye_hPNJLCTwoBuRMAvhtjQb8VlD9SaH_5hVG9s,654 +babel/locale-data/ln.dat,sha256=OHqUbo7M-600CtpOUNqq3B-Tt0_L3c2GgyR2xZhuMmE,23909 +babel/locale-data/ln_AO.dat,sha256=VNcFViSaGw3f92D60Uk7vxQ8i6Q9H1FD6paDpJh-r4M,636 +babel/locale-data/ln_CD.dat,sha256=Ao_lUWuswJgGHhVJYs2_Z8LyN4iqgYsAda8f9UarT6s,616 +babel/locale-data/ln_CF.dat,sha256=g5Jy7ovUkwcn0W5Ov5bu5SBc2iM4SWwUFwtzWzAAb34,616 +babel/locale-data/ln_CG.dat,sha256=jQld0yw63ufWbhlOt81wjf731zZluc2zWc1A65kBlAM,616 +babel/locale-data/lo.dat,sha256=hXtgT4nkqb8h669TsazfIFBsK23QNpcCZbqvb6SXWBo,189363 +babel/locale-data/lo_LA.dat,sha256=gNa7KRGYWI0h0PcHJ35bwnPskILOH-1jLjHCXP85jaU,635 +babel/locale-data/lrc.dat,sha256=GbK-bWw4TlGvGRyM4WxDujkUr7Gdz9k2A__fSelwEdk,13594 +babel/locale-data/lrc_IQ.dat,sha256=cy9DO9oAKI51NMitAb2MTbZoxtaAPzaYVGV0-xd0mGA,1255 +babel/locale-data/lrc_IR.dat,sha256=-ca4EmTX5VAi_5tDfimpevJFb-g8vAjgpe_jkDTDZWQ,679 +babel/locale-data/lt.dat,sha256=1h5TjFvNSuqrE3JntTmnLN9wW69jfkVakAIICcmoVbc,262613 +babel/locale-data/lt_LT.dat,sha256=j8dIQrFc0s77xJ4P-UGiDcaNqZW6CXOEiOh30FemNiY,653 +babel/locale-data/ltg.dat,sha256=qRaChoBWcmkL8As9MgCysSh58BP_F3US65EaA97ZgZQ,2632 +babel/locale-data/ltg_LV.dat,sha256=Gm8suGbSLaNGzzWPjuEKVdEqJH18ABue4htegryH3bw,636 +babel/locale-data/lu.dat,sha256=4TGAGkYbDHz6QAKQHHXoRkl0Wx-0LOiMkTjDgwJq0TU,15331 +babel/locale-data/lu_CD.dat,sha256=K3k0wMpIbjusgPC2W1q2sxyxynx2M78zOLjt4ikcoZA,616 +babel/locale-data/luo.dat,sha256=xJNSb25OVQogO42d-Jy2fR1FzeSfW9Swwt9Wat4EmsA,15201 +babel/locale-data/luo_KE.dat,sha256=jVUd3oO_U7IP6KmvSkVHYNmlCc8_-m2mpJMBaqArSFI,636 +babel/locale-data/luy.dat,sha256=pcTbaSctQyVgVVh4nXoXxMQGZa3Ip7hsfRN096zwEsY,15030 +babel/locale-data/luy_KE.dat,sha256=NVkQAtmDBXUws3KybnM706J3lwUc5fJo-YEjKd1zhiw,636 +babel/locale-data/lv.dat,sha256=s10obHsTYkBF99rADGvkxupv--JkRPQS2aM6sWvbM4A,201861 +babel/locale-data/lv_LV.dat,sha256=oS9W0pdiTNtMTeGOsef2K7Va2O6k-dQEtN02qCaAoFw,635 +babel/locale-data/mai.dat,sha256=Foj4spiHhuOjBZqaXQxZNCWwdCoslwB7KSX6nXQReu8,95488 +babel/locale-data/mai_IN.dat,sha256=DoclpHa5nlHcAflg286ycOjQ6trZP8uHThzcp37Y91E,659 +babel/locale-data/mas.dat,sha256=xxugbgGc3JxvM2GzV1vmKy1buszviy7NtSH-y6GdMZ4,16595 +babel/locale-data/mas_KE.dat,sha256=zH3Le4j03YNsPjt_-GL5RvPG0znnJKQ3ifbLhMZsoYQ,636 +babel/locale-data/mas_TZ.dat,sha256=VyRJlBqV_fukTqSR9Jxr-PujSA7u-MP9aXrJBVJCKiA,638 +babel/locale-data/mdf.dat,sha256=NQH9Yo77oyvxZj_93XIf0e00JDAoI2ydlCSS3klNgwk,2240 +babel/locale-data/mdf_RU.dat,sha256=sVnTxgzU2rEwl7P4d5UY6XOKv1XUCbtkEQO0cu2OlOk,654 +babel/locale-data/mer.dat,sha256=WFl2qQThWrilUbBaN4UJQb97ZrV3uOB4ZTO9kXsjtnQ,15426 +babel/locale-data/mer_KE.dat,sha256=WqDQTsO6BtbROdcj3p3omUZk8XB6HiJrIlCCj_wLPxo,636 +babel/locale-data/mfe.dat,sha256=n5lJPfd4pjC3xmVm123ivVpjg-WAkLQq9YONw1JlpTs,14835 +babel/locale-data/mfe_MU.dat,sha256=MHUOKiQPHuUbhT6hQXJEkpGDvTUyMV4btJTuiLhJQ4k,617 +babel/locale-data/mg.dat,sha256=9PbZhJ2v9RP2XSzwv7bBPTGlSNYJrUUISNkTwdF1Z7g,18776 +babel/locale-data/mg_MG.dat,sha256=uJbGeEzIn4Rh5Bh4hyV-Hs0_qez9KBeOi4hvfC3zkIw,616 +babel/locale-data/mgh.dat,sha256=ezIhzOd-qzUBRud5ZPjbtBBc_mON2HuKGu_okOahCbk,9753 +babel/locale-data/mgh_MZ.dat,sha256=aFZZ41qtARE6CeecCEx99tzW_fp-XfkAc10wpQ5YeGM,636 +babel/locale-data/mgo.dat,sha256=xyRaEmGV6Fw9nVfReQJY7KfgGwdnvQzScLiH0appsLU,3549 +babel/locale-data/mgo_CM.dat,sha256=Nsp33t4abZsKdDmIgB8tb08OsEh-7JXMY_JKCsd61zY,636 +babel/locale-data/mhn.dat,sha256=RpSxxevhvYxyX0dq1RAhIqoREyyPwKjsByXvOhQkAMc,693 +babel/locale-data/mhn_IT.dat,sha256=3UoH_l7yItN5qXKPaq6bWK_CvK_wD68zkxzLrCwxr9A,654 +babel/locale-data/mi.dat,sha256=ZlyyKSUJCtl7z94uIwEFuC6uBGWXOTM8F1TJLiJeSmw,85086 +babel/locale-data/mi_NZ.dat,sha256=RElP_P4F1HDHjSHsdt54vriFcz0TcIeT26pm-_dy-Mk,635 +babel/locale-data/mic.dat,sha256=Sp71dA3ZhTiiPTfk3b0Mm6y6CM0J-mGR0av-psrUGtI,1638 +babel/locale-data/mic_CA.dat,sha256=uZoBvRFux6M40HcGau7E6V0Pyxh45Bxi0SFngOxLWRQ,636 +babel/locale-data/mk.dat,sha256=xVJU-aubw2FQ_THzBUGd5LHR5IU1VjGkPOeRHpU-T98,216606 +babel/locale-data/mk_MK.dat,sha256=qlI1ZtLgyX2fcYS9pnTa8illdSnPmfNXORjws-H93lc,635 +babel/locale-data/ml.dat,sha256=tR0lt2uQuzmsBgXWIuRpz-AzD00S_OrvLc-QkiYAX-U,246736 +babel/locale-data/ml_IN.dat,sha256=VwCnSFs3oh7xo4-nS1HzWj_xICDzG6E-AW0Oxi6Lu08,658 +babel/locale-data/mn.dat,sha256=O3oSpnDd3Pt-dRrwdg1v245S6Iym3SBnZZ3gqOhQW5A,183647 +babel/locale-data/mn_MN.dat,sha256=qhJGIDXSglsa3BYCalsusoyiKgOj7PJ90Yi4ET2-nxc,635 +babel/locale-data/mn_Mong.dat,sha256=zqCuL28Sx1DS8LGqtC2nyTCoEpSFpF0vE3wvBxpHK1o,1726 +babel/locale-data/mn_Mong_CN.dat,sha256=WTF89EShdtBd0Vz62erFwl9KTG-GgEyzjjmKWuJCFH0,635 +babel/locale-data/mn_Mong_MN.dat,sha256=BTah7qfU9QayUb7evUKdF9c4Ptf4NqqO6SUeUql2Bak,12935 +babel/locale-data/mni.dat,sha256=aS_XIOmHRptFT_dTFuxgTvB2cEPKHJVVM_vtURTFo7A,12972 +babel/locale-data/mni_Beng.dat,sha256=7PTKZT_UE3WNiipyGHnn2SDNFNhAcqHhEJ8T0Y3O7gI,693 +babel/locale-data/mni_Beng_IN.dat,sha256=nAW_LfRtJqC6-ehdC8yyszjhibXqMAXPkuaz8POQav8,659 +babel/locale-data/mni_Mtei.dat,sha256=zdzwNyaRIil7lkjEf6ProQX0nwYlc5VF4r4gHNTUVTY,1720 +babel/locale-data/mni_Mtei_IN.dat,sha256=nAW_LfRtJqC6-ehdC8yyszjhibXqMAXPkuaz8POQav8,659 +babel/locale-data/moh.dat,sha256=FuywEiFRXQe1GUv9zPR15KOsZLr1TykmuglinLINTqE,1316 +babel/locale-data/moh_CA.dat,sha256=AXdrS_As8DrrTGs5IHmQwXoEXndFuoWoTGXPXcL4Pk4,636 +babel/locale-data/mr.dat,sha256=UG0FkufUtQ7qvzcK_WENRq6SgPy4zAcviYDQL-NrGY8,234157 +babel/locale-data/mr_IN.dat,sha256=HOu9QR1BLbciqF6BeTfWvD0L5Igwv5HrCWu9y_vNns0,658 +babel/locale-data/ms.dat,sha256=l_YQob4w4jdu0U-Z-eMYK2bPAyU0Xeekar0olT5G21s,114970 +babel/locale-data/ms_Arab.dat,sha256=9zretwvdo_9N3SIxLKsUtDVNZlmh0OhrPDxmtWqw22U,14359 +babel/locale-data/ms_Arab_BN.dat,sha256=vTEKSh0hjyiWJhf503-fwjADvTCN0AqRSzF6muL52JE,1335 +babel/locale-data/ms_Arab_MY.dat,sha256=w6ZZrz3qEmnsLsWtJA8rTohqF1cxctkzSj4WN0XHuHE,635 +babel/locale-data/ms_BN.dat,sha256=vTEKSh0hjyiWJhf503-fwjADvTCN0AqRSzF6muL52JE,1335 +babel/locale-data/ms_ID.dat,sha256=ZPgnDJgiycDHGZnN3Eg7OgZp1jIYtiZzMqm9f3LOtR8,3440 +babel/locale-data/ms_MY.dat,sha256=w6ZZrz3qEmnsLsWtJA8rTohqF1cxctkzSj4WN0XHuHE,635 +babel/locale-data/ms_SG.dat,sha256=jsfNag5WQWdejzh5hayA7_-IbY03MUVPAPDHUJyCZRg,654 +babel/locale-data/mt.dat,sha256=Xx_-as8jJEXOBAgfFX7vE6-2Qex4FWJ5rYW3DlCbu0A,49384 +babel/locale-data/mt_MT.dat,sha256=L5q5LizZQL0-FLj2U-wn2YhkpL3p7ZvjdyAvH1wwUG0,635 +babel/locale-data/mua.dat,sha256=N4zi8XyQdW_TmszNHQyn4zmia-MpCNWx_Vudoaj075Q,15861 +babel/locale-data/mua_CM.dat,sha256=Ib4K67KfndwGsoZDH0ehHA-F7V_SUj7q9VsK2juzaIQ,636 +babel/locale-data/mus.dat,sha256=zPqFwR9oCIJ0mA6evYwT75cWt_QBF-0eDZx1n6fmsDY,2722 +babel/locale-data/mus_US.dat,sha256=xcd4KKUIqBwSefSC0GGSDkvXL46eDWgWolJsGuSf654,654 +babel/locale-data/my.dat,sha256=9crk_2tyVPKBH_YWC_D0h8o1nbHH9k34e414JywM_6E,183534 +babel/locale-data/my_MM.dat,sha256=l53-D5YL-BbmLZYveFV2ISa4NcrSwTfKsRRc41Jd42U,635 +babel/locale-data/myv.dat,sha256=78-9U5eDf3V2q3Mj0MazIxh1n8sjyVjQ1O0Oyt5875M,16828 +babel/locale-data/myv_RU.dat,sha256=sncxwOpjfFkRASKHMP1ytKcjpF4w4GjU_JEVqXv84Tg,654 +babel/locale-data/mzn.dat,sha256=8Y5VGlzCxKXzBP5iFsyflLZSS1x0_3T8sqbwivfU45s,46144 +babel/locale-data/mzn_IR.dat,sha256=fjN1ek2fAzZyzFJpjX_MIc5oFOEqj7LS_SNdBOQS9ZY,679 +babel/locale-data/naq.dat,sha256=N07nsBSSEuNZ4feWvo7b4YWwbgjBwlxG9653O-OlhmI,15797 +babel/locale-data/naq_NA.dat,sha256=e5gAIOo7le-dVOAX_k2OW6gEyVfEUxcYDUJu_MBDY5M,617 +babel/locale-data/nb.dat,sha256=-bGHDSonSEdqfb2PxNC1_3jOHELm3CwV7xzEtpmWZUE,1330 +babel/locale-data/nb_NO.dat,sha256=J1UiN-AG900acMz4p0fBHtXDpS0HD6uGAi7gg9gOrsY,653 +babel/locale-data/nb_SJ.dat,sha256=XcK9_nKriUY_4k09kmgJalGTls-e5-YS-MCPEKLP8vA,634 +babel/locale-data/nd.dat,sha256=ITmP8mLDb63INBKlxe3yCZqRbvL83DrVBkIIAA_YjmA,15730 +babel/locale-data/nd_ZW.dat,sha256=KpZHrPr_0Ru0t9ojSK9ZiqGZ6-rSpvA7cX9C483ocRk,635 +babel/locale-data/nds.dat,sha256=q3dxEsEcdLTOigPQxhEXuaA4U03umMzIBNC4NkFvino,47839 +babel/locale-data/nds_DE.dat,sha256=Qmh5DjX65W58jXXXX3pxfxS_HVTJVavMspBPdph9sfc,654 +babel/locale-data/nds_NL.dat,sha256=E_EO3ylaBjJNThr211Yzefh5DRbkEFFVpbBMXIQ4U1U,654 +babel/locale-data/ne.dat,sha256=5Ob8IUrudfJp6yCzhHkmYC2mkVY1sd10I79pSXzups0,210152 +babel/locale-data/ne_IN.dat,sha256=SFloADZtyb42wygQmrMy7yx-aADGQECZJUey796oqnw,1292 +babel/locale-data/ne_NP.dat,sha256=LGc7Z5TRi0HRNQdY4bqPitV73gzTPWLd_g-6aPyvryc,635 +babel/locale-data/nl.dat,sha256=zO55PQW5wWMzjRmUGEi5l4H1D1rC90NQt262jbRIyzY,150031 +babel/locale-data/nl_AW.dat,sha256=HYycPPe5HDhuP_zN89ysXR2AqjIbx_-XB2n0-TUPhxw,638 +babel/locale-data/nl_BE.dat,sha256=xHmyTOK9-rwPAH6fYdlPFZv-xinmTFNRN-LIGxb59HE,1876 +babel/locale-data/nl_BQ.dat,sha256=lZQzrmWsFTpiWwT9l6FakrNoll3QNP3drIMcxFkAy6Y,635 +babel/locale-data/nl_CW.dat,sha256=doEeLSsQVaSocP4jr5LxNrT5luSiG4hkgsMvoYjJBtY,638 +babel/locale-data/nl_NL.dat,sha256=bGo4nyjhqe1VtDHlP5EUmNkBKsViUSiH3h_ikXcPuRo,653 +babel/locale-data/nl_SR.dat,sha256=d-YXA5QA5b2Bh-WhxNTkyKQ4ROhuEg1CeGN5XmzWcZM,696 +babel/locale-data/nl_SX.dat,sha256=ciTQIntv0njAJGIUENzo6stN8yarfh-eBpmEzxmpJbs,638 +babel/locale-data/nmg.dat,sha256=NEWUb0RI43oeWByH9l1FvrLDvVQY6501jviEYmM_CCs,15468 +babel/locale-data/nmg_CM.dat,sha256=0A-cVUgt1l1ITnPRdcgWiQ68ZGqHDYd-k2wSc_nXnMQ,636 +babel/locale-data/nn.dat,sha256=E-Y0lC-8QKCXdc8CC_ZPN3bstsXsM3MD4Lu62XMMq3U,64042 +babel/locale-data/nn_NO.dat,sha256=98eWK3CBq5T_dI4a6dQH2TktRygMH0EnpO1EO7w8lVY,653 +babel/locale-data/nnh.dat,sha256=cWTTqJEXln6pUYON7H4PRrYr_uRWktSzcLGCC8jnTno,3530 +babel/locale-data/nnh_CM.dat,sha256=dt9ZNHX5ZQo-kcyT4-mVRCUiuzL-H2A9e0s0JrHwZts,636 +babel/locale-data/no.dat,sha256=xxkSV9bwDKWKK6dmGIaZGo4snfkON9eJUp3-uvlEC1w,191212 +babel/locale-data/nqo.dat,sha256=VQzcAnkUnAETAL8xosXBsQltlC4yqpSZNMkwtsWPRgI,109412 +babel/locale-data/nqo_GN.dat,sha256=3eOSTBaZM0RNLUDZFr__KTR_9iZoGUFq9M6bhtmHjcU,617 +babel/locale-data/nr.dat,sha256=ZHIIC8BaR5XBmnULOTfmAYzXmqImq5QmELqbFPKKQJo,2167 +babel/locale-data/nr_ZA.dat,sha256=e4_czqcyMye0qthJd2hzn_9inTS8WjjbFOzRJ3wAS24,635 +babel/locale-data/nso.dat,sha256=dsq0mvwg5QK35al0bVwZGUL961EuGS05vlFR5qb4HwM,6470 +babel/locale-data/nso_ZA.dat,sha256=TdOqVTzKNigLD6zOPR7W7QHT-Aw40ylsUE7bmMwgaKY,636 +babel/locale-data/nus.dat,sha256=4G1Wwsq1yWIew4nA-QBo2j8LmbqBTRZ0gCU0LYLUSUk,8215 +babel/locale-data/nus_SS.dat,sha256=Is_mWvnSS7j05Vk9RHcCfyLOdhOeOWRqgXDf8FGNEJQ,617 +babel/locale-data/nv.dat,sha256=7CBom-BDX6Wk2o878hmZ8DBY8QAS8Z99ExdmdVpq-vQ,721 +babel/locale-data/nv_US.dat,sha256=ak7j2GDaOMbAAmXQhfC9PRM8E9h_hJZL3UDqxqjCtoI,653 +babel/locale-data/ny.dat,sha256=XXvyFcRnNcH9KcAH1K7jzS5xLFsXMlXVW3yowhXPIO0,2152 +babel/locale-data/ny_MW.dat,sha256=kyhkcpqgIwSrUcfxve2OS2P9S1AfXItRHmy94K7cQ48,616 +babel/locale-data/nyn.dat,sha256=nVlbaYbL0QCkpVvX2rYYUFRsuI8BOjcReljkcamobSY,15668 +babel/locale-data/nyn_UG.dat,sha256=fEm-RMI6-PvIjbMUoZK68dTaiAmOqH1iDQBn23a6r2w,640 +babel/locale-data/oc.dat,sha256=0GZZe142JNEQ78GP7q1Sq7ZolzkVuvuK-QDCpLu4Z6Y,66841 +babel/locale-data/oc_ES.dat,sha256=H-3UJZkJCacW_BELiE_wXsXSVHp-dfxv59o3Hed8uho,33273 +babel/locale-data/oc_FR.dat,sha256=L80Ivl6dUpQJF4fAY1xaAeCRO9BkN0l6oCr8nRwogsM,653 +babel/locale-data/om.dat,sha256=wbIQO2bCc4PnuCB14zg9Gw9XW3mlv8D_D0C39SMnAnw,67446 +babel/locale-data/om_ET.dat,sha256=v0wHN7iwcuJN-iFgWFPrGdplH6P-0c8B2OEqYOEeb40,635 +babel/locale-data/om_KE.dat,sha256=DZ-2HywpH9NGEronFox-2AprzyoSg0xJAS62LNqZxcQ,1365 +babel/locale-data/or.dat,sha256=bdzcLCC-BRprtZBlm8pvQhvGKe2zTqjQM1JPQZrGapM,226771 +babel/locale-data/or_IN.dat,sha256=ur6a2cCdapMoKd-6KLXR2xAF2YU8xaueeW7UTPL2yLU,658 +babel/locale-data/os.dat,sha256=2ARxbjnZ_WYF6VQTsvXN4epcXlWpkXaVEhUNOJpAv8Q,14821 +babel/locale-data/os_GE.dat,sha256=8NgIdMuGlNow1dXmjW6y4xOis1_3raiXcj_jLBPirpI,635 +babel/locale-data/os_RU.dat,sha256=76MsfCZxiy_RXfhW7Do3Z8q4-jhp1hOXTBIsA6SlA-Q,695 +babel/locale-data/osa.dat,sha256=Ob-cu1978hig_-zOnB-PJW1_496aZ_yT6S7VTFkHoEY,4538 +babel/locale-data/osa_US.dat,sha256=qFfjNw8tVOdprzqK2wBlGH4eNMxDxDQqDDReucJZR-E,654 +babel/locale-data/pa.dat,sha256=pMTu_1agUQqVCaM7VB5fe9wM45MEsfVkDyzkKp6UlUE,202684 +babel/locale-data/pa_Arab.dat,sha256=VBfuWzoA5UdGbWTTG3cPAYL0ApWSup5U9LWBBh4bGUE,3789 +babel/locale-data/pa_Arab_PK.dat,sha256=1Si67Mz8DZfo2D8Ld0b5IlZpvnSMgg4W8_zZLrHrWQ0,635 +babel/locale-data/pa_Guru.dat,sha256=fs7wqdmuGaKQCCwGkT3lRQSKmf1dxG3jyLboZeVtPmE,1276 +babel/locale-data/pa_Guru_IN.dat,sha256=kpz873B1I65nfS3Z5vDLmmGliFVPlPM58sB6jW9nkBY,658 +babel/locale-data/pap.dat,sha256=EzSKg0e-PaX4UNpqi0JTYSjLYwqljGKI-uJLjR1uWhQ,28121 +babel/locale-data/pap_AW.dat,sha256=XZSGzQPijHNf5GjxUjDJQt88iD0ETRdZSTF8gn-1U4M,617 +babel/locale-data/pap_CW.dat,sha256=Mu-gCfh3bv9pzz9RrylMffuphhqgiRaODEZm6TtCpaI,617 +babel/locale-data/pcm.dat,sha256=BPyAoOzA7PpWZ4G9w2NMBzu1JqtXwnZbeCSrLk7j-Qs,161833 +babel/locale-data/pcm_NG.dat,sha256=3gBp38NIuVEbHlKAtQPQXJjT3DKvy7zvUqMAZS6pGzk,617 +babel/locale-data/pis.dat,sha256=aCXK39YyoYqy97wCU2idxYXLL9cC7myCIiJZeKgq-po,1510 +babel/locale-data/pis_SB.dat,sha256=-CDkXv_877c__o56bBeYHAAq2X9CcnKdI65DiE61_M0,617 +babel/locale-data/pl.dat,sha256=zWkc9nD_Ipzoj-nuymRuCLdWD3dG_wQicGQE5NpjSLU,227506 +babel/locale-data/pl_PL.dat,sha256=3s2XpVyaKha_K9MesXKD6sZNGSn1PVRtuz9XYp1xrsg,653 +babel/locale-data/prg.dat,sha256=vsad78h5dkCtaL_Gc-AGmXy3cc6Od1j4WCPGBdX6Tt0,17267 +babel/locale-data/prg_PL.dat,sha256=5jT2Yeek_e_MpGShmy2v-0WWhzQkQ0WsJQlUYfIOcfU,654 +babel/locale-data/ps.dat,sha256=2Yvun7eRlWEkh6Om_QxdW3Hq3AwyYqoM8n0418VjcbU,158607 +babel/locale-data/ps_AF.dat,sha256=sNE6bgx_nV0VWKa8InelUaFYSa3Fpx6byJw0KT4B1o4,678 +babel/locale-data/ps_PK.dat,sha256=ZtzTnH2thc6-J5PbuMOq3lPu57kbqDFxO53s7BSdVSQ,7119 +babel/locale-data/pt.dat,sha256=6Db_e_tQGLJop802pMj8aeNGcuKxa9iKTCZYBNM4crs,183448 +babel/locale-data/pt_AO.dat,sha256=49hMN9AJBDNjcsQw-nl-jY_VKHanO0PGfvd--OxqOxI,1022 +babel/locale-data/pt_BR.dat,sha256=dVKYp9IwRMbjZ_ee-eXFPudSuTRrROvbFzY3dYTYmn0,635 +babel/locale-data/pt_CH.dat,sha256=zAvD0sYytEquwzY8ZRbVCcy7DS2ZzUXofl5qXOixZH4,653 +babel/locale-data/pt_CV.dat,sha256=zOQn8d7--PKrhRUhQ5mPKW1Km6Tyh5JF8hstfxpITzM,1039 +babel/locale-data/pt_GQ.dat,sha256=qI1hvtuSHOev12ips9o3Vy78NJpOMjhkW625M60lqZU,616 +babel/locale-data/pt_GW.dat,sha256=SRxbFDIg9FwEjGjutRI9P1SeLiZBqStwSqPuHBFZwLQ,1002 +babel/locale-data/pt_LU.dat,sha256=z9aq0BTWEnk4lXveNpmi89TKcXN_t6Ud4A_C97uyOuw,672 +babel/locale-data/pt_MO.dat,sha256=shItJIIDrxwlcQhWLhlZG0uhyTlSBDcTag5ivxmb9TA,1635 +babel/locale-data/pt_MZ.dat,sha256=UZ1nkXS9CpiCM1IpOG5XpGK2QqM5mE5lAgRLTGAWl-4,1042 +babel/locale-data/pt_PT.dat,sha256=_H5DG5pOSZR_5gjjycrMBKaOJd_euwJln1pa3MPd1Mg,96277 +babel/locale-data/pt_ST.dat,sha256=Cm2HUxlGtZaz8IXX5Ohms-HYuKgazuBcOZBz5rWOzEU,1022 +babel/locale-data/pt_TL.dat,sha256=CIIDM_Zo0xiu4gXngxYtkYK6ldTNZMRaikSD_sAokMw,1002 +babel/locale-data/qu.dat,sha256=UueUbNLnx5ZwsqJcvzKUTdK5_wKBOmR2haCj0zhd4RQ,93300 +babel/locale-data/qu_BO.dat,sha256=7RUvNrmuLtwqP-qab667GocH_c4gIvpas3dbN1uaGxU,878 +babel/locale-data/qu_EC.dat,sha256=_5V4RYoPb3eCAA7jOCNfB7WZqd9sWP1E0tlF8mGeqFc,837 +babel/locale-data/qu_PE.dat,sha256=Vdd0fcK2dtFgyui3Q9NElHuJ841RI-T5l2UHeBq8MQ8,635 +babel/locale-data/quc.dat,sha256=dIAxk2IuDZhWTj-NKC9PiHBZOnG9ARyANdJZUfoVlJw,775 +babel/locale-data/quc_GT.dat,sha256=8M8KtmnsJiTCaf-Nl5X174Omtyc6a0ri07kysDC3-5Y,636 +babel/locale-data/raj.dat,sha256=qkuyRruXTTQLDgijSA0Equfz19Aqg0p5Mg0heaGKT00,2428 +babel/locale-data/raj_IN.dat,sha256=SS8GPzJu5j6nfXlDoX4NFPN2QScl4M0YNsrFmWklymM,659 +babel/locale-data/rhg.dat,sha256=dHahMWjQ_tUshtlLauqf9b4Y36LNJFGrMBsVmjBzlqQ,4611 +babel/locale-data/rhg_Rohg.dat,sha256=DAOuwC-7uaIuZtrIXvUkYt6YkxqaKpHOma1m0-XTtrI,693 +babel/locale-data/rhg_Rohg_BD.dat,sha256=DcLSBtf_k_f6B102-vbhBOjfzNZjiTDvEUdIOQfVc8M,1212 +babel/locale-data/rhg_Rohg_MM.dat,sha256=HspZzbytcZQ853Jstp-eFEdqSMAD3-shgjrdxY_KQrE,636 +babel/locale-data/rif.dat,sha256=4KtUTy4D-OsLftEaIHU2fw1NUhx0pwJXXie51jI3X10,49902 +babel/locale-data/rif_MA.dat,sha256=Qq7ZdymuPdjHeYDUDGCjMuQBRU7w5qGdgzzZ6wPfN2o,617 +babel/locale-data/rm.dat,sha256=aQ4MmwhjJbBakV6-C-6yjDvN8jvVa8Mk0ovdYgVkR9k,95006 +babel/locale-data/rm_CH.dat,sha256=JHAlYXMD9Vks43cU_gcSEQmqo6pogWPl_R4VMUK2iHI,653 +babel/locale-data/rn.dat,sha256=LwQTzbFINNeIhU5qJsEnh-raxcCDXVMGA6ZL95aU9UE,16241 +babel/locale-data/rn_BI.dat,sha256=r5Cweh7L4EAZK-qTmJuloWc33iXeR4IJUbknrl0XC3g,616 +babel/locale-data/ro.dat,sha256=13UpR66j-nQg4kbgGH4ja6ygDq1k3CCErykEWeeG8yY,200714 +babel/locale-data/ro_MD.dat,sha256=pUZY970zkBSBpVOIA3Ss-6vDJUF3ZCEWYNs4_LXcpAY,2881 +babel/locale-data/ro_RO.dat,sha256=lLYIYWhDUmq1EZ9oV5SETauVa_5uNN5p52dW7XeemRk,635 +babel/locale-data/rof.dat,sha256=Yafgax503CHjHvrc_njDTMVOOD2B36sRvWvDE99geMI,15473 +babel/locale-data/rof_TZ.dat,sha256=I_qwGjqqrcwUR_3UNydHOm_EiiLZYyRV0q-s1qfSSi0,617 +babel/locale-data/root.dat,sha256=vcYJrDi6WVier8432VEhdQ3ZZH8ptAXszNP747aIiq0,51983 +babel/locale-data/ru.dat,sha256=8WD_7_Tz0ieaEjXNlFQy8xFSfCwsVf_CUcoHyFfqkgs,305832 +babel/locale-data/ru_BY.dat,sha256=99UlyhoMWnfyhI5ltXGaJkycWLVfJ3FwdxyRm-yr6kM,676 +babel/locale-data/ru_KG.dat,sha256=X-iAT1QuQGhk1mIetpGyWqDlwiBskLfwqrK6ant1XS8,659 +babel/locale-data/ru_KZ.dat,sha256=P1_Gn3esOwDLL8sd8vVYbFA8J7QEsaDAWfZvDsn-WwA,656 +babel/locale-data/ru_MD.dat,sha256=LU12oBwr7MfPTzfs8Dx7uUZVgHin8ybX_oPHrPIJTkw,654 +babel/locale-data/ru_RU.dat,sha256=IVG440mXjphW6iCsKysZCW1Gem_z5_O0lZI6-R3oG_E,653 +babel/locale-data/ru_UA.dat,sha256=WYPDEOUjHl7mtejs302KAURq_ckDn6CFjH-IwmiFF6g,1210 +babel/locale-data/rw.dat,sha256=1KiBkw5N7hioc-ESs0oqgdyOaVdOlsNp1iIz7g3k83E,8418 +babel/locale-data/rw_RW.dat,sha256=tw-gtzH64PeIAmNGeobgUypw7RAyKITeFAcQPGY0MG8,616 +babel/locale-data/rwk.dat,sha256=hCqo5glP1WqFJrEGyW6r3t43NZ7bVHAOGFGDkUzeM3Y,15369 +babel/locale-data/rwk_TZ.dat,sha256=s9duai8NRoHwn8YpQrlMd3VDf6jtQxxcUmu9CIIMzC0,617 +babel/locale-data/sa.dat,sha256=8r4iZXIQ3vnGxlSmOtDhwM-T_iaYN4SXuTSdGh-2JMg,15978 +babel/locale-data/sa_IN.dat,sha256=ABNamoPpYRbO7bK6BGm0tK92kd7su7_OP7Di0wW0zZo,658 +babel/locale-data/sah.dat,sha256=Qlb3HEv5JslfLAkUjLJz_XdRdyLhloQ9uf9q2b_O6jM,39310 +babel/locale-data/sah_RU.dat,sha256=jHlseiwMbtN-IsETeG2dsaIn6OB2kqtAogazMnn0f60,654 +babel/locale-data/saq.dat,sha256=grj85np3tZzXQmLdtYQcu76ynQv5Jq__KIyaDECFIj0,15787 +babel/locale-data/saq_KE.dat,sha256=kN94cJJt8AT0yBRDqUPGoJtMZdOb2e-83NNsq8hmQ64,636 +babel/locale-data/sat.dat,sha256=K_IKB3mSsOkYuYDtbGW3lbGjVk4ctB56WWkJJvE0-mI,66131 +babel/locale-data/sat_Deva.dat,sha256=0EHZ6UcxsVOfi399xQbOkzaH1OU4jkZ10uqmmWnK8VI,1943 +babel/locale-data/sat_Deva_IN.dat,sha256=Bzh9Vmzia_8KLAryt9VqCl9ter9tKxng4b8oFYbYK6I,659 +babel/locale-data/sat_Olck.dat,sha256=mszOmf6B29mFbE6qN6Moy6SfBjwsjaCsbk75dJR245Q,905 +babel/locale-data/sat_Olck_IN.dat,sha256=Bzh9Vmzia_8KLAryt9VqCl9ter9tKxng4b8oFYbYK6I,659 +babel/locale-data/sbp.dat,sha256=1qHxon8_TpGGnLHUBzy5cR1mCEnZmw1EuYz3QLgnT-c,15609 +babel/locale-data/sbp_TZ.dat,sha256=chWs0tZniO53SbtBquTHGS6E4v36tgYL2b3enxHcdCU,617 +babel/locale-data/sc.dat,sha256=ItaljMMLxOEM4DEG_yDNVk8H4AmQrq1xCnDE8AfRDDs,189970 +babel/locale-data/sc_IT.dat,sha256=0G0vL9YXZQLkTmnzJuuygM5ty2Tw5liDg_aWHLvg32k,653 +babel/locale-data/scn.dat,sha256=UKMqekdt_t_Qe_ebhg3eaRsTs37ECpWLEiWSCFjMTLI,70373 +babel/locale-data/scn_IT.dat,sha256=dTXZIHDRhbFDCw02T0wL1iaJ2kfY1ZUzfbvUs4_WKLs,654 +babel/locale-data/sd.dat,sha256=VDMIluqNpBChcALvjd2lGll6sRK6srAF7p2CogEgXlE,154300 +babel/locale-data/sd_Arab.dat,sha256=jgkaYGUhPXll1T7CT68ridccZaERHeZdwUzGoAZBUps,879 +babel/locale-data/sd_Arab_PK.dat,sha256=c3AXdatnrTNDHW_SOh8fNNye4CVey81FnkSXwj7MmcI,635 +babel/locale-data/sd_Deva.dat,sha256=ZZathBrGJyoqspPsHF769J84zQq1y62vN8RAjGj_Cms,13957 +babel/locale-data/sd_Deva_IN.dat,sha256=0KQFEKHV6hHidc5hxrxQEvhO-YyvFf5P5z6t9hPenH4,658 +babel/locale-data/sdh.dat,sha256=5cD8u88qanpCtA8kPvHH9AdAi2-HbhznORqis1PYx6M,1032 +babel/locale-data/sdh_IQ.dat,sha256=B_vUMOiGWVcD1HaR4Zk8XxVzcmMFSISe2vRscyA1lYY,679 +babel/locale-data/sdh_IR.dat,sha256=hwMmQnne41X_lyjbyNbQq34Lpkl91bAgoavPZRuozwU,679 +babel/locale-data/se.dat,sha256=JnN5s3b1OrcP7qmurb8Rb9NKc-ICOr_RmdFs2EBKoRA,54830 +babel/locale-data/se_FI.dat,sha256=9_VJ0wzYFPto0YF2Ge0qieFV9_DOVqqYnPjlC5wnAr8,44207 +babel/locale-data/se_NO.dat,sha256=nm5u2VQ3ne0SUFZtFqwsRa8Gg97Xn1OSxjoP2I-i_PU,653 +babel/locale-data/se_SE.dat,sha256=6M9OxtmQAY_p9fZ_6L8zqo6i--bo_X00cvhTDEbX_UU,694 +babel/locale-data/seh.dat,sha256=viFuK-Mg4wPnvTcrvL-iEzNqFc7Ri_VP_r9pC673SNE,15433 +babel/locale-data/seh_MZ.dat,sha256=Sv94DueqrM3R5RjhCdwrKZsnNdL1WpjLBg6QhBnoaX0,636 +babel/locale-data/ses.dat,sha256=aRW4cH7nGNS5S3B3ff7o02GqcIqn1mVbBRGg3NdxXUc,15812 +babel/locale-data/ses_ML.dat,sha256=y14qGwP_r6VxzJhklYIWfYkolu0OHB-6nJ4tvF7J-iU,617 +babel/locale-data/sg.dat,sha256=ERl6d_xd8JRnkG_D857gWi2xONyI-cEmzt-Un_hXbu4,16476 +babel/locale-data/sg_CF.dat,sha256=QCNYqo_5l2Sv9JUFEWF6YLDR3MknhgkyMz1mO5j2Gv8,616 +babel/locale-data/shi.dat,sha256=fuYtv_xjgmJ0-aAQiuWcJXZY3mpeq__hz4lnouEUyWE,21830 +babel/locale-data/shi_Latn.dat,sha256=aQrfwwcvkgPaWFSev9-3WgwQXhhXj1_5myuR-QifnPo,15435 +babel/locale-data/shi_Latn_MA.dat,sha256=X8cwkkvm2LjcClQWzHRxxmiA8P0c37D7P8lf6RO4iNQ,617 +babel/locale-data/shi_Tfng.dat,sha256=VjsR4oSiK9oFfdIdpaVDwNSIBvFbQ3Jvm63K24bRqk0,974 +babel/locale-data/shi_Tfng_MA.dat,sha256=X8cwkkvm2LjcClQWzHRxxmiA8P0c37D7P8lf6RO4iNQ,617 +babel/locale-data/shn.dat,sha256=awBFmgdlHbpKsnUqWZaGAQ-YbTPm9UWkJKMn9IdJ7pM,890 +babel/locale-data/shn_MM.dat,sha256=7VauV3cmVfAJz7kA76hsF3FdwM75CVjvHdjx6lCoH4M,636 +babel/locale-data/shn_TH.dat,sha256=QHPmr3V4GzTbb6QA5SDl2EsVzQBjpbaDP6OHfJZ0S0Y,636 +babel/locale-data/si.dat,sha256=iuq-0rbecyzhX0pRX5UYdgKKzrn09pkLucKursW_Z94,216775 +babel/locale-data/si_LK.dat,sha256=cWCgV9WmnEwIIsBmhsIVzSzbrV8hkkXaV1xH1ultlUw,635 +babel/locale-data/sid.dat,sha256=zyKwuzw51B0E8sWg60qJ3kO4rzqTtcNBRnH5D3Zm1mU,2176 +babel/locale-data/sid_ET.dat,sha256=vtwy9BuaZwb5A3XdIl-3mws1cEAVk4s8oKy7i-GnM9o,636 +babel/locale-data/sk.dat,sha256=u_TnuG4-zvLxkxQupdNvPS-TYi28xeiPxLit28hxwZM,218242 +babel/locale-data/sk_SK.dat,sha256=eMjPq18mQOAXvkJN5WV6lKEAPyt7-eleGme2pHHevgA,653 +babel/locale-data/skr.dat,sha256=Mrx5bET3kh5Gzd8-2J9Rm4_b_wPZTDoHuhcxqdYj5hA,1702 +babel/locale-data/skr_PK.dat,sha256=UJpLMmJJIM5jeI-tXWPBNX4Qd3WS2nTwp3bvJg5D3WY,636 +babel/locale-data/sl.dat,sha256=eEJU8du-WwCkCviFmusUqH8H6sMl2PHG_khSumUB3co,210137 +babel/locale-data/sl_SI.dat,sha256=3Hk2t-MUfAUtqu_Gy0_fTjOhwBUtxdnndQ7Kowg0qek,635 +babel/locale-data/sma.dat,sha256=BaBVbhsEPN9V4JGtMt2TpMdf0oIrL8Maxt2FXDIEEss,944 +babel/locale-data/sma_NO.dat,sha256=OeIJ-EJtvWH6z2dZ1Hv8QdmQC7M7r51t-_C6LD6ZyxE,654 +babel/locale-data/sma_SE.dat,sha256=M_zYllAUd2UaWvccZ6ShB9-Gd8JYzIEln-88Q23syaU,654 +babel/locale-data/smj.dat,sha256=eyHR5AZqbxxlTYhyxJfvTjpz_v6zfh3TrDtcDkCgTig,939 +babel/locale-data/smj_NO.dat,sha256=5fz-YVJEoXswvC-RdFcJWmt-EMGcNXA3c9j_pfmxqCA,654 +babel/locale-data/smj_SE.dat,sha256=7l73FEZcAemOwXSrfPB3X7a0cto3J4oM7AO9i9PMIBU,654 +babel/locale-data/smn.dat,sha256=LGkyaifqt24L0NeExCtzhg8rKEKnkfJNEKtt67B-ViE,40399 +babel/locale-data/smn_FI.dat,sha256=VRY3dbCyxEmDUTep9bQXDRldd5wSg4skqQpztnMXplk,654 +babel/locale-data/sms.dat,sha256=ylATYbrfu8SVEVdQRbC7dTSOKCNSX7O1gjS2wJXA1tU,6521 +babel/locale-data/sms_FI.dat,sha256=b-Mk20lC32xysqU5v6jGjDUYDZaMDvoMwWOZNdT5yuA,654 +babel/locale-data/sn.dat,sha256=FNTHDspBYVPY7Nse1haEc19O0Sf3btsqNWQFs2Zzcgc,16732 +babel/locale-data/sn_ZW.dat,sha256=8HnH2raHHl8PI25abODlThEhjIOGXJb_u7cyQd5YzZw,635 +babel/locale-data/so.dat,sha256=sAFkgMg-qaZYhHT_lyoaggZ8UM_KX1xbS4miB3l5KN8,166227 +babel/locale-data/so_DJ.dat,sha256=VWnaj_MuW4dJnlO84t60ySCvfJL7FXI4nIP9PTL5Amo,656 +babel/locale-data/so_ET.dat,sha256=EvRRqU4yQPMYhkEK8a4MR808fwKHmW7EvPvEJdjltnE,655 +babel/locale-data/so_KE.dat,sha256=OSiRggRZ7CTNmqiGOvW1W2Cw2RqjVESTVOdUfgVgWyU,1208 +babel/locale-data/so_SO.dat,sha256=2IPbOqSxQGB5FukQ-B-MEme9FHYn22ClXmAV4x08pNE,616 +babel/locale-data/sq.dat,sha256=8lTejyAm-94ixpS6Dly7NQSHNsamftqLIdO4OxPWqok,160229 +babel/locale-data/sq_AL.dat,sha256=MN2RvkKGG2PXjCRsMHsvcnwnIOOp9tNSpcInh2uCWaI,635 +babel/locale-data/sq_MK.dat,sha256=L_GaZJ9XuQMs0zw-xZlrefPF36SH0sJqMrdDDbwicZM,1208 +babel/locale-data/sq_XK.dat,sha256=qILZGRwAhuIBJ9xi_T5WTrrZAVouFjQSvybrwgXTsog,1187 +babel/locale-data/sr.dat,sha256=AAE3LN_CLRWzljEERIYedZepxLIDWzENkL4wmu8Ib6c,265725 +babel/locale-data/sr_Cyrl.dat,sha256=Tbo90CyBAWciKeDesPhmXf7sdBQfjWsmyyrKBco_NzU,1990 +babel/locale-data/sr_Cyrl_BA.dat,sha256=sKEcBX9G9OwCmIZEpTphQyW_LM4xoDGe90s_470_AJs,41992 +babel/locale-data/sr_Cyrl_ME.dat,sha256=rDZOf-zykN151tfgGiO1SUJiClzQ6t40gF927bMLn1I,2320 +babel/locale-data/sr_Cyrl_RS.dat,sha256=Tn9u1EvJAZZEIdgXloi326qjpq8b1N087nRQ9R1JbWE,635 +babel/locale-data/sr_Cyrl_XK.dat,sha256=qVevTILYnuaIjRyPy4rDTavVg-VXxKcZ5fVdh5c-aHQ,1574 +babel/locale-data/sr_Latn.dat,sha256=1joKXYRv5UiiT21s_Za6qE-VA8XpFi1HzYnVOjKpxb8,217950 +babel/locale-data/sr_Latn_BA.dat,sha256=of4wpeCglVK_Td6HnHUjHRwuFtCVtWj3kHb3nl4B0D8,32834 +babel/locale-data/sr_Latn_ME.dat,sha256=Mr0GNVLFIMZpBakd4dEUzJUlAN4nyX2BMAqydgtMzWo,2089 +babel/locale-data/sr_Latn_RS.dat,sha256=Tn9u1EvJAZZEIdgXloi326qjpq8b1N087nRQ9R1JbWE,635 +babel/locale-data/sr_Latn_XK.dat,sha256=wIz7XXQrRFYpzMpR_cgSWikPWI0ehSx5a0gRBgt3rFo,1486 +babel/locale-data/ss.dat,sha256=UAB0p3UMDn8KfBY32a7HVWXWpHlPa26Nr_Woaah2c3U,2178 +babel/locale-data/ss_SZ.dat,sha256=X-Va1uVrsPa1ZX5hwhQ-ME6Q_bovUb24XXFS8UQ87lQ,1208 +babel/locale-data/ss_ZA.dat,sha256=xwT3vZ4tmKEvJpVwFMV9U2j2FLF1tC9PEDN6MC6Qbf4,635 +babel/locale-data/ssy.dat,sha256=QyBWLhH_sreFEBHMQ7aiqBsrGvDeQHyYAKioqksa2iU,2999 +babel/locale-data/ssy_ER.dat,sha256=9CRIaVxgOMeMTc0tcV0Yz9yZzq_uD3g3ylZzqVpYzsM,617 +babel/locale-data/st.dat,sha256=b-jiK03L_9F4QqWW8qmRJ3UZntZDI9eMJglRho3MN7c,8016 +babel/locale-data/st_LS.dat,sha256=pSzdNm6-O5V6-14VcgF2iGNYQPFYIXQlY3SqUW3GcjA,1227 +babel/locale-data/st_ZA.dat,sha256=5tdUX7dxXEL2xiS_0IvHvqhKF-gWXFsi4supkP0RDAc,635 +babel/locale-data/su.dat,sha256=G66EuouIQrCxgKGW9JzPfMZ94NAN87P6REyULyyrFGw,11817 +babel/locale-data/su_Latn.dat,sha256=ievzq_m7eD5pZWLnVlH7oMIdeadf8GIMqEuVPJTBjyM,745 +babel/locale-data/su_Latn_ID.dat,sha256=axNaukDpD_-G-_4R7P1u5w4dh-ToRPN_Yo-QpC1cFRU,635 +babel/locale-data/sv.dat,sha256=RTvQ2li9cKHIEbVl7fI8ENVrmcCa1gERk3S9O2bHKmA,198967 +babel/locale-data/sv_AX.dat,sha256=QFGzIe9UCr5gCpgHunvdPiZ-126vP7GYORL9jjip9-E,653 +babel/locale-data/sv_FI.dat,sha256=Pn3EDh-VD0QJFWupEZ6w4TqAa-WC5GZ8oTA4oqLazvc,2526 +babel/locale-data/sv_SE.dat,sha256=c9PG5p2y_4rnxepGD4uOzemBU3EOQhQNO4BtUS1m3rE,653 +babel/locale-data/sw.dat,sha256=w0uX0MB-_bZQWOnbdyDVg1uRVe1j-K-egjRExoZpE8U,145419 +babel/locale-data/sw_CD.dat,sha256=W7Fw8Wqwo3_x4hWlssmWbVTj4hhSQmRv8c-VSnQdlg8,2577 +babel/locale-data/sw_KE.dat,sha256=YMNWSTJ8qxo0d1KvQwAN5ECRaZ9LGc0BDfX4enggVlc,47036 +babel/locale-data/sw_TZ.dat,sha256=I1bDbpEDiR1jkCgJ_W9fWCPuPxMhjQmwG3sIueKb-Rk,616 +babel/locale-data/sw_UG.dat,sha256=kuNdg2N_dLwUKFm7wSheL1wLOdyrukPxLfDw0PN7tT8,660 +babel/locale-data/syr.dat,sha256=ehEqE2rAN5_5X-4zoWys-oUwiajRRhwkGx-yd-kL4Q4,111439 +babel/locale-data/syr_IQ.dat,sha256=Mrw63eJwh0vRe3Lpj0vRf6Q4cUZXJcx9tlWkuAmMrss,679 +babel/locale-data/syr_SY.dat,sha256=l0Yl2UMjm_7kuzvoG2-KqBp5XR88gdjf1ZlpRRNFMuc,679 +babel/locale-data/szl.dat,sha256=8PpGSXa6ES6yxXD2YOBjG16b6BW9jDZo86RKB0MCNn8,88759 +babel/locale-data/szl_PL.dat,sha256=1D5dKaG2l2Haxde8uraWI2J5lzw1dIWGeJtBesua-IM,654 +babel/locale-data/ta.dat,sha256=RRIrxhZ9pdpGShIrQx7ZQBOPKWn15OGkeL8yQOy-tz8,277264 +babel/locale-data/ta_IN.dat,sha256=BOFaDBw7fc7C6xSSFYNfkhCgCUd7ydHprJ6u0DaneSE,658 +babel/locale-data/ta_LK.dat,sha256=Od6ln5oUnWfaAHwt_SDafWv844c7A7_7fTT2OPVTuyw,1208 +babel/locale-data/ta_MY.dat,sha256=PEUmjhs_RUr1R5kH9uHExdnG59Hy8LmbU18vXZYYPtA,1325 +babel/locale-data/ta_SG.dat,sha256=tbuefTSiXPMwpeV085Qp53l5uDHLsMMXmt8TPEG2fWY,1344 +babel/locale-data/te.dat,sha256=oRTQlv5dIZYav2aQWijvc2wm0VwoR1TwWUPL_qhzkuU,261668 +babel/locale-data/te_IN.dat,sha256=LICnXU-D0uhvxVpQ986Ul1JeAQktXaX53sXZSUY3L2g,658 +babel/locale-data/teo.dat,sha256=jJ-266Aw_zTeJjwGj_VASqzm6Y3CcQYkVPXKuV_kzT8,16012 +babel/locale-data/teo_KE.dat,sha256=S_lAg36VkA1w384kzPfXRLmJmGWfmz3ll7MzOQAtcr8,657 +babel/locale-data/teo_UG.dat,sha256=0WlDglms5bCe1AMwCqroaXpOXu9jQroxllMwXWLb8q0,640 +babel/locale-data/tg.dat,sha256=ErMv0Y4SGno9gTSJbhMVKZXiSe_KNSUFaoBeIDaP8tk,117163 +babel/locale-data/tg_TJ.dat,sha256=TCrsEipGp0reAS2mAvwT58tyzBnYJfL5oNHWpEe1ttc,635 +babel/locale-data/th.dat,sha256=lyG_l3_QzfpnjCv8LVaRTvpvfImkVrqcDoUKrnXlIR4,215576 +babel/locale-data/th_TH.dat,sha256=_QhA0WcHmW6Cr_-gU9e6cdpzTMDT19WyHas58fWDUnc,635 +babel/locale-data/ti.dat,sha256=K4kS476YQonyQifjLpS4UkE7hNa2k5aIDBJRIdh2eDg,214273 +babel/locale-data/ti_ER.dat,sha256=m9w0P5TPQ8IqpWKldwdfnw5_1Upv09AjLdO5WUbcRic,962 +babel/locale-data/ti_ET.dat,sha256=q0b9svPg8aj9xmbXr7F6fPHqeTJmclBl5t_hqQk7IuU,635 +babel/locale-data/tig.dat,sha256=cgqxy3wiehP8yceqa5-mrJVT23IP_bjlkeUOEvxspUM,13481 +babel/locale-data/tig_ER.dat,sha256=OoQ0U6yyzmjKwDtzLUpqR09h_ZaGvzXlp7t-HqNxmm4,617 +babel/locale-data/tk.dat,sha256=z5i4kshTasDEolkNpqXnzlZh75EgbAhL0ylT0_0oioo,164932 +babel/locale-data/tk_TM.dat,sha256=lADxEQoz-_ImDBmpCFUqDPuZ0ozVUhZKOQF2ZwyXVlw,635 +babel/locale-data/tn.dat,sha256=LgoZgcUCS4t_RsyQQKiVsJ7Kbs7HoInZAMndRk6DUCM,8596 +babel/locale-data/tn_BW.dat,sha256=jWMFP1tw-o7rslHAlAIgjEXflko8UCDNaSuQ8ccvNHI,654 +babel/locale-data/tn_ZA.dat,sha256=S3dMOsYSpBwkUv0tW9q0kKawQQl6yx77LexAL5wQqDU,635 +babel/locale-data/to.dat,sha256=CBr6gRgu0qo_-kIoOluPwu_ZdH4-SPPJHto_ERcDzHA,145255 +babel/locale-data/to_TO.dat,sha256=jcfJ2Pjof8jGE4q1y5LHSP9rb4IanN58kR7OgG8d5Q0,616 +babel/locale-data/tok.dat,sha256=kuSPgVhnv8Rr55G-epQDVyh8FfeKxJbd2J0hierJdUQ,8870 +babel/locale-data/tok_001.dat,sha256=PPUMevT2TBOGFSq-U-AccYkLHSbkWnBRDvxtpokTCD4,693 +babel/locale-data/tpi.dat,sha256=mqTAJweAOy1SAH2l4mJAKktX-ZeAdvTC8JnBPxXjB0A,4030 +babel/locale-data/tpi_PG.dat,sha256=uZD_c8yCtiYwt2EO2VOYPzhSTqWMQBOJMCuMCXe3Css,617 +babel/locale-data/tr.dat,sha256=ULbjOvmQqcT1Z2_8bBOe7LzwgBUg3LWM2MiLkmb8M6w,150824 +babel/locale-data/tr_CY.dat,sha256=3EmCqxcPvFuZcHCzpTmHb6pjtPwqQvwCfn27B8rtXNw,1227 +babel/locale-data/tr_TR.dat,sha256=7lS5CMZw76SVlMJxsmIJW5IfL7k9t8MrfKcnElqISSI,635 +babel/locale-data/trv.dat,sha256=iEbFtCCE_U5rmjAv0Pe5J_UigixMKq1cPIThdZui1Lg,9404 +babel/locale-data/trv_TW.dat,sha256=CTQtGdDW4Z0n2Ckb6B63HgEwNE44YTFnJCetwd8q9GU,636 +babel/locale-data/trw.dat,sha256=1e1LGCtVq79RclEMJbgRE4ATdqflV_KDHxBwInSfAKc,110107 +babel/locale-data/trw_PK.dat,sha256=pBHdOulrwRLiQuC96g8ilUzpKBeG6kglBqUXB8MlURA,636 +babel/locale-data/ts.dat,sha256=p7EFPucK9HkTVXeNKTU00s-Oas5U_HCPGX9hqT15p9I,5522 +babel/locale-data/ts_ZA.dat,sha256=AByEO55W3DVVOBIBxIp1F2QwY01-5v6v8sDFOGSxCF0,635 +babel/locale-data/tt.dat,sha256=X-J0BKEHy01aoARwwb0SWDuNm1lZFrT0akKrzBZjHPM,111014 +babel/locale-data/tt_RU.dat,sha256=cmv2MzolKOrsRoqQcFZGcXQj_33dLWGh9oUjnebCnz0,653 +babel/locale-data/twq.dat,sha256=nOSN5UZAxcCgdTxQFh14Cyk5K38olCyAuT6MrVW5PeE,15509 +babel/locale-data/twq_NE.dat,sha256=y8xQDxMtyStWC83tm_JiekFxAY0Fj-CWWdmic9GBwd4,617 +babel/locale-data/tyv.dat,sha256=y90_CH7Yksd1Kuc6KhykhpkdGVLUgFDV-B4oSxGqn5E,693 +babel/locale-data/tyv_RU.dat,sha256=vP_6cjMLB8I8YL7Nqrq4Gu_AWGFuANbZSdBc7ORn_IA,654 +babel/locale-data/tzm.dat,sha256=wYFO2vX38bht1nAdcVA7dxKVMh-3yC5sItggFaXkKBo,15436 +babel/locale-data/tzm_MA.dat,sha256=8eku_7voAqAjN651VYKCuIWvdYGOScCyqbt1rtSVO_g,617 +babel/locale-data/ug.dat,sha256=jRJJxRRKuYljj6kYicIhxWk8ySzpMT9AOePaBk3EO94,117801 +babel/locale-data/ug_CN.dat,sha256=2UselU1_d6K7NgQj0EDnDfb4Llk51eQZ7z78oYE-Ywg,635 +babel/locale-data/uk.dat,sha256=b8iEhvLdQxq7rtlqpx1c9vp6-n3jNGPGSuBWNhZAnFA,339125 +babel/locale-data/uk_UA.dat,sha256=usJw_J4Uu9OD9nrUxNQAx6vMJBWDjbGuc9l7ssJAyuw,635 +babel/locale-data/ur.dat,sha256=RTL85URWDMA3albZQODUCbVTA9oxeYXo5kWtuL1XW6g,167002 +babel/locale-data/ur_IN.dat,sha256=9GV9YIa7Mftq14Po2C6fjMG5sWkU8J5LS5bq1iIcsHg,10550 +babel/locale-data/ur_PK.dat,sha256=EEAGl6fLd1-a7X0n2PwRxlqwYZ0a0ELm2DuLII9spX0,635 +babel/locale-data/uz.dat,sha256=iwj3ukxb4FK0rZYtC66ftQmTtr1SgTzy12Wu3KkQYQo,138052 +babel/locale-data/uz_Arab.dat,sha256=wt8BwimSNmoFzrnduGDXMHhqj3B8-XqqN6ghg2Xm74A,3814 +babel/locale-data/uz_Arab_AF.dat,sha256=68eUCR8KeB0QDQRCvNMiOIkZVRozGKFTDednrQL1X_Y,678 +babel/locale-data/uz_Cyrl.dat,sha256=RpmyW2YhTwN_o6sKyfJxcktFI6VMqkO6YDzDE8XoOTE,76581 +babel/locale-data/uz_Cyrl_UZ.dat,sha256=MWJtHPdj_pF2h6abRP4wUwDWAUF4-zr7jBn2RQcZ0z8,635 +babel/locale-data/uz_Latn.dat,sha256=L5H7Xfz2Ho-vMqviRPC4ai0MnqoF9CIebiq7muISvSA,1292 +babel/locale-data/uz_Latn_UZ.dat,sha256=MWJtHPdj_pF2h6abRP4wUwDWAUF4-zr7jBn2RQcZ0z8,635 +babel/locale-data/vai.dat,sha256=T_MWlDAfbp9qgeArFd8yPDPbyThU15kFu19QTQqAlCE,17416 +babel/locale-data/vai_Latn.dat,sha256=MecJYJumVm7wCyCo-YeAY4eAon5WZ4ZqR0shQ3Pdpu8,14255 +babel/locale-data/vai_Latn_LR.dat,sha256=LdVmBAL7nzDp-Ab_uHidBAi2crIf9nXhf8tBNfa7xdI,617 +babel/locale-data/vai_Vaii.dat,sha256=l_IXC76zzJ2lPLfWfjWzSw6xVtFwr-x8LofcHQsSG_0,693 +babel/locale-data/vai_Vaii_LR.dat,sha256=LdVmBAL7nzDp-Ab_uHidBAi2crIf9nXhf8tBNfa7xdI,617 +babel/locale-data/ve.dat,sha256=5bInQioXkePSDbBerQqf4sYPTiB9-zpKuDokCXX5eNA,2372 +babel/locale-data/ve_ZA.dat,sha256=uJndHi9RMKtDWd58f_Q3g5WgXjL3W7KLQj91rVueabQ,635 +babel/locale-data/vec.dat,sha256=zokLfsgTK7cSP4KaSV8EMpPlHiOkI6tG3rWM7o7vcAM,160413 +babel/locale-data/vec_IT.dat,sha256=mC9jRfk9ndmkpRIpWZNCwdMwvxvB6QX6_9HanawdaUw,654 +babel/locale-data/vi.dat,sha256=F95a-fvLPIeJqOlwx4gr9TnWZ0VpSPyzNwJ0RPc1qE8,134138 +babel/locale-data/vi_VN.dat,sha256=cGwN0vw-qIaeA2g89U97N1xHSMmmaIVNPCLL2P_QJMk,635 +babel/locale-data/vmw.dat,sha256=mhERiGM-732X9KO0CThGEyjFtSbquT1_rmzYPnru2SM,1796 +babel/locale-data/vmw_MZ.dat,sha256=sz0j5RufN9oAzTalcjWNhKtCoEXzeRr5Cv6qCouK45E,636 +babel/locale-data/vo.dat,sha256=werwY25uwomUcf9q1dyQ8Rwgg2aCoLp78XUzBeSw0LY,4609 +babel/locale-data/vo_001.dat,sha256=iF2xY9XIdxC0mOYEp9hjYZp2EG-si_YaNYXri_60-4w,850 +babel/locale-data/vun.dat,sha256=VGNPlnoRipnocGYPgeb39d9MmE6fe5nTMWtCk4m1AEY,15373 +babel/locale-data/vun_TZ.dat,sha256=YKrOeOS1VnU3BWQ7HWtxjS-gMKJcKAPQLf4HTgkzf70,617 +babel/locale-data/wa.dat,sha256=1r6krApI8oecIKQt_9RzbpwSN0LcWSjlG34Y9Rfh07Y,880 +babel/locale-data/wa_BE.dat,sha256=j4YADQloo07Oek1j3aOrLYkzcFkrViS1UdRrA0Z56-o,653 +babel/locale-data/wae.dat,sha256=qBKStFqpkAruVDgeZJvX6U0X-hq_NkETTqgR2e7A4UQ,29641 +babel/locale-data/wae_CH.dat,sha256=Z0Wzu5Q9IVTnLGwWu54ozVx-fgnFz0IE3yrky8Y1IkQ,654 +babel/locale-data/wal.dat,sha256=AD9ZfdNNjEhX2n9T0ykd_XwEbXK-wxmsLqq39O4BjWU,8406 +babel/locale-data/wal_ET.dat,sha256=tNjeuU4GPTWtDmsroGmi4VUql0dA57v1tEtDF4rslVg,636 +babel/locale-data/wbp.dat,sha256=kzXK04f538n-PrJl6nRKIaYHMid6rJ4ACmzPcCz7NgU,746 +babel/locale-data/wbp_AU.dat,sha256=BT2E1-WiomuRrteCzN1_AfLyDUdEOm0ehT5miAiepBQ,636 +babel/locale-data/wo.dat,sha256=iB86SoTMrnphiHy_om1Yxs-J8L5YFWYlbmiQjK6jc2k,61849 +babel/locale-data/wo_SN.dat,sha256=fvlwe-ImWs04fsxSjTsXf8IPxEIiEi45BX8xhoBC_yg,616 +babel/locale-data/xh.dat,sha256=xRy095MO_brgAUoDB3UKwhgDvOkBlhJ3cWj9dM2fvHI,64334 +babel/locale-data/xh_ZA.dat,sha256=9p6wHW1sxOghJMAgsP6BC3RdUhuvLpHoCkqvjsCmPps,635 +babel/locale-data/xnr.dat,sha256=Ot10zi4F4H5Yqx6kIJGPay65Rm-Gam2eJ7kAOgoJoJ0,142585 +babel/locale-data/xnr_IN.dat,sha256=UbNwudCNihEFVZu3ymanDhJ52YoupG0SDGwmDByPhzQ,659 +babel/locale-data/xog.dat,sha256=V4U36ibPCWDoUMf31-o9mDCwylsYU0nZEx5pt-MWecM,15866 +babel/locale-data/xog_UG.dat,sha256=bMX0Tk5zS4P2LqlOLLpVP4nZxBFhS_qc-ndXjilDCNI,640 +babel/locale-data/yav.dat,sha256=UupgFFmPVcV-IgY3Fd8Y9GoOcOWgY1P22ZHuA-4QSMU,14543 +babel/locale-data/yav_CM.dat,sha256=CsaKwep5CARetyBX-JXHFvUVsFe1KTN4Pyz1Wh7NTHw,636 +babel/locale-data/yi.dat,sha256=OWr2zb3k_toEmkSXcPweqE13Tr5RhvlMm4z358uCQiY,24264 +babel/locale-data/yi_UA.dat,sha256=DesjWHTuxEBrjOeq8c-B82j4Hnwu0ElR2IH3fZPmq-A,635 +babel/locale-data/yo.dat,sha256=iWLg-08Fk9QJLZPuokgbCeXkyfyQNaov51TT3i1pKgY,110427 +babel/locale-data/yo_BJ.dat,sha256=CP4B5N8cEouMKth-iCTTBEN74dEpdyZQTJbrbYayZFs,50036 +babel/locale-data/yo_NG.dat,sha256=BEIndIiMT1Mo18S5DAWpjefthptCVQkIPeVs0umSop0,616 +babel/locale-data/yrl.dat,sha256=2nwDuw5Q_dL4H2Oxl5ClzZU2Uw10j-koP5RgfnJ67y0,186854 +babel/locale-data/yrl_BR.dat,sha256=aUgLCNwgEORk2wtuez8AqkYahB8_mX41IWSqogt39YE,636 +babel/locale-data/yrl_CO.dat,sha256=pT0rllDKHZAUIK_itrkWP7irmih4im131Ume_wKzyks,9211 +babel/locale-data/yrl_VE.dat,sha256=_Tqu_pGUkzrd4M9SKXpn4g93z7Q5xlUMAtGvROS5x6M,9211 +babel/locale-data/yue.dat,sha256=lvTaoHXSVZHqcb5UCR8IeDiVRCE9IRsrDkhv0bGwzCg,143872 +babel/locale-data/yue_Hans.dat,sha256=ybTM8LU-H-QunhqnLmCQ9bE6zdsYMJPHdlh_hBv3AWk,145194 +babel/locale-data/yue_Hans_CN.dat,sha256=MOZnu5r0xokf672rwAXfgzG3VEeTfNlDbu36fR1bB6I,636 +babel/locale-data/yue_Hant.dat,sha256=76wefuhsGIjk0jT05KSTEU_pbb7AfNE2u56jdRoJaDM,1306 +babel/locale-data/yue_Hant_CN.dat,sha256=MOZnu5r0xokf672rwAXfgzG3VEeTfNlDbu36fR1bB6I,636 +babel/locale-data/yue_Hant_HK.dat,sha256=eMZ7mOTEyKzQz0MDIjvP_Z57CS9nFIP4-Uf0Jpx1CY4,636 +babel/locale-data/za.dat,sha256=5EbAmE-qqvt_e4geaFxBGJi81CVoZFK4dCcJ346P4yU,12705 +babel/locale-data/za_CN.dat,sha256=WzhnaughSM1C1twuKYBVrelLEer-guzT43a9yBNXCsg,635 +babel/locale-data/zgh.dat,sha256=Q2D9KQFgDfWk4fXOdEbPcLq3yX_zxjhlK_PVI61Ok4U,22018 +babel/locale-data/zgh_MA.dat,sha256=sV8aPBmHY23lKIzsRna-tPz3UiXoKCMQ1Ur2tCyx2YA,617 +babel/locale-data/zh.dat,sha256=SpSkmdVN5PX7CCdso1B-SyQZKMDTyZfZeT2l_kj2FoI,152100 +babel/locale-data/zh_Hans.dat,sha256=-wR64b65stjA2KWj4GWcBWiF3yI0A24p4K7wApj8qtc,1305 +babel/locale-data/zh_Hans_CN.dat,sha256=zz2qPpWEP9ba12T9cGsPXGI7Bg5LcmZ3NkAMiVTf61A,635 +babel/locale-data/zh_Hans_HK.dat,sha256=yPyZyU-xXSNyU1FYJIYpWwnh0d3uXOra9V9aj2j_YQU,3621 +babel/locale-data/zh_Hans_MO.dat,sha256=08kUXwHOXA0pRA8qIX7e4p0Nzl1XHSBjwhMh7f-nZBE,3752 +babel/locale-data/zh_Hans_MY.dat,sha256=iEFxl2XEm1zBzd1K0wXpiZFvU7l0UrNURh2p9DZdRLU,1300 +babel/locale-data/zh_Hans_SG.dat,sha256=OHZNiUfnteSXuzel-lZAMVgv58iiVTNhjq81T9Qu94s,3948 +babel/locale-data/zh_Hant.dat,sha256=31aRGt18bl6MdiI9iAozwltdkSQQ370TvzI8gid8CBI,154802 +babel/locale-data/zh_Hant_HK.dat,sha256=NXPCE_4pYgLatoeKLdQ0d8PQ-Mk_GeMF1s1JYX9m27M,49152 +babel/locale-data/zh_Hant_MO.dat,sha256=qCWPPEr87U1aemaIuf6nCYQ-Q3w_1HcXrYoncYVBd3g,657 +babel/locale-data/zh_Hant_MY.dat,sha256=3n4syQpQ9sXVe82sOEH7yQIdrU3dAtMhp7fEhzGN8_E,1203 +babel/locale-data/zh_Hant_TW.dat,sha256=5N4K8I3XG89knCaSoy97HGzTVOTiUcd_VmfvNJlA4Bg,635 +babel/locale-data/zh_Latn.dat,sha256=-wR64b65stjA2KWj4GWcBWiF3yI0A24p4K7wApj8qtc,1305 +babel/locale-data/zh_Latn_CN.dat,sha256=zz2qPpWEP9ba12T9cGsPXGI7Bg5LcmZ3NkAMiVTf61A,635 +babel/locale-data/zu.dat,sha256=e48g3oI1FjkROV3yHZ2GAwn_8wr2y3dMkj98NHW4X8Q,138626 +babel/locale-data/zu_ZA.dat,sha256=jHloBfkNbQETXgE-3xVxvESitWb994_-SoY0G4_JL5E,635 +babel/localedata.py,sha256=gzh3fMZIkA0k70eqXSRA46nbGWl-4BfQnB59czUmp7o,9116 +babel/localtime/__init__.py,sha256=_6ed9ZDImaEkVQdCbNitxCvRS7Cljpa5wsah0fl_628,1043 +babel/localtime/__pycache__/__init__.cpython-313.pyc,, +babel/localtime/__pycache__/_fallback.cpython-313.pyc,, +babel/localtime/__pycache__/_helpers.cpython-313.pyc,, +babel/localtime/__pycache__/_unix.cpython-313.pyc,, +babel/localtime/__pycache__/_win32.cpython-313.pyc,, +babel/localtime/_fallback.py,sha256=kBPMTXycRen_6lRxSj-VCGcXmzD1gklJpJ7ouxGLuMU,1207 +babel/localtime/_helpers.py,sha256=ZmLc8m46W-3GtsstLBdrw6BU3ZhSob8vKHkxgcZG9uw,1704 +babel/localtime/_unix.py,sha256=63rA_pJWM5FEKpJ3XAChL6Eosu5k-tla7C6n4mBkpyQ,3902 +babel/localtime/_win32.py,sha256=nSNnxSMOVAlvqvX50h9HSCzBfP7mj8njJ80JZ3pOIWk,3211 +babel/messages/__init__.py,sha256=1maeVkLsWdXYovEAxGOcGlNHM80PfphZmmivZJo5yTw,349 +babel/messages/__pycache__/__init__.cpython-313.pyc,, +babel/messages/__pycache__/_compat.cpython-313.pyc,, +babel/messages/__pycache__/catalog.cpython-313.pyc,, +babel/messages/__pycache__/checkers.cpython-313.pyc,, +babel/messages/__pycache__/extract.cpython-313.pyc,, +babel/messages/__pycache__/frontend.cpython-313.pyc,, +babel/messages/__pycache__/jslexer.cpython-313.pyc,, +babel/messages/__pycache__/mofile.cpython-313.pyc,, +babel/messages/__pycache__/plurals.cpython-313.pyc,, +babel/messages/__pycache__/pofile.cpython-313.pyc,, +babel/messages/__pycache__/setuptools_frontend.cpython-313.pyc,, +babel/messages/_compat.py,sha256=DNyCNMwH5vXgl_pq7cUYz3VcRC2gIPqeQLO5nN5neWE,1163 +babel/messages/catalog.py,sha256=2231tYkaywOeeb96nxm13aT9rLU9zPCqyA-hedf_QTc,37802 +babel/messages/checkers.py,sha256=VutlPZQQ_a4CqsGBNrywgC5QyW5yOhGpwZ2T3lNemqY,6219 +babel/messages/extract.py,sha256=NRMXMPjsdzirUdmgT3SFWkeZnRQUpj3VGcUPX7AxsPs,34274 +babel/messages/frontend.py,sha256=WsxpORPikJ8uhu7TM290y6d7Vxw35edYeGBlECLNkss,45408 +babel/messages/jslexer.py,sha256=6nGIZfX0dQlY0wlJ1zy5yWwoOaELY_ZWV26a5uKdsIQ,7207 +babel/messages/mofile.py,sha256=Qf0X-vIRYTQQpSJqWFY3nXPgCzxyUWAzrtle2fIpIPU,7265 +babel/messages/plurals.py,sha256=jsEnofU5b4PZKIloX0MjchYSxD3r1RRZ_GfEVRuETWQ,7495 +babel/messages/pofile.py,sha256=lMllxTXYRBa3m8wVsxXsJsayjCOePKYYZtFSZU5DVF4,25955 +babel/messages/setuptools_frontend.py,sha256=m1l9NHuawj1pSncZeC82cUJfdwxib_C7JSUb_2EhbUM,3485 +babel/numbers.py,sha256=GhjFEdksEkfmvPN7VjGjlptbtmVaboBZdRaB5zPMZvY,62758 +babel/plural.py,sha256=9NWPLtYleF8gsi23S9OIRth4WhND56E5fdFatwVb-uI,23112 +babel/py.typed,sha256=DtCsIDq6KOv2NOEdQjTbeMWJKRh6ZEL2E-6Mf1RLeMA,59 +babel/support.py,sha256=PLxaklxjez4pysEQ1n3rGbGMRKOPkOeszy73RZ1qctU,27516 +babel/units.py,sha256=K8CDi8z6u9envHjP1s2_TqDvVtbeg6zBN6QuksrtjIU,13753 +babel/util.py,sha256=gC2c7exKpi9yDALyoL4yGGW3S-BkADAZw9dIWXw95TM,9071 diff --git a/venv/Lib/site-packages/babel-2.17.0.dist-info/WHEEL b/venv/Lib/site-packages/babel-2.17.0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..505164bc02d63fe6b0b3299f849a77c5f1beeb41 --- /dev/null +++ b/venv/Lib/site-packages/babel-2.17.0.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: setuptools (75.8.0) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/venv/Lib/site-packages/babel-2.17.0.dist-info/entry_points.txt b/venv/Lib/site-packages/babel-2.17.0.dist-info/entry_points.txt new file mode 100644 index 0000000000000000000000000000000000000000..95235a5552bfe080a8908011a30be422dd2ca39e --- /dev/null +++ b/venv/Lib/site-packages/babel-2.17.0.dist-info/entry_points.txt @@ -0,0 +1,20 @@ +[babel.checkers] +num_plurals = babel.messages.checkers:num_plurals +python_format = babel.messages.checkers:python_format + +[babel.extractors] +ignore = babel.messages.extract:extract_nothing +javascript = babel.messages.extract:extract_javascript +python = babel.messages.extract:extract_python + +[console_scripts] +pybabel = babel.messages.frontend:main + +[distutils.commands] +compile_catalog = babel.messages.setuptools_frontend:compile_catalog +extract_messages = babel.messages.setuptools_frontend:extract_messages +init_catalog = babel.messages.setuptools_frontend:init_catalog +update_catalog = babel.messages.setuptools_frontend:update_catalog + +[distutils.setup_keywords] +message_extractors = babel.messages.setuptools_frontend:check_message_extractors diff --git a/venv/Lib/site-packages/babel-2.17.0.dist-info/top_level.txt b/venv/Lib/site-packages/babel-2.17.0.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..98f65931c4c84991b6fa555a19e7674cdf70c761 --- /dev/null +++ b/venv/Lib/site-packages/babel-2.17.0.dist-info/top_level.txt @@ -0,0 +1 @@ +babel diff --git a/venv/Lib/site-packages/babel/__init__.py b/venv/Lib/site-packages/babel/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7b277455843793778838de76df672d005f41f556 --- /dev/null +++ b/venv/Lib/site-packages/babel/__init__.py @@ -0,0 +1,38 @@ +""" + babel + ~~~~~ + + Integrated collection of utilities that assist in internationalizing and + localizing applications. + + This package is basically composed of two major parts: + + * tools to build and work with ``gettext`` message catalogs + * a Python interface to the CLDR (Common Locale Data Repository), providing + access to various locale display names, localized number and date + formatting, etc. + + :copyright: (c) 2013-2025 by the Babel Team. + :license: BSD, see LICENSE for more details. +""" + +from babel.core import ( + Locale, + UnknownLocaleError, + default_locale, + get_locale_identifier, + negotiate_locale, + parse_locale, +) + +__version__ = '2.17.0' + +__all__ = [ + 'Locale', + 'UnknownLocaleError', + '__version__', + 'default_locale', + 'get_locale_identifier', + 'negotiate_locale', + 'parse_locale', +] diff --git a/venv/Lib/site-packages/babel/__pycache__/__init__.cpython-313.pyc b/venv/Lib/site-packages/babel/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b297999f4174cb07098426010c2f3477abda6b57 Binary files /dev/null and b/venv/Lib/site-packages/babel/__pycache__/__init__.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/__pycache__/core.cpython-313.pyc b/venv/Lib/site-packages/babel/__pycache__/core.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d65e1bf2e88d3dd05c9de062be02ea233140f7b1 Binary files /dev/null and b/venv/Lib/site-packages/babel/__pycache__/core.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/__pycache__/dates.cpython-313.pyc b/venv/Lib/site-packages/babel/__pycache__/dates.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..22d59236d5f2ddf7c5873a78cd621a6634d93a0e Binary files /dev/null and b/venv/Lib/site-packages/babel/__pycache__/dates.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/__pycache__/languages.cpython-313.pyc b/venv/Lib/site-packages/babel/__pycache__/languages.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0a3a96fab8cfd6eafb730af3a78c9896c7f00b06 Binary files /dev/null and b/venv/Lib/site-packages/babel/__pycache__/languages.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/__pycache__/lists.cpython-313.pyc b/venv/Lib/site-packages/babel/__pycache__/lists.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e0ba7cb632af9db15cba21f642d52404526b96d5 Binary files /dev/null and b/venv/Lib/site-packages/babel/__pycache__/lists.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/__pycache__/localedata.cpython-313.pyc b/venv/Lib/site-packages/babel/__pycache__/localedata.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c0e0e8ba7b5df8e274929176535a788f67ab2fa1 Binary files /dev/null and b/venv/Lib/site-packages/babel/__pycache__/localedata.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/__pycache__/numbers.cpython-313.pyc b/venv/Lib/site-packages/babel/__pycache__/numbers.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..80bfcd8d5823d1235901a397e4a3d5e93d467d9f Binary files /dev/null and b/venv/Lib/site-packages/babel/__pycache__/numbers.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/__pycache__/plural.cpython-313.pyc b/venv/Lib/site-packages/babel/__pycache__/plural.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ad643b9898ce8cb422327460ccccc490a88144df Binary files /dev/null and b/venv/Lib/site-packages/babel/__pycache__/plural.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/__pycache__/support.cpython-313.pyc b/venv/Lib/site-packages/babel/__pycache__/support.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ecf6b28aa31dca65fa905db6df45e4b3ae0eb85f Binary files /dev/null and b/venv/Lib/site-packages/babel/__pycache__/support.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/__pycache__/units.cpython-313.pyc b/venv/Lib/site-packages/babel/__pycache__/units.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2db2d69c6c931483ef155adfb70d3b9791fa89ca Binary files /dev/null and b/venv/Lib/site-packages/babel/__pycache__/units.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/__pycache__/util.cpython-313.pyc b/venv/Lib/site-packages/babel/__pycache__/util.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3a229a0918730082217437f109816fbc2bed3a65 Binary files /dev/null and b/venv/Lib/site-packages/babel/__pycache__/util.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/core.py b/venv/Lib/site-packages/babel/core.py new file mode 100644 index 0000000000000000000000000000000000000000..5762bbe36b41a8a4e481f5814ff191dbfd37e1d0 --- /dev/null +++ b/venv/Lib/site-packages/babel/core.py @@ -0,0 +1,1337 @@ +""" + babel.core + ~~~~~~~~~~ + + Core locale representation and locale data access. + + :copyright: (c) 2013-2025 by the Babel Team. + :license: BSD, see LICENSE for more details. +""" + +from __future__ import annotations + +import os +import pickle +from collections.abc import Iterable, Mapping +from typing import TYPE_CHECKING, Any, Literal + +from babel import localedata +from babel.plural import PluralRule + +__all__ = [ + 'Locale', + 'UnknownLocaleError', + 'default_locale', + 'get_global', + 'get_locale_identifier', + 'negotiate_locale', + 'parse_locale', +] + +if TYPE_CHECKING: + from typing_extensions import TypeAlias + + _GLOBAL_KEY: TypeAlias = Literal[ + "all_currencies", + "currency_fractions", + "language_aliases", + "likely_subtags", + "meta_zones", + "parent_exceptions", + "script_aliases", + "territory_aliases", + "territory_currencies", + "territory_languages", + "territory_zones", + "variant_aliases", + "windows_zone_mapping", + "zone_aliases", + "zone_territories", + ] + + _global_data: Mapping[_GLOBAL_KEY, Mapping[str, Any]] | None + +_global_data = None +_default_plural_rule = PluralRule({}) + + +def _raise_no_data_error(): + raise RuntimeError('The babel data files are not available. ' + 'This usually happens because you are using ' + 'a source checkout from Babel and you did ' + 'not build the data files. Just make sure ' + 'to run "python setup.py import_cldr" before ' + 'installing the library.') + + +def get_global(key: _GLOBAL_KEY) -> Mapping[str, Any]: + """Return the dictionary for the given key in the global data. + + The global data is stored in the ``babel/global.dat`` file and contains + information independent of individual locales. + + >>> get_global('zone_aliases')['UTC'] + u'Etc/UTC' + >>> get_global('zone_territories')['Europe/Berlin'] + u'DE' + + The keys available are: + + - ``all_currencies`` + - ``currency_fractions`` + - ``language_aliases`` + - ``likely_subtags`` + - ``parent_exceptions`` + - ``script_aliases`` + - ``territory_aliases`` + - ``territory_currencies`` + - ``territory_languages`` + - ``territory_zones`` + - ``variant_aliases`` + - ``windows_zone_mapping`` + - ``zone_aliases`` + - ``zone_territories`` + + .. note:: The internal structure of the data may change between versions. + + .. versionadded:: 0.9 + + :param key: the data key + """ + global _global_data + if _global_data is None: + dirname = os.path.join(os.path.dirname(__file__)) + filename = os.path.join(dirname, 'global.dat') + if not os.path.isfile(filename): + _raise_no_data_error() + with open(filename, 'rb') as fileobj: + _global_data = pickle.load(fileobj) + assert _global_data is not None + return _global_data.get(key, {}) + + +LOCALE_ALIASES = { + 'ar': 'ar_SY', 'bg': 'bg_BG', 'bs': 'bs_BA', 'ca': 'ca_ES', 'cs': 'cs_CZ', + 'da': 'da_DK', 'de': 'de_DE', 'el': 'el_GR', 'en': 'en_US', 'es': 'es_ES', + 'et': 'et_EE', 'fa': 'fa_IR', 'fi': 'fi_FI', 'fr': 'fr_FR', 'gl': 'gl_ES', + 'he': 'he_IL', 'hu': 'hu_HU', 'id': 'id_ID', 'is': 'is_IS', 'it': 'it_IT', + 'ja': 'ja_JP', 'km': 'km_KH', 'ko': 'ko_KR', 'lt': 'lt_LT', 'lv': 'lv_LV', + 'mk': 'mk_MK', 'nl': 'nl_NL', 'nn': 'nn_NO', 'no': 'nb_NO', 'pl': 'pl_PL', + 'pt': 'pt_PT', 'ro': 'ro_RO', 'ru': 'ru_RU', 'sk': 'sk_SK', 'sl': 'sl_SI', + 'sv': 'sv_SE', 'th': 'th_TH', 'tr': 'tr_TR', 'uk': 'uk_UA', +} + + +class UnknownLocaleError(Exception): + """Exception thrown when a locale is requested for which no locale data + is available. + """ + + def __init__(self, identifier: str) -> None: + """Create the exception. + + :param identifier: the identifier string of the unsupported locale + """ + Exception.__init__(self, f"unknown locale {identifier!r}") + + #: The identifier of the locale that could not be found. + self.identifier = identifier + + +class Locale: + """Representation of a specific locale. + + >>> locale = Locale('en', 'US') + >>> repr(locale) + "Locale('en', territory='US')" + >>> locale.display_name + u'English (United States)' + + A `Locale` object can also be instantiated from a raw locale string: + + >>> locale = Locale.parse('en-US', sep='-') + >>> repr(locale) + "Locale('en', territory='US')" + + `Locale` objects provide access to a collection of locale data, such as + territory and language names, number and date format patterns, and more: + + >>> locale.number_symbols['latn']['decimal'] + u'.' + + If a locale is requested for which no locale data is available, an + `UnknownLocaleError` is raised: + + >>> Locale.parse('en_XX') + Traceback (most recent call last): + ... + UnknownLocaleError: unknown locale 'en_XX' + + For more information see :rfc:`3066`. + """ + + def __init__( + self, + language: str, + territory: str | None = None, + script: str | None = None, + variant: str | None = None, + modifier: str | None = None, + ) -> None: + """Initialize the locale object from the given identifier components. + + >>> locale = Locale('en', 'US') + >>> locale.language + 'en' + >>> locale.territory + 'US' + + :param language: the language code + :param territory: the territory (country or region) code + :param script: the script code + :param variant: the variant code + :param modifier: a modifier (following the '@' symbol, sometimes called '@variant') + :raise `UnknownLocaleError`: if no locale data is available for the + requested locale + """ + #: the language code + self.language = language + #: the territory (country or region) code + self.territory = territory + #: the script code + self.script = script + #: the variant code + self.variant = variant + #: the modifier + self.modifier = modifier + self.__data: localedata.LocaleDataDict | None = None + + identifier = str(self) + identifier_without_modifier = identifier.partition('@')[0] + if localedata.exists(identifier): + self.__data_identifier = identifier + elif localedata.exists(identifier_without_modifier): + self.__data_identifier = identifier_without_modifier + else: + raise UnknownLocaleError(identifier) + + @classmethod + def default(cls, category: str | None = None, aliases: Mapping[str, str] = LOCALE_ALIASES) -> Locale: + """Return the system default locale for the specified category. + + >>> for name in ['LANGUAGE', 'LC_ALL', 'LC_CTYPE', 'LC_MESSAGES']: + ... os.environ[name] = '' + >>> os.environ['LANG'] = 'fr_FR.UTF-8' + >>> Locale.default('LC_MESSAGES') + Locale('fr', territory='FR') + + The following fallbacks to the variable are always considered: + + - ``LANGUAGE`` + - ``LC_ALL`` + - ``LC_CTYPE`` + - ``LANG`` + + :param category: one of the ``LC_XXX`` environment variable names + :param aliases: a dictionary of aliases for locale identifiers + """ + # XXX: use likely subtag expansion here instead of the + # aliases dictionary. + locale_string = default_locale(category, aliases=aliases) + return cls.parse(locale_string) + + @classmethod + def negotiate( + cls, + preferred: Iterable[str], + available: Iterable[str], + sep: str = '_', + aliases: Mapping[str, str] = LOCALE_ALIASES, + ) -> Locale | None: + """Find the best match between available and requested locale strings. + + >>> Locale.negotiate(['de_DE', 'en_US'], ['de_DE', 'de_AT']) + Locale('de', territory='DE') + >>> Locale.negotiate(['de_DE', 'en_US'], ['en', 'de']) + Locale('de') + >>> Locale.negotiate(['de_DE', 'de'], ['en_US']) + + You can specify the character used in the locale identifiers to separate + the different components. This separator is applied to both lists. Also, + case is ignored in the comparison: + + >>> Locale.negotiate(['de-DE', 'de'], ['en-us', 'de-de'], sep='-') + Locale('de', territory='DE') + + :param preferred: the list of locale identifiers preferred by the user + :param available: the list of locale identifiers available + :param aliases: a dictionary of aliases for locale identifiers + :param sep: separator for parsing; e.g. Windows tends to use '-' instead of '_'. + """ + identifier = negotiate_locale(preferred, available, sep=sep, + aliases=aliases) + if identifier: + return Locale.parse(identifier, sep=sep) + return None + + @classmethod + def parse( + cls, + identifier: Locale | str | None, + sep: str = '_', + resolve_likely_subtags: bool = True, + ) -> Locale: + """Create a `Locale` instance for the given locale identifier. + + >>> l = Locale.parse('de-DE', sep='-') + >>> l.display_name + u'Deutsch (Deutschland)' + + If the `identifier` parameter is not a string, but actually a `Locale` + object, that object is returned: + + >>> Locale.parse(l) + Locale('de', territory='DE') + + If the `identifier` parameter is neither of these, such as `None` + or an empty string, e.g. because a default locale identifier + could not be determined, a `TypeError` is raised: + + >>> Locale.parse(None) + Traceback (most recent call last): + ... + TypeError: ... + + This also can perform resolving of likely subtags which it does + by default. This is for instance useful to figure out the most + likely locale for a territory you can use ``'und'`` as the + language tag: + + >>> Locale.parse('und_AT') + Locale('de', territory='AT') + + Modifiers are optional, and always at the end, separated by "@": + + >>> Locale.parse('de_AT@euro') + Locale('de', territory='AT', modifier='euro') + + :param identifier: the locale identifier string + :param sep: optional component separator + :param resolve_likely_subtags: if this is specified then a locale will + have its likely subtag resolved if the + locale otherwise does not exist. For + instance ``zh_TW`` by itself is not a + locale that exists but Babel can + automatically expand it to the full + form of ``zh_hant_TW``. Note that this + expansion is only taking place if no + locale exists otherwise. For instance + there is a locale ``en`` that can exist + by itself. + :raise `ValueError`: if the string does not appear to be a valid locale + identifier + :raise `UnknownLocaleError`: if no locale data is available for the + requested locale + :raise `TypeError`: if the identifier is not a string or a `Locale` + :raise `ValueError`: if the identifier is not a valid string + """ + if isinstance(identifier, Locale): + return identifier + + if not identifier: + msg = ( + f"Empty locale identifier value: {identifier!r}\n\n" + f"If you didn't explicitly pass an empty value to a Babel function, " + f"this could be caused by there being no suitable locale environment " + f"variables for the API you tried to use.", + ) + if isinstance(identifier, str): + raise ValueError(msg) # `parse_locale` would raise a ValueError, so let's do that here + raise TypeError(msg) + + if not isinstance(identifier, str): + raise TypeError(f"Unexpected value for identifier: {identifier!r}") + + parts = parse_locale(identifier, sep=sep) + input_id = get_locale_identifier(parts) + + def _try_load(parts): + try: + return cls(*parts) + except UnknownLocaleError: + return None + + def _try_load_reducing(parts): + # Success on first hit, return it. + locale = _try_load(parts) + if locale is not None: + return locale + + # Now try without script and variant + locale = _try_load(parts[:2]) + if locale is not None: + return locale + + locale = _try_load(parts) + if locale is not None: + return locale + if not resolve_likely_subtags: + raise UnknownLocaleError(input_id) + + # From here onwards is some very bad likely subtag resolving. This + # whole logic is not entirely correct but good enough (tm) for the + # time being. This has been added so that zh_TW does not cause + # errors for people when they upgrade. Later we should properly + # implement ICU like fuzzy locale objects and provide a way to + # maximize and minimize locale tags. + + if len(parts) == 5: + language, territory, script, variant, modifier = parts + else: + language, territory, script, variant = parts + modifier = None + language = get_global('language_aliases').get(language, language) + territory = get_global('territory_aliases').get(territory or '', (territory,))[0] + script = get_global('script_aliases').get(script or '', script) + variant = get_global('variant_aliases').get(variant or '', variant) + + if territory == 'ZZ': + territory = None + if script == 'Zzzz': + script = None + + parts = language, territory, script, variant, modifier + + # First match: try the whole identifier + new_id = get_locale_identifier(parts) + likely_subtag = get_global('likely_subtags').get(new_id) + if likely_subtag is not None: + locale = _try_load_reducing(parse_locale(likely_subtag)) + if locale is not None: + return locale + + # If we did not find anything so far, try again with a + # simplified identifier that is just the language + likely_subtag = get_global('likely_subtags').get(language) + if likely_subtag is not None: + parts2 = parse_locale(likely_subtag) + if len(parts2) == 5: + language2, _, script2, variant2, modifier2 = parts2 + else: + language2, _, script2, variant2 = parts2 + modifier2 = None + locale = _try_load_reducing((language2, territory, script2, variant2, modifier2)) + if locale is not None: + return locale + + raise UnknownLocaleError(input_id) + + def __eq__(self, other: object) -> bool: + for key in ('language', 'territory', 'script', 'variant', 'modifier'): + if not hasattr(other, key): + return False + return ( + self.language == getattr(other, 'language') and # noqa: B009 + self.territory == getattr(other, 'territory') and # noqa: B009 + self.script == getattr(other, 'script') and # noqa: B009 + self.variant == getattr(other, 'variant') and # noqa: B009 + self.modifier == getattr(other, 'modifier') # noqa: B009 + ) + + def __ne__(self, other: object) -> bool: + return not self.__eq__(other) + + def __hash__(self) -> int: + return hash((self.language, self.territory, self.script, + self.variant, self.modifier)) + + def __repr__(self) -> str: + parameters = [''] + for key in ('territory', 'script', 'variant', 'modifier'): + value = getattr(self, key) + if value is not None: + parameters.append(f"{key}={value!r}") + return f"Locale({self.language!r}{', '.join(parameters)})" + + def __str__(self) -> str: + return get_locale_identifier((self.language, self.territory, + self.script, self.variant, + self.modifier)) + + @property + def _data(self) -> localedata.LocaleDataDict: + if self.__data is None: + self.__data = localedata.LocaleDataDict(localedata.load(self.__data_identifier)) + return self.__data + + def get_display_name(self, locale: Locale | str | None = None) -> str | None: + """Return the display name of the locale using the given locale. + + The display name will include the language, territory, script, and + variant, if those are specified. + + >>> Locale('zh', 'CN', script='Hans').get_display_name('en') + u'Chinese (Simplified, China)' + + Modifiers are currently passed through verbatim: + + >>> Locale('it', 'IT', modifier='euro').get_display_name('en') + u'Italian (Italy, euro)' + + :param locale: the locale to use + """ + if locale is None: + locale = self + locale = Locale.parse(locale) + retval = locale.languages.get(self.language) + if retval and (self.territory or self.script or self.variant): + details = [] + if self.script: + details.append(locale.scripts.get(self.script)) + if self.territory: + details.append(locale.territories.get(self.territory)) + if self.variant: + details.append(locale.variants.get(self.variant)) + if self.modifier: + details.append(self.modifier) + detail_string = ', '.join(atom for atom in details if atom) + if detail_string: + retval += f" ({detail_string})" + return retval + + display_name = property(get_display_name, doc="""\ + The localized display name of the locale. + + >>> Locale('en').display_name + u'English' + >>> Locale('en', 'US').display_name + u'English (United States)' + >>> Locale('sv').display_name + u'svenska' + + :type: `unicode` + """) + + def get_language_name(self, locale: Locale | str | None = None) -> str | None: + """Return the language of this locale in the given locale. + + >>> Locale('zh', 'CN', script='Hans').get_language_name('de') + u'Chinesisch' + + .. versionadded:: 1.0 + + :param locale: the locale to use + """ + if locale is None: + locale = self + locale = Locale.parse(locale) + return locale.languages.get(self.language) + + language_name = property(get_language_name, doc="""\ + The localized language name of the locale. + + >>> Locale('en', 'US').language_name + u'English' + """) + + def get_territory_name(self, locale: Locale | str | None = None) -> str | None: + """Return the territory name in the given locale.""" + if locale is None: + locale = self + locale = Locale.parse(locale) + return locale.territories.get(self.territory or '') + + territory_name = property(get_territory_name, doc="""\ + The localized territory name of the locale if available. + + >>> Locale('de', 'DE').territory_name + u'Deutschland' + """) + + def get_script_name(self, locale: Locale | str | None = None) -> str | None: + """Return the script name in the given locale.""" + if locale is None: + locale = self + locale = Locale.parse(locale) + return locale.scripts.get(self.script or '') + + script_name = property(get_script_name, doc="""\ + The localized script name of the locale if available. + + >>> Locale('sr', 'ME', script='Latn').script_name + u'latinica' + """) + + @property + def english_name(self) -> str | None: + """The english display name of the locale. + + >>> Locale('de').english_name + u'German' + >>> Locale('de', 'DE').english_name + u'German (Germany)' + + :type: `unicode`""" + return self.get_display_name(Locale('en')) + + # { General Locale Display Names + + @property + def languages(self) -> localedata.LocaleDataDict: + """Mapping of language codes to translated language names. + + >>> Locale('de', 'DE').languages['ja'] + u'Japanisch' + + See `ISO 639 `_ for + more information. + """ + return self._data['languages'] + + @property + def scripts(self) -> localedata.LocaleDataDict: + """Mapping of script codes to translated script names. + + >>> Locale('en', 'US').scripts['Hira'] + u'Hiragana' + + See `ISO 15924 `_ + for more information. + """ + return self._data['scripts'] + + @property + def territories(self) -> localedata.LocaleDataDict: + """Mapping of script codes to translated script names. + + >>> Locale('es', 'CO').territories['DE'] + u'Alemania' + + See `ISO 3166 `_ + for more information. + """ + return self._data['territories'] + + @property + def variants(self) -> localedata.LocaleDataDict: + """Mapping of script codes to translated script names. + + >>> Locale('de', 'DE').variants['1901'] + u'Alte deutsche Rechtschreibung' + """ + return self._data['variants'] + + # { Number Formatting + + @property + def currencies(self) -> localedata.LocaleDataDict: + """Mapping of currency codes to translated currency names. This + only returns the generic form of the currency name, not the count + specific one. If an actual number is requested use the + :func:`babel.numbers.get_currency_name` function. + + >>> Locale('en').currencies['COP'] + u'Colombian Peso' + >>> Locale('de', 'DE').currencies['COP'] + u'Kolumbianischer Peso' + """ + return self._data['currency_names'] + + @property + def currency_symbols(self) -> localedata.LocaleDataDict: + """Mapping of currency codes to symbols. + + >>> Locale('en', 'US').currency_symbols['USD'] + u'$' + >>> Locale('es', 'CO').currency_symbols['USD'] + u'US$' + """ + return self._data['currency_symbols'] + + @property + def number_symbols(self) -> localedata.LocaleDataDict: + """Symbols used in number formatting by number system. + + .. note:: The format of the value returned may change between + Babel versions. + + >>> Locale('fr', 'FR').number_symbols["latn"]['decimal'] + u',' + >>> Locale('fa', 'IR').number_symbols["arabext"]['decimal'] + u'٫' + >>> Locale('fa', 'IR').number_symbols["latn"]['decimal'] + u'.' + """ + return self._data['number_symbols'] + + @property + def other_numbering_systems(self) -> localedata.LocaleDataDict: + """ + Mapping of other numbering systems available for the locale. + See: https://www.unicode.org/reports/tr35/tr35-numbers.html#otherNumberingSystems + + >>> Locale('el', 'GR').other_numbering_systems['traditional'] + u'grek' + + .. note:: The format of the value returned may change between + Babel versions. + """ + return self._data['numbering_systems'] + + @property + def default_numbering_system(self) -> str: + """The default numbering system used by the locale. + >>> Locale('el', 'GR').default_numbering_system + u'latn' + """ + return self._data['default_numbering_system'] + + @property + def decimal_formats(self) -> localedata.LocaleDataDict: + """Locale patterns for decimal number formatting. + + .. note:: The format of the value returned may change between + Babel versions. + + >>> Locale('en', 'US').decimal_formats[None] + + """ + return self._data['decimal_formats'] + + @property + def compact_decimal_formats(self) -> localedata.LocaleDataDict: + """Locale patterns for compact decimal number formatting. + + .. note:: The format of the value returned may change between + Babel versions. + + >>> Locale('en', 'US').compact_decimal_formats["short"]["one"]["1000"] + + """ + return self._data['compact_decimal_formats'] + + @property + def currency_formats(self) -> localedata.LocaleDataDict: + """Locale patterns for currency number formatting. + + .. note:: The format of the value returned may change between + Babel versions. + + >>> Locale('en', 'US').currency_formats['standard'] + + >>> Locale('en', 'US').currency_formats['accounting'] + + """ + return self._data['currency_formats'] + + @property + def compact_currency_formats(self) -> localedata.LocaleDataDict: + """Locale patterns for compact currency number formatting. + + .. note:: The format of the value returned may change between + Babel versions. + + >>> Locale('en', 'US').compact_currency_formats["short"]["one"]["1000"] + + """ + return self._data['compact_currency_formats'] + + @property + def percent_formats(self) -> localedata.LocaleDataDict: + """Locale patterns for percent number formatting. + + .. note:: The format of the value returned may change between + Babel versions. + + >>> Locale('en', 'US').percent_formats[None] + + """ + return self._data['percent_formats'] + + @property + def scientific_formats(self) -> localedata.LocaleDataDict: + """Locale patterns for scientific number formatting. + + .. note:: The format of the value returned may change between + Babel versions. + + >>> Locale('en', 'US').scientific_formats[None] + + """ + return self._data['scientific_formats'] + + # { Calendar Information and Date Formatting + + @property + def periods(self) -> localedata.LocaleDataDict: + """Locale display names for day periods (AM/PM). + + >>> Locale('en', 'US').periods['am'] + u'AM' + """ + try: + return self._data['day_periods']['stand-alone']['wide'] + except KeyError: + return localedata.LocaleDataDict({}) # pragma: no cover + + @property + def day_periods(self) -> localedata.LocaleDataDict: + """Locale display names for various day periods (not necessarily only AM/PM). + + These are not meant to be used without the relevant `day_period_rules`. + """ + return self._data['day_periods'] + + @property + def day_period_rules(self) -> localedata.LocaleDataDict: + """Day period rules for the locale. Used by `get_period_id`. + """ + return self._data.get('day_period_rules', localedata.LocaleDataDict({})) + + @property + def days(self) -> localedata.LocaleDataDict: + """Locale display names for weekdays. + + >>> Locale('de', 'DE').days['format']['wide'][3] + u'Donnerstag' + """ + return self._data['days'] + + @property + def months(self) -> localedata.LocaleDataDict: + """Locale display names for months. + + >>> Locale('de', 'DE').months['format']['wide'][10] + u'Oktober' + """ + return self._data['months'] + + @property + def quarters(self) -> localedata.LocaleDataDict: + """Locale display names for quarters. + + >>> Locale('de', 'DE').quarters['format']['wide'][1] + u'1. Quartal' + """ + return self._data['quarters'] + + @property + def eras(self) -> localedata.LocaleDataDict: + """Locale display names for eras. + + .. note:: The format of the value returned may change between + Babel versions. + + >>> Locale('en', 'US').eras['wide'][1] + u'Anno Domini' + >>> Locale('en', 'US').eras['abbreviated'][0] + u'BC' + """ + return self._data['eras'] + + @property + def time_zones(self) -> localedata.LocaleDataDict: + """Locale display names for time zones. + + .. note:: The format of the value returned may change between + Babel versions. + + >>> Locale('en', 'US').time_zones['Europe/London']['long']['daylight'] + u'British Summer Time' + >>> Locale('en', 'US').time_zones['America/St_Johns']['city'] + u'St. John\u2019s' + """ + return self._data['time_zones'] + + @property + def meta_zones(self) -> localedata.LocaleDataDict: + """Locale display names for meta time zones. + + Meta time zones are basically groups of different Olson time zones that + have the same GMT offset and daylight savings time. + + .. note:: The format of the value returned may change between + Babel versions. + + >>> Locale('en', 'US').meta_zones['Europe_Central']['long']['daylight'] + u'Central European Summer Time' + + .. versionadded:: 0.9 + """ + return self._data['meta_zones'] + + @property + def zone_formats(self) -> localedata.LocaleDataDict: + """Patterns related to the formatting of time zones. + + .. note:: The format of the value returned may change between + Babel versions. + + >>> Locale('en', 'US').zone_formats['fallback'] + u'%(1)s (%(0)s)' + >>> Locale('pt', 'BR').zone_formats['region'] + u'Hor\\xe1rio %s' + + .. versionadded:: 0.9 + """ + return self._data['zone_formats'] + + @property + def first_week_day(self) -> int: + """The first day of a week, with 0 being Monday. + + >>> Locale('de', 'DE').first_week_day + 0 + >>> Locale('en', 'US').first_week_day + 6 + """ + return self._data['week_data']['first_day'] + + @property + def weekend_start(self) -> int: + """The day the weekend starts, with 0 being Monday. + + >>> Locale('de', 'DE').weekend_start + 5 + """ + return self._data['week_data']['weekend_start'] + + @property + def weekend_end(self) -> int: + """The day the weekend ends, with 0 being Monday. + + >>> Locale('de', 'DE').weekend_end + 6 + """ + return self._data['week_data']['weekend_end'] + + @property + def min_week_days(self) -> int: + """The minimum number of days in a week so that the week is counted as + the first week of a year or month. + + >>> Locale('de', 'DE').min_week_days + 4 + """ + return self._data['week_data']['min_days'] + + @property + def date_formats(self) -> localedata.LocaleDataDict: + """Locale patterns for date formatting. + + .. note:: The format of the value returned may change between + Babel versions. + + >>> Locale('en', 'US').date_formats['short'] + + >>> Locale('fr', 'FR').date_formats['long'] + + """ + return self._data['date_formats'] + + @property + def time_formats(self) -> localedata.LocaleDataDict: + """Locale patterns for time formatting. + + .. note:: The format of the value returned may change between + Babel versions. + + >>> Locale('en', 'US').time_formats['short'] + + >>> Locale('fr', 'FR').time_formats['long'] + + """ + return self._data['time_formats'] + + @property + def datetime_formats(self) -> localedata.LocaleDataDict: + """Locale patterns for datetime formatting. + + .. note:: The format of the value returned may change between + Babel versions. + + >>> Locale('en').datetime_formats['full'] + u'{1}, {0}' + >>> Locale('th').datetime_formats['medium'] + u'{1} {0}' + """ + return self._data['datetime_formats'] + + @property + def datetime_skeletons(self) -> localedata.LocaleDataDict: + """Locale patterns for formatting parts of a datetime. + + >>> Locale('en').datetime_skeletons['MEd'] + + >>> Locale('fr').datetime_skeletons['MEd'] + + >>> Locale('fr').datetime_skeletons['H'] + + """ + return self._data['datetime_skeletons'] + + @property + def interval_formats(self) -> localedata.LocaleDataDict: + """Locale patterns for interval formatting. + + .. note:: The format of the value returned may change between + Babel versions. + + How to format date intervals in Finnish when the day is the + smallest changing component: + + >>> Locale('fi_FI').interval_formats['MEd']['d'] + [u'E d.\u2009\u2013\u2009', u'E d.M.'] + + .. seealso:: + + The primary API to use this data is :py:func:`babel.dates.format_interval`. + + + :rtype: dict[str, dict[str, list[str]]] + """ + return self._data['interval_formats'] + + @property + def plural_form(self) -> PluralRule: + """Plural rules for the locale. + + >>> Locale('en').plural_form(1) + 'one' + >>> Locale('en').plural_form(0) + 'other' + >>> Locale('fr').plural_form(0) + 'one' + >>> Locale('ru').plural_form(100) + 'many' + """ + return self._data.get('plural_form', _default_plural_rule) + + @property + def list_patterns(self) -> localedata.LocaleDataDict: + """Patterns for generating lists + + .. note:: The format of the value returned may change between + Babel versions. + + >>> Locale('en').list_patterns['standard']['start'] + u'{0}, {1}' + >>> Locale('en').list_patterns['standard']['end'] + u'{0}, and {1}' + >>> Locale('en_GB').list_patterns['standard']['end'] + u'{0} and {1}' + """ + return self._data['list_patterns'] + + @property + def ordinal_form(self) -> PluralRule: + """Plural rules for the locale. + + >>> Locale('en').ordinal_form(1) + 'one' + >>> Locale('en').ordinal_form(2) + 'two' + >>> Locale('en').ordinal_form(3) + 'few' + >>> Locale('fr').ordinal_form(2) + 'other' + >>> Locale('ru').ordinal_form(100) + 'other' + """ + return self._data.get('ordinal_form', _default_plural_rule) + + @property + def measurement_systems(self) -> localedata.LocaleDataDict: + """Localized names for various measurement systems. + + >>> Locale('fr', 'FR').measurement_systems['US'] + u'am\\xe9ricain' + >>> Locale('en', 'US').measurement_systems['US'] + u'US' + + """ + return self._data['measurement_systems'] + + @property + def character_order(self) -> str: + """The text direction for the language. + + >>> Locale('de', 'DE').character_order + 'left-to-right' + >>> Locale('ar', 'SA').character_order + 'right-to-left' + """ + return self._data['character_order'] + + @property + def text_direction(self) -> str: + """The text direction for the language in CSS short-hand form. + + >>> Locale('de', 'DE').text_direction + 'ltr' + >>> Locale('ar', 'SA').text_direction + 'rtl' + """ + return ''.join(word[0] for word in self.character_order.split('-')) + + @property + def unit_display_names(self) -> localedata.LocaleDataDict: + """Display names for units of measurement. + + .. seealso:: + + You may want to use :py:func:`babel.units.get_unit_name` instead. + + .. note:: The format of the value returned may change between + Babel versions. + + """ + return self._data['unit_display_names'] + + +def default_locale( + category: str | tuple[str, ...] | list[str] | None = None, + aliases: Mapping[str, str] = LOCALE_ALIASES, +) -> str | None: + """Returns the system default locale for a given category, based on + environment variables. + + >>> for name in ['LANGUAGE', 'LC_ALL', 'LC_CTYPE']: + ... os.environ[name] = '' + >>> os.environ['LANG'] = 'fr_FR.UTF-8' + >>> default_locale('LC_MESSAGES') + 'fr_FR' + + The "C" or "POSIX" pseudo-locales are treated as aliases for the + "en_US_POSIX" locale: + + >>> os.environ['LC_MESSAGES'] = 'POSIX' + >>> default_locale('LC_MESSAGES') + 'en_US_POSIX' + + The following fallbacks to the variable are always considered: + + - ``LANGUAGE`` + - ``LC_ALL`` + - ``LC_CTYPE`` + - ``LANG`` + + :param category: one or more of the ``LC_XXX`` environment variable names + :param aliases: a dictionary of aliases for locale identifiers + """ + + varnames = ('LANGUAGE', 'LC_ALL', 'LC_CTYPE', 'LANG') + if category: + if isinstance(category, str): + varnames = (category, *varnames) + elif isinstance(category, (list, tuple)): + varnames = (*category, *varnames) + else: + raise TypeError(f"Invalid type for category: {category!r}") + + for name in varnames: + if not name: + continue + locale = os.getenv(name) + if locale: + if name == 'LANGUAGE' and ':' in locale: + # the LANGUAGE variable may contain a colon-separated list of + # language codes; we just pick the language on the list + locale = locale.split(':')[0] + if locale.split('.')[0] in ('C', 'POSIX'): + locale = 'en_US_POSIX' + elif aliases and locale in aliases: + locale = aliases[locale] + try: + return get_locale_identifier(parse_locale(locale)) + except ValueError: + pass + return None + + +def negotiate_locale(preferred: Iterable[str], available: Iterable[str], sep: str = '_', aliases: Mapping[str, str] = LOCALE_ALIASES) -> str | None: + """Find the best match between available and requested locale strings. + + >>> negotiate_locale(['de_DE', 'en_US'], ['de_DE', 'de_AT']) + 'de_DE' + >>> negotiate_locale(['de_DE', 'en_US'], ['en', 'de']) + 'de' + + Case is ignored by the algorithm, the result uses the case of the preferred + locale identifier: + + >>> negotiate_locale(['de_DE', 'en_US'], ['de_de', 'de_at']) + 'de_DE' + + >>> negotiate_locale(['de_DE', 'en_US'], ['de_de', 'de_at']) + 'de_DE' + + By default, some web browsers unfortunately do not include the territory + in the locale identifier for many locales, and some don't even allow the + user to easily add the territory. So while you may prefer using qualified + locale identifiers in your web-application, they would not normally match + the language-only locale sent by such browsers. To workaround that, this + function uses a default mapping of commonly used language-only locale + identifiers to identifiers including the territory: + + >>> negotiate_locale(['ja', 'en_US'], ['ja_JP', 'en_US']) + 'ja_JP' + + Some browsers even use an incorrect or outdated language code, such as "no" + for Norwegian, where the correct locale identifier would actually be "nb_NO" + (Bokmål) or "nn_NO" (Nynorsk). The aliases are intended to take care of + such cases, too: + + >>> negotiate_locale(['no', 'sv'], ['nb_NO', 'sv_SE']) + 'nb_NO' + + You can override this default mapping by passing a different `aliases` + dictionary to this function, or you can bypass the behavior althogher by + setting the `aliases` parameter to `None`. + + :param preferred: the list of locale strings preferred by the user + :param available: the list of locale strings available + :param sep: character that separates the different parts of the locale + strings + :param aliases: a dictionary of aliases for locale identifiers + """ + available = [a.lower() for a in available if a] + for locale in preferred: + ll = locale.lower() + if ll in available: + return locale + if aliases: + alias = aliases.get(ll) + if alias: + alias = alias.replace('_', sep) + if alias.lower() in available: + return alias + parts = locale.split(sep) + if len(parts) > 1 and parts[0].lower() in available: + return parts[0] + return None + + +def parse_locale( + identifier: str, + sep: str = '_', +) -> tuple[str, str | None, str | None, str | None] | tuple[str, str | None, str | None, str | None, str | None]: + """Parse a locale identifier into a tuple of the form ``(language, + territory, script, variant, modifier)``. + + >>> parse_locale('zh_CN') + ('zh', 'CN', None, None) + >>> parse_locale('zh_Hans_CN') + ('zh', 'CN', 'Hans', None) + >>> parse_locale('ca_es_valencia') + ('ca', 'ES', None, 'VALENCIA') + >>> parse_locale('en_150') + ('en', '150', None, None) + >>> parse_locale('en_us_posix') + ('en', 'US', None, 'POSIX') + >>> parse_locale('it_IT@euro') + ('it', 'IT', None, None, 'euro') + >>> parse_locale('it_IT@custom') + ('it', 'IT', None, None, 'custom') + >>> parse_locale('it_IT@') + ('it', 'IT', None, None) + + The default component separator is "_", but a different separator can be + specified using the `sep` parameter. + + The optional modifier is always separated with "@" and at the end: + + >>> parse_locale('zh-CN', sep='-') + ('zh', 'CN', None, None) + >>> parse_locale('zh-CN@custom', sep='-') + ('zh', 'CN', None, None, 'custom') + + If the identifier cannot be parsed into a locale, a `ValueError` exception + is raised: + + >>> parse_locale('not_a_LOCALE_String') + Traceback (most recent call last): + ... + ValueError: 'not_a_LOCALE_String' is not a valid locale identifier + + Encoding information is removed from the identifier, while modifiers are + kept: + + >>> parse_locale('en_US.UTF-8') + ('en', 'US', None, None) + >>> parse_locale('de_DE.iso885915@euro') + ('de', 'DE', None, None, 'euro') + + See :rfc:`4646` for more information. + + :param identifier: the locale identifier string + :param sep: character that separates the different components of the locale + identifier + :raise `ValueError`: if the string does not appear to be a valid locale + identifier + """ + if not identifier: + raise ValueError("empty locale identifier") + identifier, _, modifier = identifier.partition('@') + if '.' in identifier: + # this is probably the charset/encoding, which we don't care about + identifier = identifier.split('.', 1)[0] + + parts = identifier.split(sep) + lang = parts.pop(0).lower() + if not lang.isalpha(): + raise ValueError(f"expected only letters, got {lang!r}") + + script = territory = variant = None + if parts and len(parts[0]) == 4 and parts[0].isalpha(): + script = parts.pop(0).title() + + if parts: + if len(parts[0]) == 2 and parts[0].isalpha(): + territory = parts.pop(0).upper() + elif len(parts[0]) == 3 and parts[0].isdigit(): + territory = parts.pop(0) + + if parts and ( + len(parts[0]) == 4 and parts[0][0].isdigit() or + len(parts[0]) >= 5 and parts[0][0].isalpha() + ): + variant = parts.pop().upper() + + if parts: + raise ValueError(f"{identifier!r} is not a valid locale identifier") + + # TODO(3.0): always return a 5-tuple + if modifier: + return lang, territory, script, variant, modifier + else: + return lang, territory, script, variant + + +def get_locale_identifier( + tup: tuple[str] + | tuple[str, str | None] + | tuple[str, str | None, str | None] + | tuple[str, str | None, str | None, str | None] + | tuple[str, str | None, str | None, str | None, str | None], + sep: str = "_", +) -> str: + """The reverse of :func:`parse_locale`. It creates a locale identifier out + of a ``(language, territory, script, variant, modifier)`` tuple. Items can be set to + ``None`` and trailing ``None``\\s can also be left out of the tuple. + + >>> get_locale_identifier(('de', 'DE', None, '1999', 'custom')) + 'de_DE_1999@custom' + >>> get_locale_identifier(('fi', None, None, None, 'custom')) + 'fi@custom' + + + .. versionadded:: 1.0 + + :param tup: the tuple as returned by :func:`parse_locale`. + :param sep: the separator for the identifier. + """ + tup = tuple(tup[:5]) # type: ignore # length should be no more than 5 + lang, territory, script, variant, modifier = tup + (None,) * (5 - len(tup)) + ret = sep.join(filter(None, (lang, script, territory, variant))) + return f'{ret}@{modifier}' if modifier else ret diff --git a/venv/Lib/site-packages/babel/dates.py b/venv/Lib/site-packages/babel/dates.py new file mode 100644 index 0000000000000000000000000000000000000000..355a9236e0f2b11f6cc3f800ca32792e93f01e95 --- /dev/null +++ b/venv/Lib/site-packages/babel/dates.py @@ -0,0 +1,1999 @@ +""" + babel.dates + ~~~~~~~~~~~ + + Locale dependent formatting and parsing of dates and times. + + The default locale for the functions in this module is determined by the + following environment variables, in that order: + + * ``LC_TIME``, + * ``LC_ALL``, and + * ``LANG`` + + :copyright: (c) 2013-2025 by the Babel Team. + :license: BSD, see LICENSE for more details. +""" + +from __future__ import annotations + +import math +import re +import warnings +from functools import lru_cache +from typing import TYPE_CHECKING, Literal, SupportsInt + +try: + import pytz +except ModuleNotFoundError: + pytz = None + import zoneinfo + +import datetime +from collections.abc import Iterable + +from babel import localtime +from babel.core import Locale, default_locale, get_global +from babel.localedata import LocaleDataDict + +if TYPE_CHECKING: + from typing_extensions import TypeAlias + _Instant: TypeAlias = datetime.date | datetime.time | float | None + _PredefinedTimeFormat: TypeAlias = Literal['full', 'long', 'medium', 'short'] + _Context: TypeAlias = Literal['format', 'stand-alone'] + _DtOrTzinfo: TypeAlias = datetime.datetime | datetime.tzinfo | str | int | datetime.time | None + +# "If a given short metazone form is known NOT to be understood in a given +# locale and the parent locale has this value such that it would normally +# be inherited, the inheritance of this value can be explicitly disabled by +# use of the 'no inheritance marker' as the value, which is 3 simultaneous [sic] +# empty set characters ( U+2205 )." +# - https://www.unicode.org/reports/tr35/tr35-dates.html#Metazone_Names + +NO_INHERITANCE_MARKER = '\u2205\u2205\u2205' + +UTC = datetime.timezone.utc +LOCALTZ = localtime.LOCALTZ + +LC_TIME = default_locale('LC_TIME') + + +def _localize(tz: datetime.tzinfo, dt: datetime.datetime) -> datetime.datetime: + # Support localizing with both pytz and zoneinfo tzinfos + # nothing to do + if dt.tzinfo is tz: + return dt + + if hasattr(tz, 'localize'): # pytz + return tz.localize(dt) + + if dt.tzinfo is None: + # convert naive to localized + return dt.replace(tzinfo=tz) + + # convert timezones + return dt.astimezone(tz) + + +def _get_dt_and_tzinfo(dt_or_tzinfo: _DtOrTzinfo) -> tuple[datetime.datetime | None, datetime.tzinfo]: + """ + Parse a `dt_or_tzinfo` value into a datetime and a tzinfo. + + See the docs for this function's callers for semantics. + + :rtype: tuple[datetime, tzinfo] + """ + if dt_or_tzinfo is None: + dt = datetime.datetime.now() + tzinfo = LOCALTZ + elif isinstance(dt_or_tzinfo, str): + dt = None + tzinfo = get_timezone(dt_or_tzinfo) + elif isinstance(dt_or_tzinfo, int): + dt = None + tzinfo = UTC + elif isinstance(dt_or_tzinfo, (datetime.datetime, datetime.time)): + dt = _get_datetime(dt_or_tzinfo) + tzinfo = dt.tzinfo if dt.tzinfo is not None else UTC + else: + dt = None + tzinfo = dt_or_tzinfo + return dt, tzinfo + + +def _get_tz_name(dt_or_tzinfo: _DtOrTzinfo) -> str: + """ + Get the timezone name out of a time, datetime, or tzinfo object. + + :rtype: str + """ + dt, tzinfo = _get_dt_and_tzinfo(dt_or_tzinfo) + if hasattr(tzinfo, 'zone'): # pytz object + return tzinfo.zone + elif hasattr(tzinfo, 'key') and tzinfo.key is not None: # ZoneInfo object + return tzinfo.key + else: + return tzinfo.tzname(dt or datetime.datetime.now(UTC)) + + +def _get_datetime(instant: _Instant) -> datetime.datetime: + """ + Get a datetime out of an "instant" (date, time, datetime, number). + + .. warning:: The return values of this function may depend on the system clock. + + If the instant is None, the current moment is used. + If the instant is a time, it's augmented with today's date. + + Dates are converted to naive datetimes with midnight as the time component. + + >>> from datetime import date, datetime + >>> _get_datetime(date(2015, 1, 1)) + datetime.datetime(2015, 1, 1, 0, 0) + + UNIX timestamps are converted to datetimes. + + >>> _get_datetime(1400000000) + datetime.datetime(2014, 5, 13, 16, 53, 20) + + Other values are passed through as-is. + + >>> x = datetime(2015, 1, 1) + >>> _get_datetime(x) is x + True + + :param instant: date, time, datetime, integer, float or None + :type instant: date|time|datetime|int|float|None + :return: a datetime + :rtype: datetime + """ + if instant is None: + return datetime.datetime.now(UTC).replace(tzinfo=None) + elif isinstance(instant, (int, float)): + return datetime.datetime.fromtimestamp(instant, UTC).replace(tzinfo=None) + elif isinstance(instant, datetime.time): + return datetime.datetime.combine(datetime.date.today(), instant) + elif isinstance(instant, datetime.date) and not isinstance(instant, datetime.datetime): + return datetime.datetime.combine(instant, datetime.time()) + # TODO (3.x): Add an assertion/type check for this fallthrough branch: + return instant + + +def _ensure_datetime_tzinfo(dt: datetime.datetime, tzinfo: datetime.tzinfo | None = None) -> datetime.datetime: + """ + Ensure the datetime passed has an attached tzinfo. + + If the datetime is tz-naive to begin with, UTC is attached. + + If a tzinfo is passed in, the datetime is normalized to that timezone. + + >>> from datetime import datetime + >>> _get_tz_name(_ensure_datetime_tzinfo(datetime(2015, 1, 1))) + 'UTC' + + >>> tz = get_timezone("Europe/Stockholm") + >>> _ensure_datetime_tzinfo(datetime(2015, 1, 1, 13, 15, tzinfo=UTC), tzinfo=tz).hour + 14 + + :param datetime: Datetime to augment. + :param tzinfo: optional tzinfo + :return: datetime with tzinfo + :rtype: datetime + """ + if dt.tzinfo is None: + dt = dt.replace(tzinfo=UTC) + if tzinfo is not None: + dt = dt.astimezone(get_timezone(tzinfo)) + if hasattr(tzinfo, 'normalize'): # pytz + dt = tzinfo.normalize(dt) + return dt + + +def _get_time( + time: datetime.time | datetime.datetime | None, + tzinfo: datetime.tzinfo | None = None, +) -> datetime.time: + """ + Get a timezoned time from a given instant. + + .. warning:: The return values of this function may depend on the system clock. + + :param time: time, datetime or None + :rtype: time + """ + if time is None: + time = datetime.datetime.now(UTC) + elif isinstance(time, (int, float)): + time = datetime.datetime.fromtimestamp(time, UTC) + + if time.tzinfo is None: + time = time.replace(tzinfo=UTC) + + if isinstance(time, datetime.datetime): + if tzinfo is not None: + time = time.astimezone(tzinfo) + if hasattr(tzinfo, 'normalize'): # pytz + time = tzinfo.normalize(time) + time = time.timetz() + elif tzinfo is not None: + time = time.replace(tzinfo=tzinfo) + return time + + +def get_timezone(zone: str | datetime.tzinfo | None = None) -> datetime.tzinfo: + """Looks up a timezone by name and returns it. The timezone object + returned comes from ``pytz`` or ``zoneinfo``, whichever is available. + It corresponds to the `tzinfo` interface and can be used with all of + the functions of Babel that operate with dates. + + If a timezone is not known a :exc:`LookupError` is raised. If `zone` + is ``None`` a local zone object is returned. + + :param zone: the name of the timezone to look up. If a timezone object + itself is passed in, it's returned unchanged. + """ + if zone is None: + return LOCALTZ + if not isinstance(zone, str): + return zone + + if pytz: + try: + return pytz.timezone(zone) + except pytz.UnknownTimeZoneError as e: + exc = e + else: + assert zoneinfo + try: + return zoneinfo.ZoneInfo(zone) + except zoneinfo.ZoneInfoNotFoundError as e: + exc = e + + raise LookupError(f"Unknown timezone {zone}") from exc + + +def get_period_names( + width: Literal['abbreviated', 'narrow', 'wide'] = 'wide', + context: _Context = 'stand-alone', + locale: Locale | str | None = None, +) -> LocaleDataDict: + """Return the names for day periods (AM/PM) used by the locale. + + >>> get_period_names(locale='en_US')['am'] + u'AM' + + :param width: the width to use, one of "abbreviated", "narrow", or "wide" + :param context: the context, either "format" or "stand-alone" + :param locale: the `Locale` object, or a locale string. Defaults to the system time locale. + """ + return Locale.parse(locale or LC_TIME).day_periods[context][width] + + +def get_day_names( + width: Literal['abbreviated', 'narrow', 'short', 'wide'] = 'wide', + context: _Context = 'format', + locale: Locale | str | None = None, +) -> LocaleDataDict: + """Return the day names used by the locale for the specified format. + + >>> get_day_names('wide', locale='en_US')[1] + u'Tuesday' + >>> get_day_names('short', locale='en_US')[1] + u'Tu' + >>> get_day_names('abbreviated', locale='es')[1] + u'mar' + >>> get_day_names('narrow', context='stand-alone', locale='de_DE')[1] + u'D' + + :param width: the width to use, one of "wide", "abbreviated", "short" or "narrow" + :param context: the context, either "format" or "stand-alone" + :param locale: the `Locale` object, or a locale string. Defaults to the system time locale. + """ + return Locale.parse(locale or LC_TIME).days[context][width] + + +def get_month_names( + width: Literal['abbreviated', 'narrow', 'wide'] = 'wide', + context: _Context = 'format', + locale: Locale | str | None = None, +) -> LocaleDataDict: + """Return the month names used by the locale for the specified format. + + >>> get_month_names('wide', locale='en_US')[1] + u'January' + >>> get_month_names('abbreviated', locale='es')[1] + u'ene' + >>> get_month_names('narrow', context='stand-alone', locale='de_DE')[1] + u'J' + + :param width: the width to use, one of "wide", "abbreviated", or "narrow" + :param context: the context, either "format" or "stand-alone" + :param locale: the `Locale` object, or a locale string. Defaults to the system time locale. + """ + return Locale.parse(locale or LC_TIME).months[context][width] + + +def get_quarter_names( + width: Literal['abbreviated', 'narrow', 'wide'] = 'wide', + context: _Context = 'format', + locale: Locale | str | None = None, +) -> LocaleDataDict: + """Return the quarter names used by the locale for the specified format. + + >>> get_quarter_names('wide', locale='en_US')[1] + u'1st quarter' + >>> get_quarter_names('abbreviated', locale='de_DE')[1] + u'Q1' + >>> get_quarter_names('narrow', locale='de_DE')[1] + u'1' + + :param width: the width to use, one of "wide", "abbreviated", or "narrow" + :param context: the context, either "format" or "stand-alone" + :param locale: the `Locale` object, or a locale string. Defaults to the system time locale. + """ + return Locale.parse(locale or LC_TIME).quarters[context][width] + + +def get_era_names( + width: Literal['abbreviated', 'narrow', 'wide'] = 'wide', + locale: Locale | str | None = None, +) -> LocaleDataDict: + """Return the era names used by the locale for the specified format. + + >>> get_era_names('wide', locale='en_US')[1] + u'Anno Domini' + >>> get_era_names('abbreviated', locale='de_DE')[1] + u'n. Chr.' + + :param width: the width to use, either "wide", "abbreviated", or "narrow" + :param locale: the `Locale` object, or a locale string. Defaults to the system time locale. + """ + return Locale.parse(locale or LC_TIME).eras[width] + + +def get_date_format( + format: _PredefinedTimeFormat = 'medium', + locale: Locale | str | None = None, +) -> DateTimePattern: + """Return the date formatting patterns used by the locale for the specified + format. + + >>> get_date_format(locale='en_US') + + >>> get_date_format('full', locale='de_DE') + + + :param format: the format to use, one of "full", "long", "medium", or + "short" + :param locale: the `Locale` object, or a locale string. Defaults to the system time locale. + """ + return Locale.parse(locale or LC_TIME).date_formats[format] + + +def get_datetime_format( + format: _PredefinedTimeFormat = 'medium', + locale: Locale | str | None = None, +) -> DateTimePattern: + """Return the datetime formatting patterns used by the locale for the + specified format. + + >>> get_datetime_format(locale='en_US') + u'{1}, {0}' + + :param format: the format to use, one of "full", "long", "medium", or + "short" + :param locale: the `Locale` object, or a locale string. Defaults to the system time locale. + """ + patterns = Locale.parse(locale or LC_TIME).datetime_formats + if format not in patterns: + format = None + return patterns[format] + + +def get_time_format( + format: _PredefinedTimeFormat = 'medium', + locale: Locale | str | None = None, +) -> DateTimePattern: + """Return the time formatting patterns used by the locale for the specified + format. + + >>> get_time_format(locale='en_US') + + >>> get_time_format('full', locale='de_DE') + + + :param format: the format to use, one of "full", "long", "medium", or + "short" + :param locale: the `Locale` object, or a locale string. Defaults to the system time locale. + """ + return Locale.parse(locale or LC_TIME).time_formats[format] + + +def get_timezone_gmt( + datetime: _Instant = None, + width: Literal['long', 'short', 'iso8601', 'iso8601_short'] = 'long', + locale: Locale | str | None = None, + return_z: bool = False, +) -> str: + """Return the timezone associated with the given `datetime` object formatted + as string indicating the offset from GMT. + + >>> from datetime import datetime + >>> dt = datetime(2007, 4, 1, 15, 30) + >>> get_timezone_gmt(dt, locale='en') + u'GMT+00:00' + >>> get_timezone_gmt(dt, locale='en', return_z=True) + 'Z' + >>> get_timezone_gmt(dt, locale='en', width='iso8601_short') + u'+00' + >>> tz = get_timezone('America/Los_Angeles') + >>> dt = _localize(tz, datetime(2007, 4, 1, 15, 30)) + >>> get_timezone_gmt(dt, locale='en') + u'GMT-07:00' + >>> get_timezone_gmt(dt, 'short', locale='en') + u'-0700' + >>> get_timezone_gmt(dt, locale='en', width='iso8601_short') + u'-07' + + The long format depends on the locale, for example in France the acronym + UTC string is used instead of GMT: + + >>> get_timezone_gmt(dt, 'long', locale='fr_FR') + u'UTC-07:00' + + .. versionadded:: 0.9 + + :param datetime: the ``datetime`` object; if `None`, the current date and + time in UTC is used + :param width: either "long" or "short" or "iso8601" or "iso8601_short" + :param locale: the `Locale` object, or a locale string. Defaults to the system time locale. + :param return_z: True or False; Function returns indicator "Z" + when local time offset is 0 + """ + datetime = _ensure_datetime_tzinfo(_get_datetime(datetime)) + locale = Locale.parse(locale or LC_TIME) + + offset = datetime.tzinfo.utcoffset(datetime) + seconds = offset.days * 24 * 60 * 60 + offset.seconds + hours, seconds = divmod(seconds, 3600) + if return_z and hours == 0 and seconds == 0: + return 'Z' + elif seconds == 0 and width == 'iso8601_short': + return '%+03d' % hours + elif width == 'short' or width == 'iso8601_short': + pattern = '%+03d%02d' + elif width == 'iso8601': + pattern = '%+03d:%02d' + else: + pattern = locale.zone_formats['gmt'] % '%+03d:%02d' + return pattern % (hours, seconds // 60) + + +def get_timezone_location( + dt_or_tzinfo: _DtOrTzinfo = None, + locale: Locale | str | None = None, + return_city: bool = False, +) -> str: + """Return a representation of the given timezone using "location format". + + The result depends on both the local display name of the country and the + city associated with the time zone: + + >>> tz = get_timezone('America/St_Johns') + >>> print(get_timezone_location(tz, locale='de_DE')) + Kanada (St. John’s) (Ortszeit) + >>> print(get_timezone_location(tz, locale='en')) + Canada (St. John’s) Time + >>> print(get_timezone_location(tz, locale='en', return_city=True)) + St. John’s + >>> tz = get_timezone('America/Mexico_City') + >>> get_timezone_location(tz, locale='de_DE') + u'Mexiko (Mexiko-Stadt) (Ortszeit)' + + If the timezone is associated with a country that uses only a single + timezone, just the localized country name is returned: + + >>> tz = get_timezone('Europe/Berlin') + >>> get_timezone_name(tz, locale='de_DE') + u'Mitteleurop\\xe4ische Zeit' + + .. versionadded:: 0.9 + + :param dt_or_tzinfo: the ``datetime`` or ``tzinfo`` object that determines + the timezone; if `None`, the current date and time in + UTC is assumed + :param locale: the `Locale` object, or a locale string. Defaults to the system time locale. + :param return_city: True or False, if True then return exemplar city (location) + for the time zone + :return: the localized timezone name using location format + + """ + locale = Locale.parse(locale or LC_TIME) + + zone = _get_tz_name(dt_or_tzinfo) + + # Get the canonical time-zone code + zone = get_global('zone_aliases').get(zone, zone) + + info = locale.time_zones.get(zone, {}) + + # Otherwise, if there is only one timezone for the country, return the + # localized country name + region_format = locale.zone_formats['region'] + territory = get_global('zone_territories').get(zone) + if territory not in locale.territories: + territory = 'ZZ' # invalid/unknown + territory_name = locale.territories[territory] + if not return_city and territory and len(get_global('territory_zones').get(territory, [])) == 1: + return region_format % territory_name + + # Otherwise, include the city in the output + fallback_format = locale.zone_formats['fallback'] + if 'city' in info: + city_name = info['city'] + else: + metazone = get_global('meta_zones').get(zone) + metazone_info = locale.meta_zones.get(metazone, {}) + if 'city' in metazone_info: + city_name = metazone_info['city'] + elif '/' in zone: + city_name = zone.split('/', 1)[1].replace('_', ' ') + else: + city_name = zone.replace('_', ' ') + + if return_city: + return city_name + return region_format % (fallback_format % { + '0': city_name, + '1': territory_name, + }) + + +def get_timezone_name( + dt_or_tzinfo: _DtOrTzinfo = None, + width: Literal['long', 'short'] = 'long', + uncommon: bool = False, + locale: Locale | str | None = None, + zone_variant: Literal['generic', 'daylight', 'standard'] | None = None, + return_zone: bool = False, +) -> str: + r"""Return the localized display name for the given timezone. The timezone + may be specified using a ``datetime`` or `tzinfo` object. + + >>> from datetime import time + >>> dt = time(15, 30, tzinfo=get_timezone('America/Los_Angeles')) + >>> get_timezone_name(dt, locale='en_US') # doctest: +SKIP + u'Pacific Standard Time' + >>> get_timezone_name(dt, locale='en_US', return_zone=True) + 'America/Los_Angeles' + >>> get_timezone_name(dt, width='short', locale='en_US') # doctest: +SKIP + u'PST' + + If this function gets passed only a `tzinfo` object and no concrete + `datetime`, the returned display name is independent of daylight savings + time. This can be used for example for selecting timezones, or to set the + time of events that recur across DST changes: + + >>> tz = get_timezone('America/Los_Angeles') + >>> get_timezone_name(tz, locale='en_US') + u'Pacific Time' + >>> get_timezone_name(tz, 'short', locale='en_US') + u'PT' + + If no localized display name for the timezone is available, and the timezone + is associated with a country that uses only a single timezone, the name of + that country is returned, formatted according to the locale: + + >>> tz = get_timezone('Europe/Berlin') + >>> get_timezone_name(tz, locale='de_DE') + u'Mitteleurop\xe4ische Zeit' + >>> get_timezone_name(tz, locale='pt_BR') + u'Hor\xe1rio da Europa Central' + + On the other hand, if the country uses multiple timezones, the city is also + included in the representation: + + >>> tz = get_timezone('America/St_Johns') + >>> get_timezone_name(tz, locale='de_DE') + u'Neufundland-Zeit' + + Note that short format is currently not supported for all timezones and + all locales. This is partially because not every timezone has a short + code in every locale. In that case it currently falls back to the long + format. + + For more information see `LDML Appendix J: Time Zone Display Names + `_ + + .. versionadded:: 0.9 + + .. versionchanged:: 1.0 + Added `zone_variant` support. + + :param dt_or_tzinfo: the ``datetime`` or ``tzinfo`` object that determines + the timezone; if a ``tzinfo`` object is used, the + resulting display name will be generic, i.e. + independent of daylight savings time; if `None`, the + current date in UTC is assumed + :param width: either "long" or "short" + :param uncommon: deprecated and ignored + :param zone_variant: defines the zone variation to return. By default the + variation is defined from the datetime object + passed in. If no datetime object is passed in, the + ``'generic'`` variation is assumed. The following + values are valid: ``'generic'``, ``'daylight'`` and + ``'standard'``. + :param locale: the `Locale` object, or a locale string. Defaults to the system time locale. + :param return_zone: True or False. If true then function + returns long time zone ID + """ + dt, tzinfo = _get_dt_and_tzinfo(dt_or_tzinfo) + locale = Locale.parse(locale or LC_TIME) + + zone = _get_tz_name(dt_or_tzinfo) + + if zone_variant is None: + if dt is None: + zone_variant = 'generic' + else: + dst = tzinfo.dst(dt) + zone_variant = "daylight" if dst else "standard" + else: + if zone_variant not in ('generic', 'standard', 'daylight'): + raise ValueError('Invalid zone variation') + + # Get the canonical time-zone code + zone = get_global('zone_aliases').get(zone, zone) + if return_zone: + return zone + info = locale.time_zones.get(zone, {}) + # Try explicitly translated zone names first + if width in info and zone_variant in info[width]: + return info[width][zone_variant] + + metazone = get_global('meta_zones').get(zone) + if metazone: + metazone_info = locale.meta_zones.get(metazone, {}) + if width in metazone_info: + name = metazone_info[width].get(zone_variant) + if width == 'short' and name == NO_INHERITANCE_MARKER: + # If the short form is marked no-inheritance, + # try to fall back to the long name instead. + name = metazone_info.get('long', {}).get(zone_variant) + if name: + return name + + # If we have a concrete datetime, we assume that the result can't be + # independent of daylight savings time, so we return the GMT offset + if dt is not None: + return get_timezone_gmt(dt, width=width, locale=locale) + + return get_timezone_location(dt_or_tzinfo, locale=locale) + + +def format_date( + date: datetime.date | None = None, + format: _PredefinedTimeFormat | str = 'medium', + locale: Locale | str | None = None, +) -> str: + """Return a date formatted according to the given pattern. + + >>> from datetime import date + >>> d = date(2007, 4, 1) + >>> format_date(d, locale='en_US') + u'Apr 1, 2007' + >>> format_date(d, format='full', locale='de_DE') + u'Sonntag, 1. April 2007' + + If you don't want to use the locale default formats, you can specify a + custom date pattern: + + >>> format_date(d, "EEE, MMM d, ''yy", locale='en') + u"Sun, Apr 1, '07" + + :param date: the ``date`` or ``datetime`` object; if `None`, the current + date is used + :param format: one of "full", "long", "medium", or "short", or a custom + date/time pattern + :param locale: a `Locale` object or a locale identifier. Defaults to the system time locale. + """ + if date is None: + date = datetime.date.today() + elif isinstance(date, datetime.datetime): + date = date.date() + + locale = Locale.parse(locale or LC_TIME) + if format in ('full', 'long', 'medium', 'short'): + format = get_date_format(format, locale=locale) + pattern = parse_pattern(format) + return pattern.apply(date, locale) + + +def format_datetime( + datetime: _Instant = None, + format: _PredefinedTimeFormat | str = 'medium', + tzinfo: datetime.tzinfo | None = None, + locale: Locale | str | None = None, +) -> str: + r"""Return a date formatted according to the given pattern. + + >>> from datetime import datetime + >>> dt = datetime(2007, 4, 1, 15, 30) + >>> format_datetime(dt, locale='en_US') + u'Apr 1, 2007, 3:30:00\u202fPM' + + For any pattern requiring the display of the timezone: + + >>> format_datetime(dt, 'full', tzinfo=get_timezone('Europe/Paris'), + ... locale='fr_FR') + 'dimanche 1 avril 2007, 17:30:00 heure d’été d’Europe centrale' + >>> format_datetime(dt, "yyyy.MM.dd G 'at' HH:mm:ss zzz", + ... tzinfo=get_timezone('US/Eastern'), locale='en') + u'2007.04.01 AD at 11:30:00 EDT' + + :param datetime: the `datetime` object; if `None`, the current date and + time is used + :param format: one of "full", "long", "medium", or "short", or a custom + date/time pattern + :param tzinfo: the timezone to apply to the time for display + :param locale: a `Locale` object or a locale identifier. Defaults to the system time locale. + """ + datetime = _ensure_datetime_tzinfo(_get_datetime(datetime), tzinfo) + + locale = Locale.parse(locale or LC_TIME) + if format in ('full', 'long', 'medium', 'short'): + return get_datetime_format(format, locale=locale) \ + .replace("'", "") \ + .replace('{0}', format_time(datetime, format, tzinfo=None, + locale=locale)) \ + .replace('{1}', format_date(datetime, format, locale=locale)) + else: + return parse_pattern(format).apply(datetime, locale) + + +def format_time( + time: datetime.time | datetime.datetime | float | None = None, + format: _PredefinedTimeFormat | str = 'medium', + tzinfo: datetime.tzinfo | None = None, + locale: Locale | str | None = None, +) -> str: + r"""Return a time formatted according to the given pattern. + + >>> from datetime import datetime, time + >>> t = time(15, 30) + >>> format_time(t, locale='en_US') + u'3:30:00\u202fPM' + >>> format_time(t, format='short', locale='de_DE') + u'15:30' + + If you don't want to use the locale default formats, you can specify a + custom time pattern: + + >>> format_time(t, "hh 'o''clock' a", locale='en') + u"03 o'clock PM" + + For any pattern requiring the display of the time-zone a + timezone has to be specified explicitly: + + >>> t = datetime(2007, 4, 1, 15, 30) + >>> tzinfo = get_timezone('Europe/Paris') + >>> t = _localize(tzinfo, t) + >>> format_time(t, format='full', tzinfo=tzinfo, locale='fr_FR') + '15:30:00 heure d’été d’Europe centrale' + >>> format_time(t, "hh 'o''clock' a, zzzz", tzinfo=get_timezone('US/Eastern'), + ... locale='en') + u"09 o'clock AM, Eastern Daylight Time" + + As that example shows, when this function gets passed a + ``datetime.datetime`` value, the actual time in the formatted string is + adjusted to the timezone specified by the `tzinfo` parameter. If the + ``datetime`` is "naive" (i.e. it has no associated timezone information), + it is assumed to be in UTC. + + These timezone calculations are **not** performed if the value is of type + ``datetime.time``, as without date information there's no way to determine + what a given time would translate to in a different timezone without + information about whether daylight savings time is in effect or not. This + means that time values are left as-is, and the value of the `tzinfo` + parameter is only used to display the timezone name if needed: + + >>> t = time(15, 30) + >>> format_time(t, format='full', tzinfo=get_timezone('Europe/Paris'), + ... locale='fr_FR') # doctest: +SKIP + u'15:30:00 heure normale d\u2019Europe centrale' + >>> format_time(t, format='full', tzinfo=get_timezone('US/Eastern'), + ... locale='en_US') # doctest: +SKIP + u'3:30:00\u202fPM Eastern Standard Time' + + :param time: the ``time`` or ``datetime`` object; if `None`, the current + time in UTC is used + :param format: one of "full", "long", "medium", or "short", or a custom + date/time pattern + :param tzinfo: the time-zone to apply to the time for display + :param locale: a `Locale` object or a locale identifier. Defaults to the system time locale. + """ + + # get reference date for if we need to find the right timezone variant + # in the pattern + ref_date = time.date() if isinstance(time, datetime.datetime) else None + + time = _get_time(time, tzinfo) + + locale = Locale.parse(locale or LC_TIME) + if format in ('full', 'long', 'medium', 'short'): + format = get_time_format(format, locale=locale) + return parse_pattern(format).apply(time, locale, reference_date=ref_date) + + +def format_skeleton( + skeleton: str, + datetime: _Instant = None, + tzinfo: datetime.tzinfo | None = None, + fuzzy: bool = True, + locale: Locale | str | None = None, +) -> str: + r"""Return a time and/or date formatted according to the given pattern. + + The skeletons are defined in the CLDR data and provide more flexibility + than the simple short/long/medium formats, but are a bit harder to use. + The are defined using the date/time symbols without order or punctuation + and map to a suitable format for the given locale. + + >>> from datetime import datetime + >>> t = datetime(2007, 4, 1, 15, 30) + >>> format_skeleton('MMMEd', t, locale='fr') + u'dim. 1 avr.' + >>> format_skeleton('MMMEd', t, locale='en') + u'Sun, Apr 1' + >>> format_skeleton('yMMd', t, locale='fi') # yMMd is not in the Finnish locale; yMd gets used + u'1.4.2007' + >>> format_skeleton('yMMd', t, fuzzy=False, locale='fi') # yMMd is not in the Finnish locale, an error is thrown + Traceback (most recent call last): + ... + KeyError: yMMd + >>> format_skeleton('GH', t, fuzzy=True, locale='fi_FI') # GH is not in the Finnish locale and there is no close match, an error is thrown + Traceback (most recent call last): + ... + KeyError: None + + After the skeleton is resolved to a pattern `format_datetime` is called so + all timezone processing etc is the same as for that. + + :param skeleton: A date time skeleton as defined in the cldr data. + :param datetime: the ``time`` or ``datetime`` object; if `None`, the current + time in UTC is used + :param tzinfo: the time-zone to apply to the time for display + :param fuzzy: If the skeleton is not found, allow choosing a skeleton that's + close enough to it. If there is no close match, a `KeyError` + is thrown. + :param locale: a `Locale` object or a locale identifier. Defaults to the system time locale. + """ + locale = Locale.parse(locale or LC_TIME) + if fuzzy and skeleton not in locale.datetime_skeletons: + skeleton = match_skeleton(skeleton, locale.datetime_skeletons) + format = locale.datetime_skeletons[skeleton] + return format_datetime(datetime, format, tzinfo, locale) + + +TIMEDELTA_UNITS: tuple[tuple[str, int], ...] = ( + ('year', 3600 * 24 * 365), + ('month', 3600 * 24 * 30), + ('week', 3600 * 24 * 7), + ('day', 3600 * 24), + ('hour', 3600), + ('minute', 60), + ('second', 1), +) + + +def format_timedelta( + delta: datetime.timedelta | int, + granularity: Literal['year', 'month', 'week', 'day', 'hour', 'minute', 'second'] = 'second', + threshold: float = .85, + add_direction: bool = False, + format: Literal['narrow', 'short', 'medium', 'long'] = 'long', + locale: Locale | str | None = None, +) -> str: + """Return a time delta according to the rules of the given locale. + + >>> from datetime import timedelta + >>> format_timedelta(timedelta(weeks=12), locale='en_US') + u'3 months' + >>> format_timedelta(timedelta(seconds=1), locale='es') + u'1 segundo' + + The granularity parameter can be provided to alter the lowest unit + presented, which defaults to a second. + + >>> format_timedelta(timedelta(hours=3), granularity='day', locale='en_US') + u'1 day' + + The threshold parameter can be used to determine at which value the + presentation switches to the next higher unit. A higher threshold factor + means the presentation will switch later. For example: + + >>> format_timedelta(timedelta(hours=23), threshold=0.9, locale='en_US') + u'1 day' + >>> format_timedelta(timedelta(hours=23), threshold=1.1, locale='en_US') + u'23 hours' + + In addition directional information can be provided that informs + the user if the date is in the past or in the future: + + >>> format_timedelta(timedelta(hours=1), add_direction=True, locale='en') + u'in 1 hour' + >>> format_timedelta(timedelta(hours=-1), add_direction=True, locale='en') + u'1 hour ago' + + The format parameter controls how compact or wide the presentation is: + + >>> format_timedelta(timedelta(hours=3), format='short', locale='en') + u'3 hr' + >>> format_timedelta(timedelta(hours=3), format='narrow', locale='en') + u'3h' + + :param delta: a ``timedelta`` object representing the time difference to + format, or the delta in seconds as an `int` value + :param granularity: determines the smallest unit that should be displayed, + the value can be one of "year", "month", "week", "day", + "hour", "minute" or "second" + :param threshold: factor that determines at which point the presentation + switches to the next higher unit + :param add_direction: if this flag is set to `True` the return value will + include directional information. For instance a + positive timedelta will include the information about + it being in the future, a negative will be information + about the value being in the past. + :param format: the format, can be "narrow", "short" or "long". ( + "medium" is deprecated, currently converted to "long" to + maintain compatibility) + :param locale: a `Locale` object or a locale identifier. Defaults to the system time locale. + """ + if format not in ('narrow', 'short', 'medium', 'long'): + raise TypeError('Format must be one of "narrow", "short" or "long"') + if format == 'medium': + warnings.warn( + '"medium" value for format param of format_timedelta' + ' is deprecated. Use "long" instead', + category=DeprecationWarning, + stacklevel=2, + ) + format = 'long' + if isinstance(delta, datetime.timedelta): + seconds = int((delta.days * 86400) + delta.seconds) + else: + seconds = delta + locale = Locale.parse(locale or LC_TIME) + date_fields = locale._data["date_fields"] + unit_patterns = locale._data["unit_patterns"] + + def _iter_patterns(a_unit): + if add_direction: + # Try to find the length variant version first ("year-narrow") + # before falling back to the default. + unit_rel_patterns = (date_fields.get(f"{a_unit}-{format}") or date_fields[a_unit]) + if seconds >= 0: + yield unit_rel_patterns['future'] + else: + yield unit_rel_patterns['past'] + a_unit = f"duration-{a_unit}" + unit_pats = unit_patterns.get(a_unit, {}) + yield unit_pats.get(format) + # We do not support `` tags at all while ingesting CLDR data, + # so these aliases specified in `root.xml` are hard-coded here: + # + # + if format in ("long", "narrow"): + yield unit_pats.get("short") + + for unit, secs_per_unit in TIMEDELTA_UNITS: + value = abs(seconds) / secs_per_unit + if value >= threshold or unit == granularity: + if unit == granularity and value > 0: + value = max(1, value) + value = int(round(value)) + plural_form = locale.plural_form(value) + pattern = None + for patterns in _iter_patterns(unit): + if patterns is not None: + pattern = patterns.get(plural_form) or patterns.get('other') + if pattern: + break + # This really should not happen + if pattern is None: + return '' + return pattern.replace('{0}', str(value)) + + return '' + + +def _format_fallback_interval( + start: _Instant, + end: _Instant, + skeleton: str | None, + tzinfo: datetime.tzinfo | None, + locale: Locale, +) -> str: + if skeleton in locale.datetime_skeletons: # Use the given skeleton + format = lambda dt: format_skeleton(skeleton, dt, tzinfo, locale=locale) + elif all((isinstance(d, datetime.date) and not isinstance(d, datetime.datetime)) for d in (start, end)): # Both are just dates + format = lambda dt: format_date(dt, locale=locale) + elif all((isinstance(d, datetime.time) and not isinstance(d, datetime.date)) for d in (start, end)): # Both are times + format = lambda dt: format_time(dt, tzinfo=tzinfo, locale=locale) + else: + format = lambda dt: format_datetime(dt, tzinfo=tzinfo, locale=locale) + + formatted_start = format(start) + formatted_end = format(end) + + if formatted_start == formatted_end: + return format(start) + + return ( + locale.interval_formats.get(None, "{0}-{1}"). + replace("{0}", formatted_start). + replace("{1}", formatted_end) + ) + + +def format_interval( + start: _Instant, + end: _Instant, + skeleton: str | None = None, + tzinfo: datetime.tzinfo | None = None, + fuzzy: bool = True, + locale: Locale | str | None = None, +) -> str: + """ + Format an interval between two instants according to the locale's rules. + + >>> from datetime import date, time + >>> format_interval(date(2016, 1, 15), date(2016, 1, 17), "yMd", locale="fi") + u'15.\u201317.1.2016' + + >>> format_interval(time(12, 12), time(16, 16), "Hm", locale="en_GB") + '12:12\u201316:16' + + >>> format_interval(time(5, 12), time(16, 16), "hm", locale="en_US") + '5:12\u202fAM\u2009–\u20094:16\u202fPM' + + >>> format_interval(time(16, 18), time(16, 24), "Hm", locale="it") + '16:18\u201316:24' + + If the start instant equals the end instant, the interval is formatted like the instant. + + >>> format_interval(time(16, 18), time(16, 18), "Hm", locale="it") + '16:18' + + Unknown skeletons fall back to "default" formatting. + + >>> format_interval(date(2015, 1, 1), date(2017, 1, 1), "wzq", locale="ja") + '2015/01/01\uff5e2017/01/01' + + >>> format_interval(time(16, 18), time(16, 24), "xxx", locale="ja") + '16:18:00\uff5e16:24:00' + + >>> format_interval(date(2016, 1, 15), date(2016, 1, 17), "xxx", locale="de") + '15.01.2016\u2009–\u200917.01.2016' + + :param start: First instant (datetime/date/time) + :param end: Second instant (datetime/date/time) + :param skeleton: The "skeleton format" to use for formatting. + :param tzinfo: tzinfo to use (if none is already attached) + :param fuzzy: If the skeleton is not found, allow choosing a skeleton that's + close enough to it. + :param locale: A locale object or identifier. Defaults to the system time locale. + :return: Formatted interval + """ + locale = Locale.parse(locale or LC_TIME) + + # NB: The quote comments below are from the algorithm description in + # https://www.unicode.org/reports/tr35/tr35-dates.html#intervalFormats + + # > Look for the intervalFormatItem element that matches the "skeleton", + # > starting in the current locale and then following the locale fallback + # > chain up to, but not including root. + + interval_formats = locale.interval_formats + + if skeleton not in interval_formats or not skeleton: + # > If no match was found from the previous step, check what the closest + # > match is in the fallback locale chain, as in availableFormats. That + # > is, this allows for adjusting the string value field's width, + # > including adjusting between "MMM" and "MMMM", and using different + # > variants of the same field, such as 'v' and 'z'. + if skeleton and fuzzy: + skeleton = match_skeleton(skeleton, interval_formats) + else: + skeleton = None + if not skeleton: # Still no match whatsoever? + # > Otherwise, format the start and end datetime using the fallback pattern. + return _format_fallback_interval(start, end, skeleton, tzinfo, locale) + + skel_formats = interval_formats[skeleton] + + if start == end: + return format_skeleton(skeleton, start, tzinfo, fuzzy=fuzzy, locale=locale) + + start = _ensure_datetime_tzinfo(_get_datetime(start), tzinfo=tzinfo) + end = _ensure_datetime_tzinfo(_get_datetime(end), tzinfo=tzinfo) + + start_fmt = DateTimeFormat(start, locale=locale) + end_fmt = DateTimeFormat(end, locale=locale) + + # > If a match is found from previous steps, compute the calendar field + # > with the greatest difference between start and end datetime. If there + # > is no difference among any of the fields in the pattern, format as a + # > single date using availableFormats, and return. + + for field in PATTERN_CHAR_ORDER: # These are in largest-to-smallest order + if field in skel_formats and start_fmt.extract(field) != end_fmt.extract(field): + # > If there is a match, use the pieces of the corresponding pattern to + # > format the start and end datetime, as above. + return "".join( + parse_pattern(pattern).apply(instant, locale) + for pattern, instant + in zip(skel_formats[field], (start, end)) + ) + + # > Otherwise, format the start and end datetime using the fallback pattern. + + return _format_fallback_interval(start, end, skeleton, tzinfo, locale) + + +def get_period_id( + time: _Instant, + tzinfo: datetime.tzinfo | None = None, + type: Literal['selection'] | None = None, + locale: Locale | str | None = None, +) -> str: + """ + Get the day period ID for a given time. + + This ID can be used as a key for the period name dictionary. + + >>> from datetime import time + >>> get_period_names(locale="de")[get_period_id(time(7, 42), locale="de")] + u'Morgen' + + >>> get_period_id(time(0), locale="en_US") + u'midnight' + + >>> get_period_id(time(0), type="selection", locale="en_US") + u'night1' + + :param time: The time to inspect. + :param tzinfo: The timezone for the time. See ``format_time``. + :param type: The period type to use. Either "selection" or None. + The selection type is used for selecting among phrases such as + “Your email arrived yesterday evening” or “Your email arrived last night”. + :param locale: the `Locale` object, or a locale string. Defaults to the system time locale. + :return: period ID. Something is always returned -- even if it's just "am" or "pm". + """ + time = _get_time(time, tzinfo) + seconds_past_midnight = int(time.hour * 60 * 60 + time.minute * 60 + time.second) + locale = Locale.parse(locale or LC_TIME) + + # The LDML rules state that the rules may not overlap, so iterating in arbitrary + # order should be alright, though `at` periods should be preferred. + rulesets = locale.day_period_rules.get(type, {}).items() + + for rule_id, rules in rulesets: + for rule in rules: + if "at" in rule and rule["at"] == seconds_past_midnight: + return rule_id + + for rule_id, rules in rulesets: + for rule in rules: + if "from" in rule and "before" in rule: + if rule["from"] < rule["before"]: + if rule["from"] <= seconds_past_midnight < rule["before"]: + return rule_id + else: + # e.g. from="21:00" before="06:00" + if rule["from"] <= seconds_past_midnight < 86400 or \ + 0 <= seconds_past_midnight < rule["before"]: + return rule_id + + start_ok = end_ok = False + + if "from" in rule and seconds_past_midnight >= rule["from"]: + start_ok = True + if "to" in rule and seconds_past_midnight <= rule["to"]: + # This rule type does not exist in the present CLDR data; + # excuse the lack of test coverage. + end_ok = True + if "before" in rule and seconds_past_midnight < rule["before"]: + end_ok = True + if "after" in rule: + raise NotImplementedError("'after' is deprecated as of CLDR 29.") + + if start_ok and end_ok: + return rule_id + + if seconds_past_midnight < 43200: + return "am" + else: + return "pm" + + +class ParseError(ValueError): + pass + + +def parse_date( + string: str, + locale: Locale | str | None = None, + format: _PredefinedTimeFormat | str = 'medium', +) -> datetime.date: + """Parse a date from a string. + + If an explicit format is provided, it is used to parse the date. + + >>> parse_date('01.04.2004', format='dd.MM.yyyy') + datetime.date(2004, 4, 1) + + If no format is given, or if it is one of "full", "long", "medium", + or "short", the function first tries to interpret the string as + ISO-8601 date format and then uses the date format for the locale + as a hint to determine the order in which the date fields appear in + the string. + + >>> parse_date('4/1/04', locale='en_US') + datetime.date(2004, 4, 1) + >>> parse_date('01.04.2004', locale='de_DE') + datetime.date(2004, 4, 1) + >>> parse_date('2004-04-01', locale='en_US') + datetime.date(2004, 4, 1) + >>> parse_date('2004-04-01', locale='de_DE') + datetime.date(2004, 4, 1) + >>> parse_date('01.04.04', locale='de_DE', format='short') + datetime.date(2004, 4, 1) + + :param string: the string containing the date + :param locale: a `Locale` object or a locale identifier + :param locale: a `Locale` object or a locale identifier. Defaults to the system time locale. + :param format: the format to use, either an explicit date format, + or one of "full", "long", "medium", or "short" + (see ``get_time_format``) + """ + numbers = re.findall(r'(\d+)', string) + if not numbers: + raise ParseError("No numbers were found in input") + + use_predefined_format = format in ('full', 'long', 'medium', 'short') + # we try ISO-8601 format first, meaning similar to formats + # extended YYYY-MM-DD or basic YYYYMMDD + iso_alike = re.match(r'^(\d{4})-?([01]\d)-?([0-3]\d)$', + string, flags=re.ASCII) # allow only ASCII digits + if iso_alike and use_predefined_format: + try: + return datetime.date(*map(int, iso_alike.groups())) + except ValueError: + pass # a locale format might fit better, so let's continue + + if use_predefined_format: + fmt = get_date_format(format=format, locale=locale) + else: + fmt = parse_pattern(format) + format_str = fmt.pattern.lower() + year_idx = format_str.index('y') + month_idx = format_str.find('m') + if month_idx < 0: + month_idx = format_str.index('l') + day_idx = format_str.index('d') + + indexes = sorted([(year_idx, 'Y'), (month_idx, 'M'), (day_idx, 'D')]) + indexes = {item[1]: idx for idx, item in enumerate(indexes)} + + # FIXME: this currently only supports numbers, but should also support month + # names, both in the requested locale, and english + + year = numbers[indexes['Y']] + year = 2000 + int(year) if len(year) == 2 else int(year) + month = int(numbers[indexes['M']]) + day = int(numbers[indexes['D']]) + if month > 12: + month, day = day, month + return datetime.date(year, month, day) + + +def parse_time( + string: str, + locale: Locale | str | None = None, + format: _PredefinedTimeFormat | str = 'medium', +) -> datetime.time: + """Parse a time from a string. + + This function uses the time format for the locale as a hint to determine + the order in which the time fields appear in the string. + + If an explicit format is provided, the function will use it to parse + the time instead. + + >>> parse_time('15:30:00', locale='en_US') + datetime.time(15, 30) + >>> parse_time('15:30:00', format='H:mm:ss') + datetime.time(15, 30) + + :param string: the string containing the time + :param locale: a `Locale` object or a locale identifier. Defaults to the system time locale. + :param format: the format to use, either an explicit time format, + or one of "full", "long", "medium", or "short" + (see ``get_time_format``) + :return: the parsed time + :rtype: `time` + """ + numbers = re.findall(r'(\d+)', string) + if not numbers: + raise ParseError("No numbers were found in input") + + # TODO: try ISO format first? + if format in ('full', 'long', 'medium', 'short'): + fmt = get_time_format(format=format, locale=locale) + else: + fmt = parse_pattern(format) + format_str = fmt.pattern.lower() + hour_idx = format_str.find('h') + if hour_idx < 0: + hour_idx = format_str.index('k') + min_idx = format_str.index('m') + # format might not contain seconds + if (sec_idx := format_str.find('s')) < 0: + sec_idx = math.inf + + indexes = sorted([(hour_idx, 'H'), (min_idx, 'M'), (sec_idx, 'S')]) + indexes = {item[1]: idx for idx, item in enumerate(indexes)} + + # TODO: support time zones + + # Check if the format specifies a period to be used; + # if it does, look for 'pm' to figure out an offset. + hour_offset = 0 + if 'a' in format_str and 'pm' in string.lower(): + hour_offset = 12 + + # Parse up to three numbers from the string. + minute = second = 0 + hour = int(numbers[indexes['H']]) + hour_offset + if len(numbers) > 1: + minute = int(numbers[indexes['M']]) + if len(numbers) > 2: + second = int(numbers[indexes['S']]) + return datetime.time(hour, minute, second) + + +class DateTimePattern: + + def __init__(self, pattern: str, format: DateTimeFormat): + self.pattern = pattern + self.format = format + + def __repr__(self) -> str: + return f"<{type(self).__name__} {self.pattern!r}>" + + def __str__(self) -> str: + pat = self.pattern + return pat + + def __mod__(self, other: DateTimeFormat) -> str: + if not isinstance(other, DateTimeFormat): + return NotImplemented + return self.format % other + + def apply( + self, + datetime: datetime.date | datetime.time, + locale: Locale | str | None, + reference_date: datetime.date | None = None, + ) -> str: + return self % DateTimeFormat(datetime, locale, reference_date) + + +class DateTimeFormat: + + def __init__( + self, + value: datetime.date | datetime.time, + locale: Locale | str, + reference_date: datetime.date | None = None, + ) -> None: + assert isinstance(value, (datetime.date, datetime.datetime, datetime.time)) + if isinstance(value, (datetime.datetime, datetime.time)) and value.tzinfo is None: + value = value.replace(tzinfo=UTC) + self.value = value + self.locale = Locale.parse(locale) + self.reference_date = reference_date + + def __getitem__(self, name: str) -> str: + char = name[0] + num = len(name) + if char == 'G': + return self.format_era(char, num) + elif char in ('y', 'Y', 'u'): + return self.format_year(char, num) + elif char in ('Q', 'q'): + return self.format_quarter(char, num) + elif char in ('M', 'L'): + return self.format_month(char, num) + elif char in ('w', 'W'): + return self.format_week(char, num) + elif char == 'd': + return self.format(self.value.day, num) + elif char == 'D': + return self.format_day_of_year(num) + elif char == 'F': + return self.format_day_of_week_in_month() + elif char in ('E', 'e', 'c'): + return self.format_weekday(char, num) + elif char in ('a', 'b', 'B'): + return self.format_period(char, num) + elif char == 'h': + if self.value.hour % 12 == 0: + return self.format(12, num) + else: + return self.format(self.value.hour % 12, num) + elif char == 'H': + return self.format(self.value.hour, num) + elif char == 'K': + return self.format(self.value.hour % 12, num) + elif char == 'k': + if self.value.hour == 0: + return self.format(24, num) + else: + return self.format(self.value.hour, num) + elif char == 'm': + return self.format(self.value.minute, num) + elif char == 's': + return self.format(self.value.second, num) + elif char == 'S': + return self.format_frac_seconds(num) + elif char == 'A': + return self.format_milliseconds_in_day(num) + elif char in ('z', 'Z', 'v', 'V', 'x', 'X', 'O'): + return self.format_timezone(char, num) + else: + raise KeyError(f"Unsupported date/time field {char!r}") + + def extract(self, char: str) -> int: + char = str(char)[0] + if char == 'y': + return self.value.year + elif char == 'M': + return self.value.month + elif char == 'd': + return self.value.day + elif char == 'H': + return self.value.hour + elif char == 'h': + return self.value.hour % 12 or 12 + elif char == 'm': + return self.value.minute + elif char == 'a': + return int(self.value.hour >= 12) # 0 for am, 1 for pm + else: + raise NotImplementedError(f"Not implemented: extracting {char!r} from {self.value!r}") + + def format_era(self, char: str, num: int) -> str: + width = {3: 'abbreviated', 4: 'wide', 5: 'narrow'}[max(3, num)] + era = int(self.value.year >= 0) + return get_era_names(width, self.locale)[era] + + def format_year(self, char: str, num: int) -> str: + value = self.value.year + if char.isupper(): + month = self.value.month + if month == 1 and self.value.day < 7 and self.get_week_of_year() >= 52: + value -= 1 + elif month == 12 and self.value.day > 25 and self.get_week_of_year() <= 2: + value += 1 + year = self.format(value, num) + if num == 2: + year = year[-2:] + return year + + def format_quarter(self, char: str, num: int) -> str: + quarter = (self.value.month - 1) // 3 + 1 + if num <= 2: + return '%0*d' % (num, quarter) + width = {3: 'abbreviated', 4: 'wide', 5: 'narrow'}[num] + context = {'Q': 'format', 'q': 'stand-alone'}[char] + return get_quarter_names(width, context, self.locale)[quarter] + + def format_month(self, char: str, num: int) -> str: + if num <= 2: + return '%0*d' % (num, self.value.month) + width = {3: 'abbreviated', 4: 'wide', 5: 'narrow'}[num] + context = {'M': 'format', 'L': 'stand-alone'}[char] + return get_month_names(width, context, self.locale)[self.value.month] + + def format_week(self, char: str, num: int) -> str: + if char.islower(): # week of year + week = self.get_week_of_year() + return self.format(week, num) + else: # week of month + week = self.get_week_of_month() + return str(week) + + def format_weekday(self, char: str = 'E', num: int = 4) -> str: + """ + Return weekday from parsed datetime according to format pattern. + + >>> from datetime import date + >>> format = DateTimeFormat(date(2016, 2, 28), Locale.parse('en_US')) + >>> format.format_weekday() + u'Sunday' + + 'E': Day of week - Use one through three letters for the abbreviated day name, four for the full (wide) name, + five for the narrow name, or six for the short name. + >>> format.format_weekday('E',2) + u'Sun' + + 'e': Local day of week. Same as E except adds a numeric value that will depend on the local starting day of the + week, using one or two letters. For this example, Monday is the first day of the week. + >>> format.format_weekday('e',2) + '01' + + 'c': Stand-Alone local day of week - Use one letter for the local numeric value (same as 'e'), three for the + abbreviated day name, four for the full (wide) name, five for the narrow name, or six for the short name. + >>> format.format_weekday('c',1) + '1' + + :param char: pattern format character ('e','E','c') + :param num: count of format character + + """ + if num < 3: + if char.islower(): + value = 7 - self.locale.first_week_day + self.value.weekday() + return self.format(value % 7 + 1, num) + num = 3 + weekday = self.value.weekday() + width = {3: 'abbreviated', 4: 'wide', 5: 'narrow', 6: 'short'}[num] + context = "stand-alone" if char == "c" else "format" + return get_day_names(width, context, self.locale)[weekday] + + def format_day_of_year(self, num: int) -> str: + return self.format(self.get_day_of_year(), num) + + def format_day_of_week_in_month(self) -> str: + return str((self.value.day - 1) // 7 + 1) + + def format_period(self, char: str, num: int) -> str: + """ + Return period from parsed datetime according to format pattern. + + >>> from datetime import datetime, time + >>> format = DateTimeFormat(time(13, 42), 'fi_FI') + >>> format.format_period('a', 1) + u'ip.' + >>> format.format_period('b', 1) + u'iltap.' + >>> format.format_period('b', 4) + u'iltapäivä' + >>> format.format_period('B', 4) + u'iltapäivällä' + >>> format.format_period('B', 5) + u'ip.' + + >>> format = DateTimeFormat(datetime(2022, 4, 28, 6, 27), 'zh_Hant') + >>> format.format_period('a', 1) + u'上午' + >>> format.format_period('B', 1) + u'清晨' + + :param char: pattern format character ('a', 'b', 'B') + :param num: count of format character + + """ + widths = [{3: 'abbreviated', 4: 'wide', 5: 'narrow'}[max(3, num)], + 'wide', 'narrow', 'abbreviated'] + if char == 'a': + period = 'pm' if self.value.hour >= 12 else 'am' + context = 'format' + else: + period = get_period_id(self.value, locale=self.locale) + context = 'format' if char == 'B' else 'stand-alone' + for width in widths: + period_names = get_period_names(context=context, width=width, locale=self.locale) + if period in period_names: + return period_names[period] + raise ValueError(f"Could not format period {period} in {self.locale}") + + def format_frac_seconds(self, num: int) -> str: + """ Return fractional seconds. + + Rounds the time's microseconds to the precision given by the number \ + of digits passed in. + """ + value = self.value.microsecond / 1000000 + return self.format(round(value, num) * 10**num, num) + + def format_milliseconds_in_day(self, num): + msecs = self.value.microsecond // 1000 + self.value.second * 1000 + \ + self.value.minute * 60000 + self.value.hour * 3600000 + return self.format(msecs, num) + + def format_timezone(self, char: str, num: int) -> str: + width = {3: 'short', 4: 'long', 5: 'iso8601'}[max(3, num)] + + # It could be that we only receive a time to format, but also have a + # reference date which is important to distinguish between timezone + # variants (summer/standard time) + value = self.value + if self.reference_date: + value = datetime.datetime.combine(self.reference_date, self.value) + + if char == 'z': + return get_timezone_name(value, width, locale=self.locale) + elif char == 'Z': + if num == 5: + return get_timezone_gmt(value, width, locale=self.locale, return_z=True) + return get_timezone_gmt(value, width, locale=self.locale) + elif char == 'O': + if num == 4: + return get_timezone_gmt(value, width, locale=self.locale) + # TODO: To add support for O:1 + elif char == 'v': + return get_timezone_name(value.tzinfo, width, + locale=self.locale) + elif char == 'V': + if num == 1: + return get_timezone_name(value.tzinfo, width, + uncommon=True, locale=self.locale) + elif num == 2: + return get_timezone_name(value.tzinfo, locale=self.locale, return_zone=True) + elif num == 3: + return get_timezone_location(value.tzinfo, locale=self.locale, return_city=True) + return get_timezone_location(value.tzinfo, locale=self.locale) + # Included additional elif condition to add support for 'Xx' in timezone format + elif char == 'X': + if num == 1: + return get_timezone_gmt(value, width='iso8601_short', locale=self.locale, + return_z=True) + elif num in (2, 4): + return get_timezone_gmt(value, width='short', locale=self.locale, + return_z=True) + elif num in (3, 5): + return get_timezone_gmt(value, width='iso8601', locale=self.locale, + return_z=True) + elif char == 'x': + if num == 1: + return get_timezone_gmt(value, width='iso8601_short', locale=self.locale) + elif num in (2, 4): + return get_timezone_gmt(value, width='short', locale=self.locale) + elif num in (3, 5): + return get_timezone_gmt(value, width='iso8601', locale=self.locale) + + def format(self, value: SupportsInt, length: int) -> str: + return '%0*d' % (length, value) + + def get_day_of_year(self, date: datetime.date | None = None) -> int: + if date is None: + date = self.value + return (date - date.replace(month=1, day=1)).days + 1 + + def get_week_of_year(self) -> int: + """Return the week of the year.""" + day_of_year = self.get_day_of_year(self.value) + week = self.get_week_number(day_of_year) + if week == 0: + date = datetime.date(self.value.year - 1, 12, 31) + week = self.get_week_number(self.get_day_of_year(date), + date.weekday()) + elif week > 52: + weekday = datetime.date(self.value.year + 1, 1, 1).weekday() + if self.get_week_number(1, weekday) == 1 and \ + 32 - (weekday - self.locale.first_week_day) % 7 <= self.value.day: + week = 1 + return week + + def get_week_of_month(self) -> int: + """Return the week of the month.""" + return self.get_week_number(self.value.day) + + def get_week_number(self, day_of_period: int, day_of_week: int | None = None) -> int: + """Return the number of the week of a day within a period. This may be + the week number in a year or the week number in a month. + + Usually this will return a value equal to or greater than 1, but if the + first week of the period is so short that it actually counts as the last + week of the previous period, this function will return 0. + + >>> date = datetime.date(2006, 1, 8) + >>> DateTimeFormat(date, 'de_DE').get_week_number(6) + 1 + >>> DateTimeFormat(date, 'en_US').get_week_number(6) + 2 + + :param day_of_period: the number of the day in the period (usually + either the day of month or the day of year) + :param day_of_week: the week day; if omitted, the week day of the + current date is assumed + """ + if day_of_week is None: + day_of_week = self.value.weekday() + first_day = (day_of_week - self.locale.first_week_day - + day_of_period + 1) % 7 + if first_day < 0: + first_day += 7 + week_number = (day_of_period + first_day - 1) // 7 + if 7 - first_day >= self.locale.min_week_days: + week_number += 1 + return week_number + + +PATTERN_CHARS: dict[str, list[int] | None] = { + 'G': [1, 2, 3, 4, 5], # era + 'y': None, 'Y': None, 'u': None, # year + 'Q': [1, 2, 3, 4, 5], 'q': [1, 2, 3, 4, 5], # quarter + 'M': [1, 2, 3, 4, 5], 'L': [1, 2, 3, 4, 5], # month + 'w': [1, 2], 'W': [1], # week + 'd': [1, 2], 'D': [1, 2, 3], 'F': [1], 'g': None, # day + 'E': [1, 2, 3, 4, 5, 6], 'e': [1, 2, 3, 4, 5, 6], 'c': [1, 3, 4, 5, 6], # week day + 'a': [1, 2, 3, 4, 5], 'b': [1, 2, 3, 4, 5], 'B': [1, 2, 3, 4, 5], # period + 'h': [1, 2], 'H': [1, 2], 'K': [1, 2], 'k': [1, 2], # hour + 'm': [1, 2], # minute + 's': [1, 2], 'S': None, 'A': None, # second + 'z': [1, 2, 3, 4], 'Z': [1, 2, 3, 4, 5], 'O': [1, 4], 'v': [1, 4], # zone + 'V': [1, 2, 3, 4], 'x': [1, 2, 3, 4, 5], 'X': [1, 2, 3, 4, 5], # zone +} + +#: The pattern characters declared in the Date Field Symbol Table +#: (https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table) +#: in order of decreasing magnitude. +PATTERN_CHAR_ORDER = "GyYuUQqMLlwWdDFgEecabBChHKkjJmsSAzZOvVXx" + + +def parse_pattern(pattern: str | DateTimePattern) -> DateTimePattern: + """Parse date, time, and datetime format patterns. + + >>> parse_pattern("MMMMd").format + u'%(MMMM)s%(d)s' + >>> parse_pattern("MMM d, yyyy").format + u'%(MMM)s %(d)s, %(yyyy)s' + + Pattern can contain literal strings in single quotes: + + >>> parse_pattern("H:mm' Uhr 'z").format + u'%(H)s:%(mm)s Uhr %(z)s' + + An actual single quote can be used by using two adjacent single quote + characters: + + >>> parse_pattern("hh' o''clock'").format + u"%(hh)s o'clock" + + :param pattern: the formatting pattern to parse + """ + if isinstance(pattern, DateTimePattern): + return pattern + return _cached_parse_pattern(pattern) + + +@lru_cache(maxsize=1024) +def _cached_parse_pattern(pattern: str) -> DateTimePattern: + result = [] + + for tok_type, tok_value in tokenize_pattern(pattern): + if tok_type == "chars": + result.append(tok_value.replace('%', '%%')) + elif tok_type == "field": + fieldchar, fieldnum = tok_value + limit = PATTERN_CHARS[fieldchar] + if limit and fieldnum not in limit: + raise ValueError(f"Invalid length for field: {fieldchar * fieldnum!r}") + result.append('%%(%s)s' % (fieldchar * fieldnum)) + else: + raise NotImplementedError(f"Unknown token type: {tok_type}") + return DateTimePattern(pattern, ''.join(result)) + + +def tokenize_pattern(pattern: str) -> list[tuple[str, str | tuple[str, int]]]: + """ + Tokenize date format patterns. + + Returns a list of (token_type, token_value) tuples. + + ``token_type`` may be either "chars" or "field". + + For "chars" tokens, the value is the literal value. + + For "field" tokens, the value is a tuple of (field character, repetition count). + + :param pattern: Pattern string + :type pattern: str + :rtype: list[tuple] + """ + result = [] + quotebuf = None + charbuf = [] + fieldchar = [''] + fieldnum = [0] + + def append_chars(): + result.append(('chars', ''.join(charbuf).replace('\0', "'"))) + del charbuf[:] + + def append_field(): + result.append(('field', (fieldchar[0], fieldnum[0]))) + fieldchar[0] = '' + fieldnum[0] = 0 + + for char in pattern.replace("''", '\0'): + if quotebuf is None: + if char == "'": # quote started + if fieldchar[0]: + append_field() + elif charbuf: + append_chars() + quotebuf = [] + elif char in PATTERN_CHARS: + if charbuf: + append_chars() + if char == fieldchar[0]: + fieldnum[0] += 1 + else: + if fieldchar[0]: + append_field() + fieldchar[0] = char + fieldnum[0] = 1 + else: + if fieldchar[0]: + append_field() + charbuf.append(char) + + elif quotebuf is not None: + if char == "'": # end of quote + charbuf.extend(quotebuf) + quotebuf = None + else: # inside quote + quotebuf.append(char) + + if fieldchar[0]: + append_field() + elif charbuf: + append_chars() + + return result + + +def untokenize_pattern(tokens: Iterable[tuple[str, str | tuple[str, int]]]) -> str: + """ + Turn a date format pattern token stream back into a string. + + This is the reverse operation of ``tokenize_pattern``. + + :type tokens: Iterable[tuple] + :rtype: str + """ + output = [] + for tok_type, tok_value in tokens: + if tok_type == "field": + output.append(tok_value[0] * tok_value[1]) + elif tok_type == "chars": + if not any(ch in PATTERN_CHARS for ch in tok_value): # No need to quote + output.append(tok_value) + else: + output.append("'%s'" % tok_value.replace("'", "''")) + return "".join(output) + + +def split_interval_pattern(pattern: str) -> list[str]: + """ + Split an interval-describing datetime pattern into multiple pieces. + + > The pattern is then designed to be broken up into two pieces by determining the first repeating field. + - https://www.unicode.org/reports/tr35/tr35-dates.html#intervalFormats + + >>> split_interval_pattern(u'E d.M. \u2013 E d.M.') + [u'E d.M. \u2013 ', 'E d.M.'] + >>> split_interval_pattern("Y 'text' Y 'more text'") + ["Y 'text '", "Y 'more text'"] + >>> split_interval_pattern(u"E, MMM d \u2013 E") + [u'E, MMM d \u2013 ', u'E'] + >>> split_interval_pattern("MMM d") + ['MMM d'] + >>> split_interval_pattern("y G") + ['y G'] + >>> split_interval_pattern(u"MMM d \u2013 d") + [u'MMM d \u2013 ', u'd'] + + :param pattern: Interval pattern string + :return: list of "subpatterns" + """ + + seen_fields = set() + parts = [[]] + + for tok_type, tok_value in tokenize_pattern(pattern): + if tok_type == "field": + if tok_value[0] in seen_fields: # Repeated field + parts.append([]) + seen_fields.clear() + seen_fields.add(tok_value[0]) + parts[-1].append((tok_type, tok_value)) + + return [untokenize_pattern(tokens) for tokens in parts] + + +def match_skeleton(skeleton: str, options: Iterable[str], allow_different_fields: bool = False) -> str | None: + """ + Find the closest match for the given datetime skeleton among the options given. + + This uses the rules outlined in the TR35 document. + + >>> match_skeleton('yMMd', ('yMd', 'yMMMd')) + 'yMd' + + >>> match_skeleton('yMMd', ('jyMMd',), allow_different_fields=True) + 'jyMMd' + + >>> match_skeleton('yMMd', ('qyMMd',), allow_different_fields=False) + + >>> match_skeleton('hmz', ('hmv',)) + 'hmv' + + :param skeleton: The skeleton to match + :type skeleton: str + :param options: An iterable of other skeletons to match against + :type options: Iterable[str] + :param allow_different_fields: Whether to allow a match that uses different fields + than the skeleton requested. + :type allow_different_fields: bool + + :return: The closest skeleton match, or if no match was found, None. + :rtype: str|None + """ + + # TODO: maybe implement pattern expansion? + + # Based on the implementation in + # https://github.com/unicode-org/icu/blob/main/icu4j/main/core/src/main/java/com/ibm/icu/text/DateIntervalInfo.java + + # Filter out falsy values and sort for stability; when `interval_formats` is passed in, there may be a None key. + options = sorted(option for option in options if option) + + if 'z' in skeleton and not any('z' in option for option in options): + skeleton = skeleton.replace('z', 'v') + if 'k' in skeleton and not any('k' in option for option in options): + skeleton = skeleton.replace('k', 'H') + if 'K' in skeleton and not any('K' in option for option in options): + skeleton = skeleton.replace('K', 'h') + if 'a' in skeleton and not any('a' in option for option in options): + skeleton = skeleton.replace('a', '') + if 'b' in skeleton and not any('b' in option for option in options): + skeleton = skeleton.replace('b', '') + + get_input_field_width = dict(t[1] for t in tokenize_pattern(skeleton) if t[0] == "field").get + best_skeleton = None + best_distance = None + for option in options: + get_opt_field_width = dict(t[1] for t in tokenize_pattern(option) if t[0] == "field").get + distance = 0 + for field in PATTERN_CHARS: + input_width = get_input_field_width(field, 0) + opt_width = get_opt_field_width(field, 0) + if input_width == opt_width: + continue + if opt_width == 0 or input_width == 0: + if not allow_different_fields: # This one is not okay + option = None + break + distance += 0x1000 # Magic weight constant for "entirely different fields" + elif field == 'M' and ((input_width > 2 and opt_width <= 2) or (input_width <= 2 and opt_width > 2)): + distance += 0x100 # Magic weight for "text turns into a number" + else: + distance += abs(input_width - opt_width) + + if not option: # We lost the option along the way (probably due to "allow_different_fields") + continue + + if not best_skeleton or distance < best_distance: + best_skeleton = option + best_distance = distance + + if distance == 0: # Found a perfect match! + break + + return best_skeleton diff --git a/venv/Lib/site-packages/babel/global.dat b/venv/Lib/site-packages/babel/global.dat new file mode 100644 index 0000000000000000000000000000000000000000..386193b22ce1a74ca5365b6f9e3641346e4bbe0f --- /dev/null +++ b/venv/Lib/site-packages/babel/global.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c11607a7f9d2c1993a4b54b4927de0db4cc70189b6bebed3866bd5eeea83aa03 +size 459316 diff --git a/venv/Lib/site-packages/babel/languages.py b/venv/Lib/site-packages/babel/languages.py new file mode 100644 index 0000000000000000000000000000000000000000..564f555d2b1f4ef60476aa881ff38f65ebe39b5f --- /dev/null +++ b/venv/Lib/site-packages/babel/languages.py @@ -0,0 +1,72 @@ +from __future__ import annotations + +from babel.core import get_global + + +def get_official_languages(territory: str, regional: bool = False, de_facto: bool = False) -> tuple[str, ...]: + """ + Get the official language(s) for the given territory. + + The language codes, if any are known, are returned in order of descending popularity. + + If the `regional` flag is set, then languages which are regionally official are also returned. + + If the `de_facto` flag is set, then languages which are "de facto" official are also returned. + + .. warning:: Note that the data is as up to date as the current version of the CLDR used + by Babel. If you need scientifically accurate information, use another source! + + :param territory: Territory code + :type territory: str + :param regional: Whether to return regionally official languages too + :type regional: bool + :param de_facto: Whether to return de-facto official languages too + :type de_facto: bool + :return: Tuple of language codes + :rtype: tuple[str] + """ + + territory = str(territory).upper() + allowed_stati = {"official"} + if regional: + allowed_stati.add("official_regional") + if de_facto: + allowed_stati.add("de_facto_official") + + languages = get_global("territory_languages").get(territory, {}) + pairs = [ + (info['population_percent'], language) + for language, info in languages.items() + if info.get('official_status') in allowed_stati + ] + pairs.sort(reverse=True) + return tuple(lang for _, lang in pairs) + + +def get_territory_language_info(territory: str) -> dict[str, dict[str, float | str | None]]: + """ + Get a dictionary of language information for a territory. + + The dictionary is keyed by language code; the values are dicts with more information. + + The following keys are currently known for the values: + + * `population_percent`: The percentage of the territory's population speaking the + language. + * `official_status`: An optional string describing the officiality status of the language. + Known values are "official", "official_regional" and "de_facto_official". + + .. warning:: Note that the data is as up to date as the current version of the CLDR used + by Babel. If you need scientifically accurate information, use another source! + + .. note:: Note that the format of the dict returned may change between Babel versions. + + See https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html + + :param territory: Territory code + :type territory: str + :return: Language information dictionary + :rtype: dict[str, dict] + """ + territory = str(territory).upper() + return get_global("territory_languages").get(territory, {}).copy() diff --git a/venv/Lib/site-packages/babel/lists.py b/venv/Lib/site-packages/babel/lists.py new file mode 100644 index 0000000000000000000000000000000000000000..353171c71c8cb58702f7229a0c3797cfdf0d7688 --- /dev/null +++ b/venv/Lib/site-packages/babel/lists.py @@ -0,0 +1,132 @@ +""" + babel.lists + ~~~~~~~~~~~ + + Locale dependent formatting of lists. + + The default locale for the functions in this module is determined by the + following environment variables, in that order: + + * ``LC_ALL``, and + * ``LANG`` + + :copyright: (c) 2015-2025 by the Babel Team. + :license: BSD, see LICENSE for more details. +""" +from __future__ import annotations + +import warnings +from collections.abc import Sequence +from typing import Literal + +from babel.core import Locale, default_locale + +_DEFAULT_LOCALE = default_locale() # TODO(3.0): Remove this. + + +def __getattr__(name): + if name == "DEFAULT_LOCALE": + warnings.warn( + "The babel.lists.DEFAULT_LOCALE constant is deprecated and will be removed.", + DeprecationWarning, + stacklevel=2, + ) + return _DEFAULT_LOCALE + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") + + +def format_list( + lst: Sequence[str], + style: Literal['standard', 'standard-short', 'or', 'or-short', 'unit', 'unit-short', 'unit-narrow'] = 'standard', + locale: Locale | str | None = None, +) -> str: + """ + Format the items in `lst` as a list. + + >>> format_list(['apples', 'oranges', 'pears'], locale='en') + u'apples, oranges, and pears' + >>> format_list(['apples', 'oranges', 'pears'], locale='zh') + u'apples\u3001oranges\u548cpears' + >>> format_list(['omena', 'peruna', 'aplari'], style='or', locale='fi') + u'omena, peruna tai aplari' + + Not all styles are necessarily available in all locales. + The function will attempt to fall back to replacement styles according to the rules + set forth in the CLDR root XML file, and raise a ValueError if no suitable replacement + can be found. + + The following text is verbatim from the Unicode TR35-49 spec [1]. + + * standard: + A typical 'and' list for arbitrary placeholders. + eg. "January, February, and March" + * standard-short: + A short version of an 'and' list, suitable for use with short or abbreviated placeholder values. + eg. "Jan., Feb., and Mar." + * or: + A typical 'or' list for arbitrary placeholders. + eg. "January, February, or March" + * or-short: + A short version of an 'or' list. + eg. "Jan., Feb., or Mar." + * unit: + A list suitable for wide units. + eg. "3 feet, 7 inches" + * unit-short: + A list suitable for short units + eg. "3 ft, 7 in" + * unit-narrow: + A list suitable for narrow units, where space on the screen is very limited. + eg. "3′ 7″" + + [1]: https://www.unicode.org/reports/tr35/tr35-49/tr35-general.html#ListPatterns + + :param lst: a sequence of items to format in to a list + :param style: the style to format the list with. See above for description. + :param locale: the locale. Defaults to the system locale. + """ + locale = Locale.parse(locale or _DEFAULT_LOCALE) + if not lst: + return '' + if len(lst) == 1: + return lst[0] + + patterns = _resolve_list_style(locale, style) + + if len(lst) == 2 and '2' in patterns: + return patterns['2'].format(*lst) + + result = patterns['start'].format(lst[0], lst[1]) + for elem in lst[2:-1]: + result = patterns['middle'].format(result, elem) + result = patterns['end'].format(result, lst[-1]) + + return result + + +# Based on CLDR 45's root.xml file's ``es. +# The root file defines both `standard` and `or`, +# so they're always available. +# TODO: It would likely be better to use the +# babel.localedata.Alias mechanism for this, +# but I'm not quite sure how it's supposed to +# work with inheritance and data in the root. +_style_fallbacks = { + "or-narrow": ["or-short", "or"], + "or-short": ["or"], + "standard-narrow": ["standard-short", "standard"], + "standard-short": ["standard"], + "unit": ["unit-short", "standard"], + "unit-narrow": ["unit-short", "unit", "standard"], + "unit-short": ["standard"], +} + + +def _resolve_list_style(locale: Locale, style: str): + for style in (style, *(_style_fallbacks.get(style, []))): # noqa: B020 + if style in locale.list_patterns: + return locale.list_patterns[style] + raise ValueError( + f"Locale {locale} does not support list formatting style {style!r} " + f"(supported are {sorted(locale.list_patterns)})", + ) diff --git a/venv/Lib/site-packages/babel/locale-data/LICENSE.unicode b/venv/Lib/site-packages/babel/locale-data/LICENSE.unicode new file mode 100644 index 0000000000000000000000000000000000000000..861b74f3c812088755fd185d964e82a244503bbd --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/LICENSE.unicode @@ -0,0 +1,41 @@ +UNICODE LICENSE V3 + +COPYRIGHT AND PERMISSION NOTICE + +Copyright © 2004-2025 Unicode, Inc. + +NOTICE TO USER: Carefully read the following legal agreement. BY +DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR +SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT +DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of data files and any associated documentation (the "Data Files") or +software and any associated documentation (the "Software") to deal in the +Data Files or Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, and/or sell +copies of the Data Files or Software, and to permit persons to whom the +Data Files or Software are furnished to do so, provided that either (a) +this copyright and permission notice appear with all copies of the Data +Files or Software, or (b) this copyright and permission notice appear in +associated Documentation. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF +THIRD PARTY RIGHTS. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE +BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA +FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder shall +not be used in advertising or otherwise to promote the sale, use or other +dealings in these Data Files or Software without prior written +authorization of the copyright holder. + +SPDX-License-Identifier: Unicode-3.0 diff --git a/venv/Lib/site-packages/babel/locale-data/aa.dat b/venv/Lib/site-packages/babel/locale-data/aa.dat new file mode 100644 index 0000000000000000000000000000000000000000..96b76a0033da33c6475640d3c10b20553ff128f4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/aa.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/aa_DJ.dat b/venv/Lib/site-packages/babel/locale-data/aa_DJ.dat new file mode 100644 index 0000000000000000000000000000000000000000..a3cb25635686451036b2754a2fb3c115b601a35a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/aa_DJ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/aa_ER.dat b/venv/Lib/site-packages/babel/locale-data/aa_ER.dat new file mode 100644 index 0000000000000000000000000000000000000000..a01edfca24195f77fc9cebfee00528f0be2d0a28 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/aa_ER.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/aa_ET.dat b/venv/Lib/site-packages/babel/locale-data/aa_ET.dat new file mode 100644 index 0000000000000000000000000000000000000000..119b891baccebe30a7c541ad82287c42dd675e2d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/aa_ET.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ab.dat b/venv/Lib/site-packages/babel/locale-data/ab.dat new file mode 100644 index 0000000000000000000000000000000000000000..e1fbc6e6ef253786ea7444696479d0405d806115 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ab.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ab_GE.dat b/venv/Lib/site-packages/babel/locale-data/ab_GE.dat new file mode 100644 index 0000000000000000000000000000000000000000..15a980a714dee2c227f588cdaba5a3ec0d8ec830 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ab_GE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/af.dat b/venv/Lib/site-packages/babel/locale-data/af.dat new file mode 100644 index 0000000000000000000000000000000000000000..0302946964ea218113eaeaa61c0a2e1ef748df0f --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/af.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4ef7fdc1a49490009de067f8fa65d5291aadf3a84bfa088659f82a494d7c2be +size 144732 diff --git a/venv/Lib/site-packages/babel/locale-data/af_NA.dat b/venv/Lib/site-packages/babel/locale-data/af_NA.dat new file mode 100644 index 0000000000000000000000000000000000000000..d5ff2a3130c747a97805ce34b1a5365cadc7978a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/af_NA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/af_ZA.dat b/venv/Lib/site-packages/babel/locale-data/af_ZA.dat new file mode 100644 index 0000000000000000000000000000000000000000..34779331c556c4dbe224b04867fee269e88ab24c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/af_ZA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/agq.dat b/venv/Lib/site-packages/babel/locale-data/agq.dat new file mode 100644 index 0000000000000000000000000000000000000000..a4eb919cd600397f3d722af988161e4c119a2e32 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/agq.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/agq_CM.dat b/venv/Lib/site-packages/babel/locale-data/agq_CM.dat new file mode 100644 index 0000000000000000000000000000000000000000..57701c907d881ea5c8dd802b9d701d7c91b5dac2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/agq_CM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ak.dat b/venv/Lib/site-packages/babel/locale-data/ak.dat new file mode 100644 index 0000000000000000000000000000000000000000..c3b49815b043ef5ced0cc98a8a21bbe7ceb8bc98 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ak.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2fbdf2ff2961672dfd4a511a0300388c2a8fffddaa2ef225b1a825fa8d9194a1 +size 116224 diff --git a/venv/Lib/site-packages/babel/locale-data/ak_GH.dat b/venv/Lib/site-packages/babel/locale-data/ak_GH.dat new file mode 100644 index 0000000000000000000000000000000000000000..a7c63daece80eab852e7bd80116053cd75f9063b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ak_GH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/am.dat b/venv/Lib/site-packages/babel/locale-data/am.dat new file mode 100644 index 0000000000000000000000000000000000000000..50fd1c7221bdd4c1b8fdcf319392ef9e751bed16 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/am.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4dd75f79121216fce34c5a41faf1f782348ab36afc893dc261c92bae289b5d96 +size 173260 diff --git a/venv/Lib/site-packages/babel/locale-data/am_ET.dat b/venv/Lib/site-packages/babel/locale-data/am_ET.dat new file mode 100644 index 0000000000000000000000000000000000000000..050cc76cc386513fca847f429550fba80898e3ab Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/am_ET.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/an.dat b/venv/Lib/site-packages/babel/locale-data/an.dat new file mode 100644 index 0000000000000000000000000000000000000000..1678ebce14fcd31fbe89d2a83e8e098e7c50b353 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/an.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/an_ES.dat b/venv/Lib/site-packages/babel/locale-data/an_ES.dat new file mode 100644 index 0000000000000000000000000000000000000000..a11156aacce8a5036e4301bbbb2ffbc931f5edae Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/an_ES.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ann.dat b/venv/Lib/site-packages/babel/locale-data/ann.dat new file mode 100644 index 0000000000000000000000000000000000000000..cee6e2bb26f5cedef28b9e63de62244618bd8a72 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ann.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ann_NG.dat b/venv/Lib/site-packages/babel/locale-data/ann_NG.dat new file mode 100644 index 0000000000000000000000000000000000000000..612c3f89db737657e53e5779f54aaff56135354f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ann_NG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/apc.dat b/venv/Lib/site-packages/babel/locale-data/apc.dat new file mode 100644 index 0000000000000000000000000000000000000000..644ec2a159bc375568b8254ac91e85609052cb4c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/apc.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/apc_SY.dat b/venv/Lib/site-packages/babel/locale-data/apc_SY.dat new file mode 100644 index 0000000000000000000000000000000000000000..6c5e15a7b9e8949f6436290a5020c46c7397e457 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/apc_SY.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar.dat b/venv/Lib/site-packages/babel/locale-data/ar.dat new file mode 100644 index 0000000000000000000000000000000000000000..ca4fdcd4e2bf6f23d460a0c07014bf2b21e991c5 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ar.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c808a396491a1fe46045089dbc2c8d064a62f59ece4c2f5c35f21b2a8e27e209 +size 288582 diff --git a/venv/Lib/site-packages/babel/locale-data/ar_001.dat b/venv/Lib/site-packages/babel/locale-data/ar_001.dat new file mode 100644 index 0000000000000000000000000000000000000000..bdc0475f08f1e198c56f1d84a10a7a2d0449ee28 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_001.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_AE.dat b/venv/Lib/site-packages/babel/locale-data/ar_AE.dat new file mode 100644 index 0000000000000000000000000000000000000000..f838659750a4b2e43a7ece8b17674129cc8c6870 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_AE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_BH.dat b/venv/Lib/site-packages/babel/locale-data/ar_BH.dat new file mode 100644 index 0000000000000000000000000000000000000000..1792ea6b19832faf5e0fc5696b9129fa7dbc9eb2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_BH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_DJ.dat b/venv/Lib/site-packages/babel/locale-data/ar_DJ.dat new file mode 100644 index 0000000000000000000000000000000000000000..579056a59b874110abeb989deb701d16aa7ef2a7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_DJ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_DZ.dat b/venv/Lib/site-packages/babel/locale-data/ar_DZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..2d61edcd8e1d67a6595e5c2fad3957f7d0993b7c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_DZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_EG.dat b/venv/Lib/site-packages/babel/locale-data/ar_EG.dat new file mode 100644 index 0000000000000000000000000000000000000000..d9be03e1c24531c71da7ffa7212dad0b9b816fbd Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_EG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_EH.dat b/venv/Lib/site-packages/babel/locale-data/ar_EH.dat new file mode 100644 index 0000000000000000000000000000000000000000..df44a58b82d83dde1ff1d20e7ec74aa31af90eb9 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_EH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_ER.dat b/venv/Lib/site-packages/babel/locale-data/ar_ER.dat new file mode 100644 index 0000000000000000000000000000000000000000..cd0364300c3703d8ed4c2c38207c24d28c248a7d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_ER.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_IL.dat b/venv/Lib/site-packages/babel/locale-data/ar_IL.dat new file mode 100644 index 0000000000000000000000000000000000000000..557c47f47059810f6cac6611cccdbbe608ba33b7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_IL.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_IQ.dat b/venv/Lib/site-packages/babel/locale-data/ar_IQ.dat new file mode 100644 index 0000000000000000000000000000000000000000..5b3d21c4487ae584b649e34bdd7fd18d06285ff7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_IQ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_JO.dat b/venv/Lib/site-packages/babel/locale-data/ar_JO.dat new file mode 100644 index 0000000000000000000000000000000000000000..8bf13f2428a9981bf1a7371d07c387216fe110ef Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_JO.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_KM.dat b/venv/Lib/site-packages/babel/locale-data/ar_KM.dat new file mode 100644 index 0000000000000000000000000000000000000000..88f1ac48bd1c1c61d48fbff7ddd6b21ff8eacb74 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_KM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_KW.dat b/venv/Lib/site-packages/babel/locale-data/ar_KW.dat new file mode 100644 index 0000000000000000000000000000000000000000..80762a479a48418e61556385242129803461ea03 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_KW.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_LB.dat b/venv/Lib/site-packages/babel/locale-data/ar_LB.dat new file mode 100644 index 0000000000000000000000000000000000000000..060dfa4902bc34c9f2475c0bca0b425ef4ccb4c3 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_LB.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_LY.dat b/venv/Lib/site-packages/babel/locale-data/ar_LY.dat new file mode 100644 index 0000000000000000000000000000000000000000..a870e157c8863cf1aa13c0598ae1b261a4fe1448 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_LY.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_MA.dat b/venv/Lib/site-packages/babel/locale-data/ar_MA.dat new file mode 100644 index 0000000000000000000000000000000000000000..ecdc22a57a258d7d2bf69c5f98dbbf199f0fdb34 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_MA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_MR.dat b/venv/Lib/site-packages/babel/locale-data/ar_MR.dat new file mode 100644 index 0000000000000000000000000000000000000000..7d66b5cf96182eb3418daaef4a32367f70d4590b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_MR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_OM.dat b/venv/Lib/site-packages/babel/locale-data/ar_OM.dat new file mode 100644 index 0000000000000000000000000000000000000000..d318d99fd7e21f1e543abb51ee99e875d9dc61a0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_OM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_PS.dat b/venv/Lib/site-packages/babel/locale-data/ar_PS.dat new file mode 100644 index 0000000000000000000000000000000000000000..2c3ef839d0323e3a07fa7285a309f216c619fd85 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_PS.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_QA.dat b/venv/Lib/site-packages/babel/locale-data/ar_QA.dat new file mode 100644 index 0000000000000000000000000000000000000000..d187cc662347f457f6b2fd9f9f66f3f495229cbd Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_QA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_SA.dat b/venv/Lib/site-packages/babel/locale-data/ar_SA.dat new file mode 100644 index 0000000000000000000000000000000000000000..ae1ecaedc7d2002601631ab8ce7c5eca6fde9fb1 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_SA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_SD.dat b/venv/Lib/site-packages/babel/locale-data/ar_SD.dat new file mode 100644 index 0000000000000000000000000000000000000000..0ce23d8af072390261bcfa5ac57099f944f911f6 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_SD.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_SO.dat b/venv/Lib/site-packages/babel/locale-data/ar_SO.dat new file mode 100644 index 0000000000000000000000000000000000000000..ed6648bc3f92e0a020c293b33f3f6d9baf394cdb Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_SO.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_SS.dat b/venv/Lib/site-packages/babel/locale-data/ar_SS.dat new file mode 100644 index 0000000000000000000000000000000000000000..a2cadef74cc4cf202b2b5786279f01adf9817ca1 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_SS.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_SY.dat b/venv/Lib/site-packages/babel/locale-data/ar_SY.dat new file mode 100644 index 0000000000000000000000000000000000000000..701de7adbc50f6008a1bda586fc51347ffb5ad7d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_SY.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_TD.dat b/venv/Lib/site-packages/babel/locale-data/ar_TD.dat new file mode 100644 index 0000000000000000000000000000000000000000..deb0d9c4ced7b76716bab7c7099f80b633fe0abf Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_TD.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_TN.dat b/venv/Lib/site-packages/babel/locale-data/ar_TN.dat new file mode 100644 index 0000000000000000000000000000000000000000..46853cec1a0555101a1f1a3b1318401376ba3340 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_TN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ar_YE.dat b/venv/Lib/site-packages/babel/locale-data/ar_YE.dat new file mode 100644 index 0000000000000000000000000000000000000000..8c2212b59aa24028471b0a6897d51f5ee8b81208 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ar_YE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/arn.dat b/venv/Lib/site-packages/babel/locale-data/arn.dat new file mode 100644 index 0000000000000000000000000000000000000000..5abcc770a1daaa4d5bcf551ea30b6e8f1bb6a796 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/arn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/arn_CL.dat b/venv/Lib/site-packages/babel/locale-data/arn_CL.dat new file mode 100644 index 0000000000000000000000000000000000000000..4aadebb14ae8e2071955943e59cd000bfec9e7f3 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/arn_CL.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/as.dat b/venv/Lib/site-packages/babel/locale-data/as.dat new file mode 100644 index 0000000000000000000000000000000000000000..cbd899333e9ea6cf25fb3a19aa8bdeedcb493bc1 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/as.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c684e68627a80158f0e7d876fbfa4ba74c237d93d5bd8315eaa0d22632eb8eaf +size 209876 diff --git a/venv/Lib/site-packages/babel/locale-data/as_IN.dat b/venv/Lib/site-packages/babel/locale-data/as_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..9f24d23082233fe3d9b3dde84b07a31793f69e12 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/as_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/asa.dat b/venv/Lib/site-packages/babel/locale-data/asa.dat new file mode 100644 index 0000000000000000000000000000000000000000..6c4f84f4627e949a3faf0e8c6fd4929ddabada77 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/asa.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/asa_TZ.dat b/venv/Lib/site-packages/babel/locale-data/asa_TZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..0b2adf25c99a6302fff5c878add74b60f266f88d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/asa_TZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ast.dat b/venv/Lib/site-packages/babel/locale-data/ast.dat new file mode 100644 index 0000000000000000000000000000000000000000..6074e899d4578b9805f8dd277f1463f7bedd8701 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ast.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd07a8734833d5a83d32498d22ebf8b9f5639347c7e71b56e0ceefa7c493e216 +size 168961 diff --git a/venv/Lib/site-packages/babel/locale-data/ast_ES.dat b/venv/Lib/site-packages/babel/locale-data/ast_ES.dat new file mode 100644 index 0000000000000000000000000000000000000000..af96de068f56934fc8355a71d52a25dc52108c2a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ast_ES.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/az.dat b/venv/Lib/site-packages/babel/locale-data/az.dat new file mode 100644 index 0000000000000000000000000000000000000000..9a838a8e4adff8d2397df955ad8e8fd207659ea1 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/az.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8473031cf2a22a096fc5d087365e3150b619021b27cb37327325953df5971a0 +size 173802 diff --git a/venv/Lib/site-packages/babel/locale-data/az_Arab.dat b/venv/Lib/site-packages/babel/locale-data/az_Arab.dat new file mode 100644 index 0000000000000000000000000000000000000000..d18ccb510a2cf9b3f32838395a33f3af403f8811 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/az_Arab.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/az_Arab_IQ.dat b/venv/Lib/site-packages/babel/locale-data/az_Arab_IQ.dat new file mode 100644 index 0000000000000000000000000000000000000000..393175fc4cc25cf794a0e1673bee0d41ae4acece Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/az_Arab_IQ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/az_Arab_IR.dat b/venv/Lib/site-packages/babel/locale-data/az_Arab_IR.dat new file mode 100644 index 0000000000000000000000000000000000000000..8df9df25123613f36dbc71277b45eea350de15ce Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/az_Arab_IR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/az_Arab_TR.dat b/venv/Lib/site-packages/babel/locale-data/az_Arab_TR.dat new file mode 100644 index 0000000000000000000000000000000000000000..99fa84c46fbf81b82485c1abf1b735d4dad972db Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/az_Arab_TR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/az_Cyrl.dat b/venv/Lib/site-packages/babel/locale-data/az_Cyrl.dat new file mode 100644 index 0000000000000000000000000000000000000000..2f79fbd082ebdb88e1153809ce50f8ca3a5adba0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/az_Cyrl.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/az_Cyrl_AZ.dat b/venv/Lib/site-packages/babel/locale-data/az_Cyrl_AZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..75ee5220b3f24e0ff72922de1a6fc6c5395ccd8f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/az_Cyrl_AZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/az_Latn.dat b/venv/Lib/site-packages/babel/locale-data/az_Latn.dat new file mode 100644 index 0000000000000000000000000000000000000000..88c306fe8ed7f377862a68ed397d4dfa243d5bae Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/az_Latn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/az_Latn_AZ.dat b/venv/Lib/site-packages/babel/locale-data/az_Latn_AZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..75ee5220b3f24e0ff72922de1a6fc6c5395ccd8f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/az_Latn_AZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ba.dat b/venv/Lib/site-packages/babel/locale-data/ba.dat new file mode 100644 index 0000000000000000000000000000000000000000..99bc134f77e7797f8aa3d54808c29ec4409ed7fa Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ba.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ba_RU.dat b/venv/Lib/site-packages/babel/locale-data/ba_RU.dat new file mode 100644 index 0000000000000000000000000000000000000000..93dadc0fdcda7e91961102f2fd18782f58e5facd Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ba_RU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bal.dat b/venv/Lib/site-packages/babel/locale-data/bal.dat new file mode 100644 index 0000000000000000000000000000000000000000..6135e5a3948f63e6a790cb3252b1e3504bacad9a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bal.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bal_Arab.dat b/venv/Lib/site-packages/babel/locale-data/bal_Arab.dat new file mode 100644 index 0000000000000000000000000000000000000000..9fc6e82e132c4ddc1cf7ced7b54997993d24c75e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bal_Arab.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bal_Arab_PK.dat b/venv/Lib/site-packages/babel/locale-data/bal_Arab_PK.dat new file mode 100644 index 0000000000000000000000000000000000000000..37f77e20a193813f04c6ee0a3d21cdc87d260062 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bal_Arab_PK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bal_Latn.dat b/venv/Lib/site-packages/babel/locale-data/bal_Latn.dat new file mode 100644 index 0000000000000000000000000000000000000000..d04ea3801aeab9d21f380d02d15717989daa757a --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/bal_Latn.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5fdb04bc2ed25345541676a9cc5294ab49ef7356b3d5cf651e6ac23c73c28385 +size 116909 diff --git a/venv/Lib/site-packages/babel/locale-data/bal_Latn_PK.dat b/venv/Lib/site-packages/babel/locale-data/bal_Latn_PK.dat new file mode 100644 index 0000000000000000000000000000000000000000..37f77e20a193813f04c6ee0a3d21cdc87d260062 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bal_Latn_PK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bas.dat b/venv/Lib/site-packages/babel/locale-data/bas.dat new file mode 100644 index 0000000000000000000000000000000000000000..6afbc89dedd7d4c0f820fb71f16554bb3e37f7cf Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bas.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bas_CM.dat b/venv/Lib/site-packages/babel/locale-data/bas_CM.dat new file mode 100644 index 0000000000000000000000000000000000000000..992e8632e4b3f20c647af89430113cf87fb62b0b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bas_CM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/be.dat b/venv/Lib/site-packages/babel/locale-data/be.dat new file mode 100644 index 0000000000000000000000000000000000000000..79bcdb7ff062c916c5c217a93251ee10e14b21b8 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/be.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f0be90d02e308db2cc0bd23b96d168635a6b013b9177ef279f4b9da6b60123a0 +size 272322 diff --git a/venv/Lib/site-packages/babel/locale-data/be_BY.dat b/venv/Lib/site-packages/babel/locale-data/be_BY.dat new file mode 100644 index 0000000000000000000000000000000000000000..759f67a1cc5890f15d75b4968e70b26c71ce743f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/be_BY.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/be_TARASK.dat b/venv/Lib/site-packages/babel/locale-data/be_TARASK.dat new file mode 100644 index 0000000000000000000000000000000000000000..ad50053d04738d44b03cc7aed54c5fe6aaa994e6 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/be_TARASK.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f77c43c4ed3a9ee02e8295a3ae7c7a0b993c16cdba1c80289547143eea0785b8 +size 104118 diff --git a/venv/Lib/site-packages/babel/locale-data/bem.dat b/venv/Lib/site-packages/babel/locale-data/bem.dat new file mode 100644 index 0000000000000000000000000000000000000000..35c138fca609fe85d83a45f34baffe3c1a1b04a1 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bem.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bem_ZM.dat b/venv/Lib/site-packages/babel/locale-data/bem_ZM.dat new file mode 100644 index 0000000000000000000000000000000000000000..7f393a8bd45604553055fcce933b0487f599601e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bem_ZM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bew.dat b/venv/Lib/site-packages/babel/locale-data/bew.dat new file mode 100644 index 0000000000000000000000000000000000000000..0459f5d8c65e492817ce0bc8c192cc0d2077daff --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/bew.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:99f291db73d23f24b4007c5b692b8cbee7d965094c202c431ae3efefc32d0db5 +size 122095 diff --git a/venv/Lib/site-packages/babel/locale-data/bew_ID.dat b/venv/Lib/site-packages/babel/locale-data/bew_ID.dat new file mode 100644 index 0000000000000000000000000000000000000000..12cfbff66b86b5b94d403396fd4769becd6bdc4d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bew_ID.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bez.dat b/venv/Lib/site-packages/babel/locale-data/bez.dat new file mode 100644 index 0000000000000000000000000000000000000000..04e40d183fd451293b96c09a16f32a4b73915987 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bez.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bez_TZ.dat b/venv/Lib/site-packages/babel/locale-data/bez_TZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..76974eb111579a685272ce5b72a72232247dbefa Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bez_TZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bg.dat b/venv/Lib/site-packages/babel/locale-data/bg.dat new file mode 100644 index 0000000000000000000000000000000000000000..02efa9b83d05ca05245ce7c7b6ffa7564333d9ad --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/bg.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1f77f4efe289c83f5704d6954efb5ef5c9247d2495ee1cace95aa73ebed2cff +size 227940 diff --git a/venv/Lib/site-packages/babel/locale-data/bg_BG.dat b/venv/Lib/site-packages/babel/locale-data/bg_BG.dat new file mode 100644 index 0000000000000000000000000000000000000000..b69fe97905fd55b26c8430bd01ae17debd5b9482 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bg_BG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bgc.dat b/venv/Lib/site-packages/babel/locale-data/bgc.dat new file mode 100644 index 0000000000000000000000000000000000000000..1a3cdd55f16cc38bda434169e71021768b1c4504 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bgc.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bgc_IN.dat b/venv/Lib/site-packages/babel/locale-data/bgc_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..bc2e02172ab26ce98688f7b18eb355f4a19a3385 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bgc_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bgn.dat b/venv/Lib/site-packages/babel/locale-data/bgn.dat new file mode 100644 index 0000000000000000000000000000000000000000..f8297eb3d293365575fec39019e1528173611066 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bgn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bgn_AE.dat b/venv/Lib/site-packages/babel/locale-data/bgn_AE.dat new file mode 100644 index 0000000000000000000000000000000000000000..0b17e78f8b36c9f42a011bbd3d142d22195d6d0d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bgn_AE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bgn_AF.dat b/venv/Lib/site-packages/babel/locale-data/bgn_AF.dat new file mode 100644 index 0000000000000000000000000000000000000000..4062c74dbf1d5ca0f7cc8febf8573f07591bab15 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bgn_AF.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bgn_IR.dat b/venv/Lib/site-packages/babel/locale-data/bgn_IR.dat new file mode 100644 index 0000000000000000000000000000000000000000..99a1b50062132ab729bf979427447e38b56706be Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bgn_IR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bgn_OM.dat b/venv/Lib/site-packages/babel/locale-data/bgn_OM.dat new file mode 100644 index 0000000000000000000000000000000000000000..f3962683f1823e2ae5a68b545bf94d7c39c09229 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bgn_OM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bgn_PK.dat b/venv/Lib/site-packages/babel/locale-data/bgn_PK.dat new file mode 100644 index 0000000000000000000000000000000000000000..e15afea2c9d6eb0639289f44ebdd0f2aefdb2153 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bgn_PK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bho.dat b/venv/Lib/site-packages/babel/locale-data/bho.dat new file mode 100644 index 0000000000000000000000000000000000000000..15f164ee9eb89ea08439e93badb57b165d039fb7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bho.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bho_IN.dat b/venv/Lib/site-packages/babel/locale-data/bho_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..4f7eb58e352c34053b2747472676cc764752d508 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bho_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/blo.dat b/venv/Lib/site-packages/babel/locale-data/blo.dat new file mode 100644 index 0000000000000000000000000000000000000000..012c577eb04d2f861b3dfe1289c8a3768c7ce823 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/blo.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:23481fb06bfcd317fb768fa8c738e4876a2bf77e18c5880332433d4477fb5179 +size 168499 diff --git a/venv/Lib/site-packages/babel/locale-data/blo_BJ.dat b/venv/Lib/site-packages/babel/locale-data/blo_BJ.dat new file mode 100644 index 0000000000000000000000000000000000000000..fbc0ae5170ce117ded221b89c8688ec471682b27 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/blo_BJ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/blt.dat b/venv/Lib/site-packages/babel/locale-data/blt.dat new file mode 100644 index 0000000000000000000000000000000000000000..fee952118c77c7994fe19c9d317e74804c63eeb5 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/blt.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/blt_VN.dat b/venv/Lib/site-packages/babel/locale-data/blt_VN.dat new file mode 100644 index 0000000000000000000000000000000000000000..1cf8aa304f149281e4d8a476cc4eec079f03df16 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/blt_VN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bm.dat b/venv/Lib/site-packages/babel/locale-data/bm.dat new file mode 100644 index 0000000000000000000000000000000000000000..35a8748fb7ba0b86385a66ee5b1d2719c9620c8f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bm.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bm_ML.dat b/venv/Lib/site-packages/babel/locale-data/bm_ML.dat new file mode 100644 index 0000000000000000000000000000000000000000..db406084c6b19336f6c8ce1ae9c1b595e153b0b5 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bm_ML.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bm_Nkoo.dat b/venv/Lib/site-packages/babel/locale-data/bm_Nkoo.dat new file mode 100644 index 0000000000000000000000000000000000000000..318955fea46286d7fd0eea6dd6086a2116301e29 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bm_Nkoo.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bm_Nkoo_ML.dat b/venv/Lib/site-packages/babel/locale-data/bm_Nkoo_ML.dat new file mode 100644 index 0000000000000000000000000000000000000000..db406084c6b19336f6c8ce1ae9c1b595e153b0b5 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bm_Nkoo_ML.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bn.dat b/venv/Lib/site-packages/babel/locale-data/bn.dat new file mode 100644 index 0000000000000000000000000000000000000000..0711d8e1d7cfe159d7c54aec096bb3663ecad194 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/bn.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d34711298af0ca4e6c9e1ade90b8f44d0055cd9955fcf8d0d1a2e5b00a60c31c +size 219185 diff --git a/venv/Lib/site-packages/babel/locale-data/bn_BD.dat b/venv/Lib/site-packages/babel/locale-data/bn_BD.dat new file mode 100644 index 0000000000000000000000000000000000000000..0814ec91dabd16255729320740d6850a7b6ba3ec Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bn_BD.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bn_IN.dat b/venv/Lib/site-packages/babel/locale-data/bn_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..ea4c51c3221fd13406d34be235d9c18ed08a60c8 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bn_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bo.dat b/venv/Lib/site-packages/babel/locale-data/bo.dat new file mode 100644 index 0000000000000000000000000000000000000000..3e914649a37368a941a691f4571888b09fa764e1 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bo.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bo_CN.dat b/venv/Lib/site-packages/babel/locale-data/bo_CN.dat new file mode 100644 index 0000000000000000000000000000000000000000..d9e62431203c4d41f84d0d1c9e0f2c8b928adddf Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bo_CN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bo_IN.dat b/venv/Lib/site-packages/babel/locale-data/bo_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..900a19e753e39513358e77ee8caa75892fe3a67b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bo_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/br.dat b/venv/Lib/site-packages/babel/locale-data/br.dat new file mode 100644 index 0000000000000000000000000000000000000000..089ba8090a41068cd102b2ddc30210c66a524e3a --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/br.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac1b35069f47e90e0408eda6a2ea099a7096d2ec7908b3f1d73cb7d86be9902a +size 272612 diff --git a/venv/Lib/site-packages/babel/locale-data/br_FR.dat b/venv/Lib/site-packages/babel/locale-data/br_FR.dat new file mode 100644 index 0000000000000000000000000000000000000000..5964d661464cfbee086d2fc7c5974c2bbdb1c1a0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/br_FR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/brx.dat b/venv/Lib/site-packages/babel/locale-data/brx.dat new file mode 100644 index 0000000000000000000000000000000000000000..dc01835a4e7909835b111e9d8db89927fa8146d2 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/brx.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d0bf2b7d0c23c2d8f7cb9339cf3744075d306b2e08f4fda6f00d84d264c871a7 +size 160164 diff --git a/venv/Lib/site-packages/babel/locale-data/brx_IN.dat b/venv/Lib/site-packages/babel/locale-data/brx_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..6dafcc92652610eb937d141699f6ed32dc0d80bb Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/brx_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bs.dat b/venv/Lib/site-packages/babel/locale-data/bs.dat new file mode 100644 index 0000000000000000000000000000000000000000..b1a395ead8acba400bd6905e265359674b5dc411 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/bs.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6152db5c62c77fa419f6f6270a3c633b7b81226b989e8c51f9c12e04f55b3ffc +size 213968 diff --git a/venv/Lib/site-packages/babel/locale-data/bs_Cyrl.dat b/venv/Lib/site-packages/babel/locale-data/bs_Cyrl.dat new file mode 100644 index 0000000000000000000000000000000000000000..fe8b2cdfd580bd1f978373c9b5f060698bd01e90 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/bs_Cyrl.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a2a17010515f62acb3915becc23f0247607f4426f9d4ccaff2341a0c38f3d2ef +size 219235 diff --git a/venv/Lib/site-packages/babel/locale-data/bs_Cyrl_BA.dat b/venv/Lib/site-packages/babel/locale-data/bs_Cyrl_BA.dat new file mode 100644 index 0000000000000000000000000000000000000000..4a56da8f12bdf53b805f401364887b89b6127370 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bs_Cyrl_BA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bs_Latn.dat b/venv/Lib/site-packages/babel/locale-data/bs_Latn.dat new file mode 100644 index 0000000000000000000000000000000000000000..767af2e9f8f61a8056d684dc692372f2ef084e47 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bs_Latn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bs_Latn_BA.dat b/venv/Lib/site-packages/babel/locale-data/bs_Latn_BA.dat new file mode 100644 index 0000000000000000000000000000000000000000..4a56da8f12bdf53b805f401364887b89b6127370 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bs_Latn_BA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bss.dat b/venv/Lib/site-packages/babel/locale-data/bss.dat new file mode 100644 index 0000000000000000000000000000000000000000..9b59977cfe4a05e65eb29b62730266b253243abc Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bss.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/bss_CM.dat b/venv/Lib/site-packages/babel/locale-data/bss_CM.dat new file mode 100644 index 0000000000000000000000000000000000000000..c02e93f2565988df568734714b40e80f62c51a51 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/bss_CM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/byn.dat b/venv/Lib/site-packages/babel/locale-data/byn.dat new file mode 100644 index 0000000000000000000000000000000000000000..c8a14266747ab00c4c32785b99ac03f67eed9a0d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/byn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/byn_ER.dat b/venv/Lib/site-packages/babel/locale-data/byn_ER.dat new file mode 100644 index 0000000000000000000000000000000000000000..ef7364c07458ad5406840d32311f3a201a77f1c4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/byn_ER.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ca.dat b/venv/Lib/site-packages/babel/locale-data/ca.dat new file mode 100644 index 0000000000000000000000000000000000000000..fa9bfb82149fb0ec7e83068c743962e84b3a127b --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ca.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0884f4fbb5fbfdef1129646b84b4a61be6810b60f9d7e86f46b4d5fbb8816aff +size 184038 diff --git a/venv/Lib/site-packages/babel/locale-data/ca_AD.dat b/venv/Lib/site-packages/babel/locale-data/ca_AD.dat new file mode 100644 index 0000000000000000000000000000000000000000..417de47004156ba5b11b8718e1afd5d95b51c019 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ca_AD.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ca_ES.dat b/venv/Lib/site-packages/babel/locale-data/ca_ES.dat new file mode 100644 index 0000000000000000000000000000000000000000..1262e7c7d724c87b9362314220712ec79a0bd5ff Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ca_ES.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ca_ES_VALENCIA.dat b/venv/Lib/site-packages/babel/locale-data/ca_ES_VALENCIA.dat new file mode 100644 index 0000000000000000000000000000000000000000..f9a67d74a1fb482037eb21e32aa452e132336898 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ca_ES_VALENCIA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ca_FR.dat b/venv/Lib/site-packages/babel/locale-data/ca_FR.dat new file mode 100644 index 0000000000000000000000000000000000000000..1e13497d0fe23a430123235472ebbee4f6948f4b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ca_FR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ca_IT.dat b/venv/Lib/site-packages/babel/locale-data/ca_IT.dat new file mode 100644 index 0000000000000000000000000000000000000000..18daef701f3b6448432cb61f9461b63fa3ae53db Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ca_IT.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/cad.dat b/venv/Lib/site-packages/babel/locale-data/cad.dat new file mode 100644 index 0000000000000000000000000000000000000000..e0751fea1fcd9df8ff1c391d417ac61d9d5bdb7d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/cad.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/cad_US.dat b/venv/Lib/site-packages/babel/locale-data/cad_US.dat new file mode 100644 index 0000000000000000000000000000000000000000..649a127793f376de545e3baac652178fa50d0188 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/cad_US.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/cch.dat b/venv/Lib/site-packages/babel/locale-data/cch.dat new file mode 100644 index 0000000000000000000000000000000000000000..6bfb265eecc037ad895d16557ebdc6dfe70985fa Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/cch.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/cch_NG.dat b/venv/Lib/site-packages/babel/locale-data/cch_NG.dat new file mode 100644 index 0000000000000000000000000000000000000000..7ca50d067b03a79e5f09b3e254529eafd2b1f94c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/cch_NG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ccp.dat b/venv/Lib/site-packages/babel/locale-data/ccp.dat new file mode 100644 index 0000000000000000000000000000000000000000..a71077f86413b809dbcd42e792753f9757cf9a7a --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ccp.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:267fcee4cc0de83306c4dad752976b853ff3e59398877f929b9c8651c57c6c82 +size 207292 diff --git a/venv/Lib/site-packages/babel/locale-data/ccp_BD.dat b/venv/Lib/site-packages/babel/locale-data/ccp_BD.dat new file mode 100644 index 0000000000000000000000000000000000000000..23248d87cd09d86965ce11a59e320b55436df5a8 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ccp_BD.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ccp_IN.dat b/venv/Lib/site-packages/babel/locale-data/ccp_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..e4fe9a0158fa8d3f231435decb8b82572242be4a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ccp_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ce.dat b/venv/Lib/site-packages/babel/locale-data/ce.dat new file mode 100644 index 0000000000000000000000000000000000000000..93170ad26cc1762bbd1fc4ada829edcd370a2dbb --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ce.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:caea295b9402ab5bbc13546cd2110ebffcb5baf6de9bf3f794afbf02f539ccb1 +size 135403 diff --git a/venv/Lib/site-packages/babel/locale-data/ce_RU.dat b/venv/Lib/site-packages/babel/locale-data/ce_RU.dat new file mode 100644 index 0000000000000000000000000000000000000000..613de6603e5843e5f977382d38d1cf6d27f1dec4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ce_RU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ceb.dat b/venv/Lib/site-packages/babel/locale-data/ceb.dat new file mode 100644 index 0000000000000000000000000000000000000000..495b64fad289ad04187be5a81d40729e9c67a13b --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ceb.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f08093c057a4dfbf26af6545bef6929e2d469c32e1f4de10a44a41dd2069bc2 +size 100779 diff --git a/venv/Lib/site-packages/babel/locale-data/ceb_PH.dat b/venv/Lib/site-packages/babel/locale-data/ceb_PH.dat new file mode 100644 index 0000000000000000000000000000000000000000..f5a88a136feb6d7d36be2a8ada45b405dcad27b9 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ceb_PH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/cgg.dat b/venv/Lib/site-packages/babel/locale-data/cgg.dat new file mode 100644 index 0000000000000000000000000000000000000000..5687c38bbfc733145010a4883043f0e719b05c93 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/cgg.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/cgg_UG.dat b/venv/Lib/site-packages/babel/locale-data/cgg_UG.dat new file mode 100644 index 0000000000000000000000000000000000000000..3ed7de5ef69ca3b432e47520a8e1946353406b84 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/cgg_UG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/cho.dat b/venv/Lib/site-packages/babel/locale-data/cho.dat new file mode 100644 index 0000000000000000000000000000000000000000..8d978b7cba4761132fbeba76c87b2189060a1929 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/cho.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/cho_US.dat b/venv/Lib/site-packages/babel/locale-data/cho_US.dat new file mode 100644 index 0000000000000000000000000000000000000000..927cd4515824f27eb037dec05c1ce0af24dca32b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/cho_US.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/chr.dat b/venv/Lib/site-packages/babel/locale-data/chr.dat new file mode 100644 index 0000000000000000000000000000000000000000..1043620d357be227a2ef295a2b06f6f373543636 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/chr.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e1ae9e2635f5259fa29c293e27c80726ad50b682b716939784e9503036c78f03 +size 187187 diff --git a/venv/Lib/site-packages/babel/locale-data/chr_US.dat b/venv/Lib/site-packages/babel/locale-data/chr_US.dat new file mode 100644 index 0000000000000000000000000000000000000000..305798529f43ed96f33a3b104a94f99ca5f75cce Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/chr_US.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/cic.dat b/venv/Lib/site-packages/babel/locale-data/cic.dat new file mode 100644 index 0000000000000000000000000000000000000000..878775630166ddb6501c57b842ac5d79fe00af8d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/cic.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/cic_US.dat b/venv/Lib/site-packages/babel/locale-data/cic_US.dat new file mode 100644 index 0000000000000000000000000000000000000000..a2f944fbe0ea89a707ef029fe3b8366dfb0219e3 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/cic_US.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ckb.dat b/venv/Lib/site-packages/babel/locale-data/ckb.dat new file mode 100644 index 0000000000000000000000000000000000000000..e8f1be3eeba7bc5780d7d9bf8c20812d1ecb2b68 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ckb.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ckb_IQ.dat b/venv/Lib/site-packages/babel/locale-data/ckb_IQ.dat new file mode 100644 index 0000000000000000000000000000000000000000..68ae78b5dbf6c9465a3af59c0469d24714a744cb Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ckb_IQ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ckb_IR.dat b/venv/Lib/site-packages/babel/locale-data/ckb_IR.dat new file mode 100644 index 0000000000000000000000000000000000000000..407a60584b2205a47cf5fa81b61d783f84527483 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ckb_IR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/co.dat b/venv/Lib/site-packages/babel/locale-data/co.dat new file mode 100644 index 0000000000000000000000000000000000000000..cf9e7bc6c963fa86c62c7f8ccb79aeec7548d0b9 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/co.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/co_FR.dat b/venv/Lib/site-packages/babel/locale-data/co_FR.dat new file mode 100644 index 0000000000000000000000000000000000000000..ac968523e7a54203de695e43438a75e4b614c3cd Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/co_FR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/cs.dat b/venv/Lib/site-packages/babel/locale-data/cs.dat new file mode 100644 index 0000000000000000000000000000000000000000..9b308b66c23a557d25d4f8b41348adfdd5fc99c4 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/cs.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3baa786e22ac693c87c3fa8c952ecbe99a1b518883b380906831a66fcaf3cbe +size 247800 diff --git a/venv/Lib/site-packages/babel/locale-data/cs_CZ.dat b/venv/Lib/site-packages/babel/locale-data/cs_CZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..0c492c42e18da675aaa5203b4e32d59d217beb5b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/cs_CZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/csw.dat b/venv/Lib/site-packages/babel/locale-data/csw.dat new file mode 100644 index 0000000000000000000000000000000000000000..1224a99e3dc8b8de21ee301d59276fae3fe4c287 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/csw.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/csw_CA.dat b/venv/Lib/site-packages/babel/locale-data/csw_CA.dat new file mode 100644 index 0000000000000000000000000000000000000000..01b6c60756b59a78f543477d3d7bb72145b2b697 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/csw_CA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/cu.dat b/venv/Lib/site-packages/babel/locale-data/cu.dat new file mode 100644 index 0000000000000000000000000000000000000000..19443c5208eafbe03e03ef361cf37f956a7f2408 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/cu.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/cu_RU.dat b/venv/Lib/site-packages/babel/locale-data/cu_RU.dat new file mode 100644 index 0000000000000000000000000000000000000000..a9d3101e6a5e3d757ec6495d4269ca62c2cd6d56 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/cu_RU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/cv.dat b/venv/Lib/site-packages/babel/locale-data/cv.dat new file mode 100644 index 0000000000000000000000000000000000000000..128323acc51e6576ced1766770dc32817882097b --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/cv.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:054a92fb846f02ec9c3a5026fe4df7795f7c542a796c8526ad652a8e19acaa5b +size 198348 diff --git a/venv/Lib/site-packages/babel/locale-data/cv_RU.dat b/venv/Lib/site-packages/babel/locale-data/cv_RU.dat new file mode 100644 index 0000000000000000000000000000000000000000..597599149a3276f5baa0328533bf4582b1a43531 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/cv_RU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/cy.dat b/venv/Lib/site-packages/babel/locale-data/cy.dat new file mode 100644 index 0000000000000000000000000000000000000000..88828a62ae8131902758440eea07cc8b7e1d4401 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/cy.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9b374d16a9185d9c22fd55d9c682d52dc1b999ee7dabf7aa1974bbb148ff0a3 +size 276313 diff --git a/venv/Lib/site-packages/babel/locale-data/cy_GB.dat b/venv/Lib/site-packages/babel/locale-data/cy_GB.dat new file mode 100644 index 0000000000000000000000000000000000000000..f3febac60c7e0e4b45d60dd4eb76b064f235de5a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/cy_GB.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/da.dat b/venv/Lib/site-packages/babel/locale-data/da.dat new file mode 100644 index 0000000000000000000000000000000000000000..cd659eb34b3a928682a6fa63fbefe13bda6c7caa --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/da.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5545713658e2b9bbe3ddefcf86299e30b05566502dd464f66c07e7c98bbaef51 +size 171756 diff --git a/venv/Lib/site-packages/babel/locale-data/da_DK.dat b/venv/Lib/site-packages/babel/locale-data/da_DK.dat new file mode 100644 index 0000000000000000000000000000000000000000..dbd067201ec8a548a3f31db287a76c9c3cad0387 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/da_DK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/da_GL.dat b/venv/Lib/site-packages/babel/locale-data/da_GL.dat new file mode 100644 index 0000000000000000000000000000000000000000..ce46da126f18a4b27889ebd6b9ee23d319ce48ce Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/da_GL.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/dav.dat b/venv/Lib/site-packages/babel/locale-data/dav.dat new file mode 100644 index 0000000000000000000000000000000000000000..8b63c2b6a4084640a08178402f4071c4ebcdde38 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/dav.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/dav_KE.dat b/venv/Lib/site-packages/babel/locale-data/dav_KE.dat new file mode 100644 index 0000000000000000000000000000000000000000..5e3fbf481317029a5d82fd45fd66ac6623d79d76 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/dav_KE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/de.dat b/venv/Lib/site-packages/babel/locale-data/de.dat new file mode 100644 index 0000000000000000000000000000000000000000..a44a3a1a7a73b8054040612b3bc4163c464027fd --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/de.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:97a001560db35cf5fd5acf60dbe59ebded394b8ea28b48676ee095892ea6b660 +size 178630 diff --git a/venv/Lib/site-packages/babel/locale-data/de_AT.dat b/venv/Lib/site-packages/babel/locale-data/de_AT.dat new file mode 100644 index 0000000000000000000000000000000000000000..c8b9b62ec121d90118f82058f1fc1edb2088ee49 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/de_AT.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/de_BE.dat b/venv/Lib/site-packages/babel/locale-data/de_BE.dat new file mode 100644 index 0000000000000000000000000000000000000000..806b2914ead58754f1ba06ec402d50b3bfd65e46 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/de_BE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/de_CH.dat b/venv/Lib/site-packages/babel/locale-data/de_CH.dat new file mode 100644 index 0000000000000000000000000000000000000000..9f50b2e13a26babd951b1395c95fd13366f465cd Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/de_CH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/de_DE.dat b/venv/Lib/site-packages/babel/locale-data/de_DE.dat new file mode 100644 index 0000000000000000000000000000000000000000..1d769ac8d591a87b7c65df4edaf72dbd3f800e70 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/de_DE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/de_IT.dat b/venv/Lib/site-packages/babel/locale-data/de_IT.dat new file mode 100644 index 0000000000000000000000000000000000000000..7d7b9d2dd921610811c726dc538d1335124f2864 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/de_IT.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/de_LI.dat b/venv/Lib/site-packages/babel/locale-data/de_LI.dat new file mode 100644 index 0000000000000000000000000000000000000000..f4f1a3532a670b39bcb5f6a054a5e934274755d6 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/de_LI.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/de_LU.dat b/venv/Lib/site-packages/babel/locale-data/de_LU.dat new file mode 100644 index 0000000000000000000000000000000000000000..ed9d8fb75b6b931170255e538c3f6caa65f66ca7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/de_LU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/dje.dat b/venv/Lib/site-packages/babel/locale-data/dje.dat new file mode 100644 index 0000000000000000000000000000000000000000..aafbdbda66850b91ec373e577667d31fe7869193 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/dje.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/dje_NE.dat b/venv/Lib/site-packages/babel/locale-data/dje_NE.dat new file mode 100644 index 0000000000000000000000000000000000000000..605bb83a9ba2c56ad18f9ecd7efc7e0822c040f7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/dje_NE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/doi.dat b/venv/Lib/site-packages/babel/locale-data/doi.dat new file mode 100644 index 0000000000000000000000000000000000000000..44b79c8902fefeb75ba6f6fd7c15e682657c7683 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/doi.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/doi_IN.dat b/venv/Lib/site-packages/babel/locale-data/doi_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..550ec0ec0457922d661210f887914005f0e0ddb8 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/doi_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/dsb.dat b/venv/Lib/site-packages/babel/locale-data/dsb.dat new file mode 100644 index 0000000000000000000000000000000000000000..d73fbe14faaf63c7ecb5dc6176424c97d572b723 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/dsb.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2af671ca6299e596f143ee204bfbaf9cd92b60c627dc3f812b3d0c1809f9e3cf +size 203926 diff --git a/venv/Lib/site-packages/babel/locale-data/dsb_DE.dat b/venv/Lib/site-packages/babel/locale-data/dsb_DE.dat new file mode 100644 index 0000000000000000000000000000000000000000..f1a8d4bcb06d26f1f84e1d9807c7906bef760268 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/dsb_DE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/dua.dat b/venv/Lib/site-packages/babel/locale-data/dua.dat new file mode 100644 index 0000000000000000000000000000000000000000..24ee495364a4a0918c3ff8e2ca0eecf2867788d3 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/dua.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/dua_CM.dat b/venv/Lib/site-packages/babel/locale-data/dua_CM.dat new file mode 100644 index 0000000000000000000000000000000000000000..5eab8c9ba59f32f944dc187b29625b04b95b0e35 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/dua_CM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/dv.dat b/venv/Lib/site-packages/babel/locale-data/dv.dat new file mode 100644 index 0000000000000000000000000000000000000000..f8c88ff8cf092bdcb6aa7794af37357d099e6ccb Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/dv.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/dv_MV.dat b/venv/Lib/site-packages/babel/locale-data/dv_MV.dat new file mode 100644 index 0000000000000000000000000000000000000000..6a6048b5a3ed3723e5e3f7ca67527ada18e58606 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/dv_MV.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/dyo.dat b/venv/Lib/site-packages/babel/locale-data/dyo.dat new file mode 100644 index 0000000000000000000000000000000000000000..836d954de897f5f36ac88be32a7243d0a29c3f6a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/dyo.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/dyo_SN.dat b/venv/Lib/site-packages/babel/locale-data/dyo_SN.dat new file mode 100644 index 0000000000000000000000000000000000000000..734192ceaf4cecd8779443826bdf18cfed91ec35 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/dyo_SN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/dz.dat b/venv/Lib/site-packages/babel/locale-data/dz.dat new file mode 100644 index 0000000000000000000000000000000000000000..a75ae5bd7e9e4cc66f9939ccebcd78f8e012655a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/dz.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/dz_BT.dat b/venv/Lib/site-packages/babel/locale-data/dz_BT.dat new file mode 100644 index 0000000000000000000000000000000000000000..34b2803b5e4545d99dfd63f0aed4c8659839f095 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/dz_BT.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ebu.dat b/venv/Lib/site-packages/babel/locale-data/ebu.dat new file mode 100644 index 0000000000000000000000000000000000000000..d02c22a0f02f42ac856c1fe6d4ea2b39b8f16e80 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ebu.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ebu_KE.dat b/venv/Lib/site-packages/babel/locale-data/ebu_KE.dat new file mode 100644 index 0000000000000000000000000000000000000000..0abfe0e4da22334234110444f63a515f567aa2d2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ebu_KE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ee.dat b/venv/Lib/site-packages/babel/locale-data/ee.dat new file mode 100644 index 0000000000000000000000000000000000000000..9348aa2e7e455e76d108626d420540d75300cd23 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ee.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ee_GH.dat b/venv/Lib/site-packages/babel/locale-data/ee_GH.dat new file mode 100644 index 0000000000000000000000000000000000000000..3702d427cc6b32692f15a5ab5819e39a2cf7f012 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ee_GH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ee_TG.dat b/venv/Lib/site-packages/babel/locale-data/ee_TG.dat new file mode 100644 index 0000000000000000000000000000000000000000..5f19ac9f3f4294d86a6d4d93b0660a657f23ede7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ee_TG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/el.dat b/venv/Lib/site-packages/babel/locale-data/el.dat new file mode 100644 index 0000000000000000000000000000000000000000..0cf2e14b3d1f1d598fe99c25f7ba89a4b6c31c34 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/el.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4c3e4611bcadf2e0817ddd9fb5dbb645ffefcffd057eff8eb42e06401c2c3da +size 247970 diff --git a/venv/Lib/site-packages/babel/locale-data/el_CY.dat b/venv/Lib/site-packages/babel/locale-data/el_CY.dat new file mode 100644 index 0000000000000000000000000000000000000000..22fb87487fae149e6c4b31be5529ca5bdf60c668 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/el_CY.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/el_GR.dat b/venv/Lib/site-packages/babel/locale-data/el_GR.dat new file mode 100644 index 0000000000000000000000000000000000000000..ee095c9529bc7d62fbbcd4b6b1ce23819a1f5bf1 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/el_GR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/el_POLYTON.dat b/venv/Lib/site-packages/babel/locale-data/el_POLYTON.dat new file mode 100644 index 0000000000000000000000000000000000000000..24a37da57526c9ff9916d6b71196f47f6443d943 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/el_POLYTON.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en.dat b/venv/Lib/site-packages/babel/locale-data/en.dat new file mode 100644 index 0000000000000000000000000000000000000000..034ae451e5617d253c2ba13c818d5cd1d53675fb --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/en.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b410cb8298ca9def16da7145240f333ac6fce111659081b774b083ef5f941b0 +size 217633 diff --git a/venv/Lib/site-packages/babel/locale-data/en_001.dat b/venv/Lib/site-packages/babel/locale-data/en_001.dat new file mode 100644 index 0000000000000000000000000000000000000000..47db2cc6fb81649cfa9f8710e8aa49ea034277e2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_001.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_150.dat b/venv/Lib/site-packages/babel/locale-data/en_150.dat new file mode 100644 index 0000000000000000000000000000000000000000..82dd2718e23894cb77ffe49d96bda0d3f09d1801 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_150.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_AE.dat b/venv/Lib/site-packages/babel/locale-data/en_AE.dat new file mode 100644 index 0000000000000000000000000000000000000000..bd96c499deef99e03066d54f6f5ab123d5c1d944 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_AE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_AG.dat b/venv/Lib/site-packages/babel/locale-data/en_AG.dat new file mode 100644 index 0000000000000000000000000000000000000000..16d7fa5a38b5beb35a6d3efd257d78c5be413f22 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_AG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_AI.dat b/venv/Lib/site-packages/babel/locale-data/en_AI.dat new file mode 100644 index 0000000000000000000000000000000000000000..6f0437d67d7ec79c6fe75fe8ee72506e76cc11a4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_AI.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_AS.dat b/venv/Lib/site-packages/babel/locale-data/en_AS.dat new file mode 100644 index 0000000000000000000000000000000000000000..d309d36540d0661d729122270913c7e70edea85b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_AS.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_AT.dat b/venv/Lib/site-packages/babel/locale-data/en_AT.dat new file mode 100644 index 0000000000000000000000000000000000000000..ff190b61e4d1ad47b038c9e84a020f25b645a09c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_AT.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_AU.dat b/venv/Lib/site-packages/babel/locale-data/en_AU.dat new file mode 100644 index 0000000000000000000000000000000000000000..7c92a1a3be4c3e707c4ad16257d28eb22e6fe1ec Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_AU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_BB.dat b/venv/Lib/site-packages/babel/locale-data/en_BB.dat new file mode 100644 index 0000000000000000000000000000000000000000..fbcfdd8ab953f9dd65185c4d23f30c3b8204ed34 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_BB.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_BE.dat b/venv/Lib/site-packages/babel/locale-data/en_BE.dat new file mode 100644 index 0000000000000000000000000000000000000000..481689fe6436c1af4aa7c2c562024f7c998ec276 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_BE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_BI.dat b/venv/Lib/site-packages/babel/locale-data/en_BI.dat new file mode 100644 index 0000000000000000000000000000000000000000..e2ef90f8131aaff969726705505894d2e538c4c4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_BI.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_BM.dat b/venv/Lib/site-packages/babel/locale-data/en_BM.dat new file mode 100644 index 0000000000000000000000000000000000000000..f4e57b6aa16e16e6436a05d67f008bd222b59249 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_BM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_BS.dat b/venv/Lib/site-packages/babel/locale-data/en_BS.dat new file mode 100644 index 0000000000000000000000000000000000000000..aafa96f07e2bf07daac4764f055aec84096aeac0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_BS.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_BW.dat b/venv/Lib/site-packages/babel/locale-data/en_BW.dat new file mode 100644 index 0000000000000000000000000000000000000000..2d0839235c7ba719f7fe2a4d8a951a568e5aef21 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_BW.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_BZ.dat b/venv/Lib/site-packages/babel/locale-data/en_BZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..26326dcb0fa74d922819a3d4ad11582b8cba4101 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_BZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_CA.dat b/venv/Lib/site-packages/babel/locale-data/en_CA.dat new file mode 100644 index 0000000000000000000000000000000000000000..89cab7ceb9b2a004f5e474b51057f2ada1200726 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_CA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_CC.dat b/venv/Lib/site-packages/babel/locale-data/en_CC.dat new file mode 100644 index 0000000000000000000000000000000000000000..1102d2b56c51f37178ed95eaa85ef41be53f387b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_CC.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_CH.dat b/venv/Lib/site-packages/babel/locale-data/en_CH.dat new file mode 100644 index 0000000000000000000000000000000000000000..bce7db95ea53c3ed40db4254c9ac559f48f9053d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_CH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_CK.dat b/venv/Lib/site-packages/babel/locale-data/en_CK.dat new file mode 100644 index 0000000000000000000000000000000000000000..e4870c84e1b50772d42ff61199c2362dd1ddb408 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_CK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_CM.dat b/venv/Lib/site-packages/babel/locale-data/en_CM.dat new file mode 100644 index 0000000000000000000000000000000000000000..1816a83fd57a49a0fcb75febd7f93fe8417a6fb4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_CM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_CX.dat b/venv/Lib/site-packages/babel/locale-data/en_CX.dat new file mode 100644 index 0000000000000000000000000000000000000000..b0a5620b771df2f7465345132d65b446bc1fe35c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_CX.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_CY.dat b/venv/Lib/site-packages/babel/locale-data/en_CY.dat new file mode 100644 index 0000000000000000000000000000000000000000..54fb2d1a1851eda9a3a60906ca25ef3216232978 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_CY.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_DE.dat b/venv/Lib/site-packages/babel/locale-data/en_DE.dat new file mode 100644 index 0000000000000000000000000000000000000000..3d7ded02b4d790468211b311f6e47fcae44fda15 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_DE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_DG.dat b/venv/Lib/site-packages/babel/locale-data/en_DG.dat new file mode 100644 index 0000000000000000000000000000000000000000..1bdea430f221dc9e1539240ce61d63b67d38b3f1 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_DG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_DK.dat b/venv/Lib/site-packages/babel/locale-data/en_DK.dat new file mode 100644 index 0000000000000000000000000000000000000000..cae041ede5e19d7760dbe291d765f365eb8a8f27 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_DK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_DM.dat b/venv/Lib/site-packages/babel/locale-data/en_DM.dat new file mode 100644 index 0000000000000000000000000000000000000000..00ce5e14c96cc3347bc117a0724bce35f80e3fac Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_DM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_Dsrt.dat b/venv/Lib/site-packages/babel/locale-data/en_Dsrt.dat new file mode 100644 index 0000000000000000000000000000000000000000..114accc102c5299d6bbc7abea0eaddaa0fc3bdca Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_Dsrt.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_Dsrt_US.dat b/venv/Lib/site-packages/babel/locale-data/en_Dsrt_US.dat new file mode 100644 index 0000000000000000000000000000000000000000..663e826104ecc8a97881f609c67d6252a16571e1 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_Dsrt_US.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_ER.dat b/venv/Lib/site-packages/babel/locale-data/en_ER.dat new file mode 100644 index 0000000000000000000000000000000000000000..349173e3cdb28e713aff016c6f653dd84744e9a2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_ER.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_FI.dat b/venv/Lib/site-packages/babel/locale-data/en_FI.dat new file mode 100644 index 0000000000000000000000000000000000000000..90a35e72e7ef8cfeeb658ea90de750d3f0783320 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_FI.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_FJ.dat b/venv/Lib/site-packages/babel/locale-data/en_FJ.dat new file mode 100644 index 0000000000000000000000000000000000000000..e2013194004b40139158a5a1a96f885c5a13570a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_FJ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_FK.dat b/venv/Lib/site-packages/babel/locale-data/en_FK.dat new file mode 100644 index 0000000000000000000000000000000000000000..3b586dd821b508710e0cab96787d4b9d83203e23 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_FK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_FM.dat b/venv/Lib/site-packages/babel/locale-data/en_FM.dat new file mode 100644 index 0000000000000000000000000000000000000000..4a4d6ab9303abea778558bd2daee466ed6fd5ba8 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_FM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_GB.dat b/venv/Lib/site-packages/babel/locale-data/en_GB.dat new file mode 100644 index 0000000000000000000000000000000000000000..ce4687f538f32229593cf1e753f5352fa0086b57 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_GB.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_GD.dat b/venv/Lib/site-packages/babel/locale-data/en_GD.dat new file mode 100644 index 0000000000000000000000000000000000000000..fbd024b4537bd71f3de584a7f126f3153cc18ddc Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_GD.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_GG.dat b/venv/Lib/site-packages/babel/locale-data/en_GG.dat new file mode 100644 index 0000000000000000000000000000000000000000..6195e7d8d091c8206bc13bd57aadaf9316c91b4e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_GG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_GH.dat b/venv/Lib/site-packages/babel/locale-data/en_GH.dat new file mode 100644 index 0000000000000000000000000000000000000000..bfcd6f57f538396843569e5b82e897d853dace15 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_GH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_GI.dat b/venv/Lib/site-packages/babel/locale-data/en_GI.dat new file mode 100644 index 0000000000000000000000000000000000000000..98b852ea48e01f32455a8b99582e19727e785cca Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_GI.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_GM.dat b/venv/Lib/site-packages/babel/locale-data/en_GM.dat new file mode 100644 index 0000000000000000000000000000000000000000..4e7daad837905a81f9878e9b8d1624c1d10529b8 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_GM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_GU.dat b/venv/Lib/site-packages/babel/locale-data/en_GU.dat new file mode 100644 index 0000000000000000000000000000000000000000..6d184675e24410e1a32f9fcbdcdb83292118b5a3 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_GU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_GY.dat b/venv/Lib/site-packages/babel/locale-data/en_GY.dat new file mode 100644 index 0000000000000000000000000000000000000000..4192d41b0d917e6965ed72ca4ee45b13b5a35ff2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_GY.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_HK.dat b/venv/Lib/site-packages/babel/locale-data/en_HK.dat new file mode 100644 index 0000000000000000000000000000000000000000..39a6d7f6cdcfa980825850bc17f35ecf0d9c4a2e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_HK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_ID.dat b/venv/Lib/site-packages/babel/locale-data/en_ID.dat new file mode 100644 index 0000000000000000000000000000000000000000..763ffdf53f9c88c25c3575cae635e588d9c1e2e9 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_ID.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_IE.dat b/venv/Lib/site-packages/babel/locale-data/en_IE.dat new file mode 100644 index 0000000000000000000000000000000000000000..36b4ffb100d2b626617c42d9bdbc89d1dfdb2f50 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_IE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_IL.dat b/venv/Lib/site-packages/babel/locale-data/en_IL.dat new file mode 100644 index 0000000000000000000000000000000000000000..9782e31a39566912e1c0150083111d3854ca3498 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_IL.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_IM.dat b/venv/Lib/site-packages/babel/locale-data/en_IM.dat new file mode 100644 index 0000000000000000000000000000000000000000..a3789694fbe4ecd3251f4db70abbc18fa5fad27f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_IM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_IN.dat b/venv/Lib/site-packages/babel/locale-data/en_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..03987cb1312c3ed5185ad29dcfa9dad4cec57dd0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_IO.dat b/venv/Lib/site-packages/babel/locale-data/en_IO.dat new file mode 100644 index 0000000000000000000000000000000000000000..ce4dba27593013e01d291b0696afa4df36f87388 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_IO.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_JE.dat b/venv/Lib/site-packages/babel/locale-data/en_JE.dat new file mode 100644 index 0000000000000000000000000000000000000000..59fad12613c632f7880f692e4b8dc9bd8d6d08dc Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_JE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_JM.dat b/venv/Lib/site-packages/babel/locale-data/en_JM.dat new file mode 100644 index 0000000000000000000000000000000000000000..8bb03e32671a6273b7afb7fd046e3268516761a2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_JM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_KE.dat b/venv/Lib/site-packages/babel/locale-data/en_KE.dat new file mode 100644 index 0000000000000000000000000000000000000000..5c1816798fb700443c1d698d57482eb25820295b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_KE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_KI.dat b/venv/Lib/site-packages/babel/locale-data/en_KI.dat new file mode 100644 index 0000000000000000000000000000000000000000..2c57a1608b27c02b81d8fa0775f60d50561434e7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_KI.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_KN.dat b/venv/Lib/site-packages/babel/locale-data/en_KN.dat new file mode 100644 index 0000000000000000000000000000000000000000..79c9a818af720fe8ef02786600b6044a5c8586e0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_KN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_KY.dat b/venv/Lib/site-packages/babel/locale-data/en_KY.dat new file mode 100644 index 0000000000000000000000000000000000000000..013312f620a3d864de5399f01935f6cfb9ed926c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_KY.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_LC.dat b/venv/Lib/site-packages/babel/locale-data/en_LC.dat new file mode 100644 index 0000000000000000000000000000000000000000..0368fe364e09dfd3f2c9669d53da774ac0fbe784 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_LC.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_LR.dat b/venv/Lib/site-packages/babel/locale-data/en_LR.dat new file mode 100644 index 0000000000000000000000000000000000000000..80d77d8cdd795c1bb8bbe20f6d2943d7582e3b68 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_LR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_LS.dat b/venv/Lib/site-packages/babel/locale-data/en_LS.dat new file mode 100644 index 0000000000000000000000000000000000000000..b3cbbfb68399fc8a57ccbbff51d65d641c066c72 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_LS.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_MG.dat b/venv/Lib/site-packages/babel/locale-data/en_MG.dat new file mode 100644 index 0000000000000000000000000000000000000000..cf3db95a194620c3ed2ece07786a0f0ce599688c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_MG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_MH.dat b/venv/Lib/site-packages/babel/locale-data/en_MH.dat new file mode 100644 index 0000000000000000000000000000000000000000..f6bc501cd2a0544241b1cbba0515fce284882d51 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_MH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_MO.dat b/venv/Lib/site-packages/babel/locale-data/en_MO.dat new file mode 100644 index 0000000000000000000000000000000000000000..6635dc53a752d1d68b5612a87cf924775683437e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_MO.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_MP.dat b/venv/Lib/site-packages/babel/locale-data/en_MP.dat new file mode 100644 index 0000000000000000000000000000000000000000..ede9c2bb56f9bf6b7ba72124b8a681fc927b9366 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_MP.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_MS.dat b/venv/Lib/site-packages/babel/locale-data/en_MS.dat new file mode 100644 index 0000000000000000000000000000000000000000..53115eb587b55dabf816ba04b092bb6223ee0ae5 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_MS.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_MT.dat b/venv/Lib/site-packages/babel/locale-data/en_MT.dat new file mode 100644 index 0000000000000000000000000000000000000000..87c2b9534567d1e49f90c1e8f1616bca016722a4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_MT.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_MU.dat b/venv/Lib/site-packages/babel/locale-data/en_MU.dat new file mode 100644 index 0000000000000000000000000000000000000000..524b3ac9758baeb765e3e4f07e2bea5d6279dbe9 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_MU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_MV.dat b/venv/Lib/site-packages/babel/locale-data/en_MV.dat new file mode 100644 index 0000000000000000000000000000000000000000..852a33d9085dd2cd53a0d3fa6221fc02cc79ba49 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_MV.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_MW.dat b/venv/Lib/site-packages/babel/locale-data/en_MW.dat new file mode 100644 index 0000000000000000000000000000000000000000..d0dcd6a9df98ad43ba08bb69f3ed4020c749761d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_MW.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_MY.dat b/venv/Lib/site-packages/babel/locale-data/en_MY.dat new file mode 100644 index 0000000000000000000000000000000000000000..9479385f2fe2f4d4fed2ece47a85c7efc782866d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_MY.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_NA.dat b/venv/Lib/site-packages/babel/locale-data/en_NA.dat new file mode 100644 index 0000000000000000000000000000000000000000..a3d882937c2e1fa20e3e3693f09a884e508bbad7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_NA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_NF.dat b/venv/Lib/site-packages/babel/locale-data/en_NF.dat new file mode 100644 index 0000000000000000000000000000000000000000..8003f609bff5f5eb56a55f0177251d46b50dff4e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_NF.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_NG.dat b/venv/Lib/site-packages/babel/locale-data/en_NG.dat new file mode 100644 index 0000000000000000000000000000000000000000..27bae0751159668e12eac70160b9a7c5ec38ea4a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_NG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_NL.dat b/venv/Lib/site-packages/babel/locale-data/en_NL.dat new file mode 100644 index 0000000000000000000000000000000000000000..8cd5773590de2525e061113f140ccf697aaa155d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_NL.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_NR.dat b/venv/Lib/site-packages/babel/locale-data/en_NR.dat new file mode 100644 index 0000000000000000000000000000000000000000..0c788a8d80638fc3b327a2f0e122f96db72b69aa Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_NR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_NU.dat b/venv/Lib/site-packages/babel/locale-data/en_NU.dat new file mode 100644 index 0000000000000000000000000000000000000000..f8607f6428184aa39166343b7d64e583b8219c40 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_NU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_NZ.dat b/venv/Lib/site-packages/babel/locale-data/en_NZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..7220c4cc4431518836137a4a9a15b890580cdb67 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_NZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_PG.dat b/venv/Lib/site-packages/babel/locale-data/en_PG.dat new file mode 100644 index 0000000000000000000000000000000000000000..4269e33194098e7f9ee4b1dc60b31ff5f0664bf3 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_PG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_PH.dat b/venv/Lib/site-packages/babel/locale-data/en_PH.dat new file mode 100644 index 0000000000000000000000000000000000000000..9ce4fc0bb19147c0d570655e1a85d981b8bec9f5 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_PH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_PK.dat b/venv/Lib/site-packages/babel/locale-data/en_PK.dat new file mode 100644 index 0000000000000000000000000000000000000000..f198d9ec84fe5a0eb30297b416f6081ab7f1f616 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_PK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_PN.dat b/venv/Lib/site-packages/babel/locale-data/en_PN.dat new file mode 100644 index 0000000000000000000000000000000000000000..9977c74309031cd98369de5b68afaf17a184d66d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_PN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_PR.dat b/venv/Lib/site-packages/babel/locale-data/en_PR.dat new file mode 100644 index 0000000000000000000000000000000000000000..cdb83dbe4cac37cf7d15bb7d4bc0485d78eed8d5 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_PR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_PW.dat b/venv/Lib/site-packages/babel/locale-data/en_PW.dat new file mode 100644 index 0000000000000000000000000000000000000000..e878083ff57f99b161eca4953964ba441a63fee6 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_PW.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_RW.dat b/venv/Lib/site-packages/babel/locale-data/en_RW.dat new file mode 100644 index 0000000000000000000000000000000000000000..c46733b0acc7026c3cfa022e44e691dfafd7f2c7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_RW.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_SB.dat b/venv/Lib/site-packages/babel/locale-data/en_SB.dat new file mode 100644 index 0000000000000000000000000000000000000000..b81625e3592103a60d60cb9f41c6ac55467f6506 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_SB.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_SC.dat b/venv/Lib/site-packages/babel/locale-data/en_SC.dat new file mode 100644 index 0000000000000000000000000000000000000000..4816bb86a2a977854c91682a6b4bb757379d2329 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_SC.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_SD.dat b/venv/Lib/site-packages/babel/locale-data/en_SD.dat new file mode 100644 index 0000000000000000000000000000000000000000..985e3e6bf7136b2099a86deb5bee2b446aade0d7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_SD.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_SE.dat b/venv/Lib/site-packages/babel/locale-data/en_SE.dat new file mode 100644 index 0000000000000000000000000000000000000000..5f89bad51c52815e9f2e0b672caf7e80026a55ee Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_SE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_SG.dat b/venv/Lib/site-packages/babel/locale-data/en_SG.dat new file mode 100644 index 0000000000000000000000000000000000000000..a21a72a738972db8185809a52649d28c7afe2ed3 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_SG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_SH.dat b/venv/Lib/site-packages/babel/locale-data/en_SH.dat new file mode 100644 index 0000000000000000000000000000000000000000..006487c34e75a82b6f94715e7749091e3df3190c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_SH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_SI.dat b/venv/Lib/site-packages/babel/locale-data/en_SI.dat new file mode 100644 index 0000000000000000000000000000000000000000..97b42d040f3f4d161bfa656b150d2685afe5efc8 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_SI.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_SL.dat b/venv/Lib/site-packages/babel/locale-data/en_SL.dat new file mode 100644 index 0000000000000000000000000000000000000000..127d12856862980443fbba9d61f99cf293830b9d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_SL.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_SS.dat b/venv/Lib/site-packages/babel/locale-data/en_SS.dat new file mode 100644 index 0000000000000000000000000000000000000000..7192fd1381be6737d434c4497767d78a9bb40d28 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_SS.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_SX.dat b/venv/Lib/site-packages/babel/locale-data/en_SX.dat new file mode 100644 index 0000000000000000000000000000000000000000..5dfff7d8f73ea8e30513b828a94c7d248c806599 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_SX.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_SZ.dat b/venv/Lib/site-packages/babel/locale-data/en_SZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..90a9f7a141f31376ec8be449f7ec1e1087e25e3f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_SZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_Shaw.dat b/venv/Lib/site-packages/babel/locale-data/en_Shaw.dat new file mode 100644 index 0000000000000000000000000000000000000000..6c3943651ea1feebdf53448ec47c31465efd9bb0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_Shaw.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_Shaw_GB.dat b/venv/Lib/site-packages/babel/locale-data/en_Shaw_GB.dat new file mode 100644 index 0000000000000000000000000000000000000000..214e5c6137efd3fced4ff24b8bd62d2ca664827b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_Shaw_GB.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_TC.dat b/venv/Lib/site-packages/babel/locale-data/en_TC.dat new file mode 100644 index 0000000000000000000000000000000000000000..d1edd041e8f5ee12a8ae6ee304e7165489c81bb9 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_TC.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_TK.dat b/venv/Lib/site-packages/babel/locale-data/en_TK.dat new file mode 100644 index 0000000000000000000000000000000000000000..d81803f7a772c0955f1fbca76453a06c8f1b4cc0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_TK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_TO.dat b/venv/Lib/site-packages/babel/locale-data/en_TO.dat new file mode 100644 index 0000000000000000000000000000000000000000..4512ee44500ad362a72bb00a4b532bbaf968a08b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_TO.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_TT.dat b/venv/Lib/site-packages/babel/locale-data/en_TT.dat new file mode 100644 index 0000000000000000000000000000000000000000..e704f06510c723fd3fb0ccde9d9c6ad9b3419576 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_TT.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_TV.dat b/venv/Lib/site-packages/babel/locale-data/en_TV.dat new file mode 100644 index 0000000000000000000000000000000000000000..c936c695b2adfccb9a96207f35f3e91064a95a6a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_TV.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_TZ.dat b/venv/Lib/site-packages/babel/locale-data/en_TZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..62091cee800eeaad52b62429d0f3767b03599a3b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_TZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_UG.dat b/venv/Lib/site-packages/babel/locale-data/en_UG.dat new file mode 100644 index 0000000000000000000000000000000000000000..dd077ccae2a4caf99f897716847a58eb0824af4e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_UG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_UM.dat b/venv/Lib/site-packages/babel/locale-data/en_UM.dat new file mode 100644 index 0000000000000000000000000000000000000000..3a027b2abb9f594ede329e3b62386b48f81dc051 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_UM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_US.dat b/venv/Lib/site-packages/babel/locale-data/en_US.dat new file mode 100644 index 0000000000000000000000000000000000000000..663e826104ecc8a97881f609c67d6252a16571e1 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_US.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_US_POSIX.dat b/venv/Lib/site-packages/babel/locale-data/en_US_POSIX.dat new file mode 100644 index 0000000000000000000000000000000000000000..a9ecf5b42c8bd13fa9b77602345b572d986f6638 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_US_POSIX.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_VC.dat b/venv/Lib/site-packages/babel/locale-data/en_VC.dat new file mode 100644 index 0000000000000000000000000000000000000000..86fb17d94b29c6cd96c647a96980289fd23aca98 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_VC.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_VG.dat b/venv/Lib/site-packages/babel/locale-data/en_VG.dat new file mode 100644 index 0000000000000000000000000000000000000000..3fdd46cb82d3da3c010d85d432dcbf33c7f456ed Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_VG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_VI.dat b/venv/Lib/site-packages/babel/locale-data/en_VI.dat new file mode 100644 index 0000000000000000000000000000000000000000..c4520cc6b71c5f9d24518783a351ef11f733cd78 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_VI.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_VU.dat b/venv/Lib/site-packages/babel/locale-data/en_VU.dat new file mode 100644 index 0000000000000000000000000000000000000000..12647a8c58931da9c3397452873ee02095dc6ae2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_VU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_WS.dat b/venv/Lib/site-packages/babel/locale-data/en_WS.dat new file mode 100644 index 0000000000000000000000000000000000000000..8531d31161e217bf8891080f93c7d84cde7550e6 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_WS.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_ZA.dat b/venv/Lib/site-packages/babel/locale-data/en_ZA.dat new file mode 100644 index 0000000000000000000000000000000000000000..8cc6b0e0d898770a4677600340f3b18a596f1465 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_ZA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_ZM.dat b/venv/Lib/site-packages/babel/locale-data/en_ZM.dat new file mode 100644 index 0000000000000000000000000000000000000000..50039250f1fb7e78e7b0fca92ee1112ff548700d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_ZM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/en_ZW.dat b/venv/Lib/site-packages/babel/locale-data/en_ZW.dat new file mode 100644 index 0000000000000000000000000000000000000000..6a8835f2b40fc2cec658f3a6a56cf63036c912f8 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/en_ZW.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/eo.dat b/venv/Lib/site-packages/babel/locale-data/eo.dat new file mode 100644 index 0000000000000000000000000000000000000000..d9971b9d9a5df28d0d19e79c05269bb56c674c08 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/eo.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91221bb82ad3245d19b8d57c17387285e253df788ac2d7881cb69881d7cf3b82 +size 101326 diff --git a/venv/Lib/site-packages/babel/locale-data/eo_001.dat b/venv/Lib/site-packages/babel/locale-data/eo_001.dat new file mode 100644 index 0000000000000000000000000000000000000000..ec48fb1ff1139ec14af7543228c4fc5dc860e34e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/eo_001.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es.dat b/venv/Lib/site-packages/babel/locale-data/es.dat new file mode 100644 index 0000000000000000000000000000000000000000..f849bc3f39f97bab5746d9060593a17de8831062 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/es.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73adab316deb1d3eed68549328fb7c8dee748ed15ec78b0bf27bee55ecbddb6e +size 191377 diff --git a/venv/Lib/site-packages/babel/locale-data/es_419.dat b/venv/Lib/site-packages/babel/locale-data/es_419.dat new file mode 100644 index 0000000000000000000000000000000000000000..38c8aa5bc1aa175b5796b49cd9f4ba99c9e5250d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_419.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_AR.dat b/venv/Lib/site-packages/babel/locale-data/es_AR.dat new file mode 100644 index 0000000000000000000000000000000000000000..42787bdf6562ee6315f6eb62f16eccc0717873cf Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_AR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_BO.dat b/venv/Lib/site-packages/babel/locale-data/es_BO.dat new file mode 100644 index 0000000000000000000000000000000000000000..df6a12996c7a121efde9261986e458544bd98be2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_BO.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_BR.dat b/venv/Lib/site-packages/babel/locale-data/es_BR.dat new file mode 100644 index 0000000000000000000000000000000000000000..7d1f1023bcb8bacd5d488ed9273563d5c5ba65e2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_BR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_BZ.dat b/venv/Lib/site-packages/babel/locale-data/es_BZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..ff0ff6ab382bfc45582347709e661e83dfb3f33f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_BZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_CL.dat b/venv/Lib/site-packages/babel/locale-data/es_CL.dat new file mode 100644 index 0000000000000000000000000000000000000000..87cd6243d21461ca2440bdca8cada0462185356b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_CL.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_CO.dat b/venv/Lib/site-packages/babel/locale-data/es_CO.dat new file mode 100644 index 0000000000000000000000000000000000000000..09e03e3ae12ca25faa4f1ebb163438f55893835c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_CO.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_CR.dat b/venv/Lib/site-packages/babel/locale-data/es_CR.dat new file mode 100644 index 0000000000000000000000000000000000000000..041296d123d15539cc14aaac64a7d2b7ef520e5a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_CR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_CU.dat b/venv/Lib/site-packages/babel/locale-data/es_CU.dat new file mode 100644 index 0000000000000000000000000000000000000000..ced5b381989bb9f2d8b02e75a0f1834c413a0965 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_CU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_DO.dat b/venv/Lib/site-packages/babel/locale-data/es_DO.dat new file mode 100644 index 0000000000000000000000000000000000000000..cbec78124624e99df1830c819d0e59c593265d44 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_DO.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_EA.dat b/venv/Lib/site-packages/babel/locale-data/es_EA.dat new file mode 100644 index 0000000000000000000000000000000000000000..dfd0d910a1e39e1e8454e5e573b2220d965792bb Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_EA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_EC.dat b/venv/Lib/site-packages/babel/locale-data/es_EC.dat new file mode 100644 index 0000000000000000000000000000000000000000..0c6f37b64419387b40742f74f520eabb3f4ef7dd Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_EC.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_ES.dat b/venv/Lib/site-packages/babel/locale-data/es_ES.dat new file mode 100644 index 0000000000000000000000000000000000000000..3414dff28c5786a2e6e7ee87428b85971d28a523 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_ES.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_GQ.dat b/venv/Lib/site-packages/babel/locale-data/es_GQ.dat new file mode 100644 index 0000000000000000000000000000000000000000..775e43b08bb32132dd04bd858bc4e07945963372 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_GQ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_GT.dat b/venv/Lib/site-packages/babel/locale-data/es_GT.dat new file mode 100644 index 0000000000000000000000000000000000000000..bedab31cecca46029a546e76deffd53cca5fa5b7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_GT.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_HN.dat b/venv/Lib/site-packages/babel/locale-data/es_HN.dat new file mode 100644 index 0000000000000000000000000000000000000000..c5223aae2dbc33e55c6fc82426b0238616d4473a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_HN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_IC.dat b/venv/Lib/site-packages/babel/locale-data/es_IC.dat new file mode 100644 index 0000000000000000000000000000000000000000..3a9f9fd9fad2c3fdba7cd1d0a2ed5b4a23750ae0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_IC.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_MX.dat b/venv/Lib/site-packages/babel/locale-data/es_MX.dat new file mode 100644 index 0000000000000000000000000000000000000000..91919c1527a43853307b4943a6f5c9d557b8f300 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_MX.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_NI.dat b/venv/Lib/site-packages/babel/locale-data/es_NI.dat new file mode 100644 index 0000000000000000000000000000000000000000..9e1ab78f716eac44005064ddd322e3b861d143f4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_NI.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_PA.dat b/venv/Lib/site-packages/babel/locale-data/es_PA.dat new file mode 100644 index 0000000000000000000000000000000000000000..edfcd54555b888837baaf75af5d83f31621b0fb8 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_PA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_PE.dat b/venv/Lib/site-packages/babel/locale-data/es_PE.dat new file mode 100644 index 0000000000000000000000000000000000000000..82c50ad2333cdd2d13ef55d93ca5d0cf5e0ecc61 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_PE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_PH.dat b/venv/Lib/site-packages/babel/locale-data/es_PH.dat new file mode 100644 index 0000000000000000000000000000000000000000..91e24f13ce2ca664d08f079a5de4b308f4103483 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_PH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_PR.dat b/venv/Lib/site-packages/babel/locale-data/es_PR.dat new file mode 100644 index 0000000000000000000000000000000000000000..c45d5911b1e55cc88408dc0eff1c10d90a7dd88e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_PR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_PY.dat b/venv/Lib/site-packages/babel/locale-data/es_PY.dat new file mode 100644 index 0000000000000000000000000000000000000000..3f36570558ca4e03cf8580929251d0fedde9deb0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_PY.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_SV.dat b/venv/Lib/site-packages/babel/locale-data/es_SV.dat new file mode 100644 index 0000000000000000000000000000000000000000..2c98032c1548d4d79fa42ec643090223d3736bdb Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_SV.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_US.dat b/venv/Lib/site-packages/babel/locale-data/es_US.dat new file mode 100644 index 0000000000000000000000000000000000000000..033881179dda0a8e2a8722977c93ca5bb760bf84 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_US.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_UY.dat b/venv/Lib/site-packages/babel/locale-data/es_UY.dat new file mode 100644 index 0000000000000000000000000000000000000000..292fa0cc48ece7e98bbaef84a73ddf15c0eba9a7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_UY.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/es_VE.dat b/venv/Lib/site-packages/babel/locale-data/es_VE.dat new file mode 100644 index 0000000000000000000000000000000000000000..42cba455f32d39a3bb44bb8ee76710377549185f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/es_VE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/et.dat b/venv/Lib/site-packages/babel/locale-data/et.dat new file mode 100644 index 0000000000000000000000000000000000000000..7441f7d48e13f3e41fe1e6c0bab1fb4918157f5c --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/et.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:793aba9c6d37f70296f35be716dc7eab3696568d308947b2d98d995102e5e3d9 +size 175652 diff --git a/venv/Lib/site-packages/babel/locale-data/et_EE.dat b/venv/Lib/site-packages/babel/locale-data/et_EE.dat new file mode 100644 index 0000000000000000000000000000000000000000..a08c682412ed948cf6b0d35c66bd5c5a98513c4a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/et_EE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/eu.dat b/venv/Lib/site-packages/babel/locale-data/eu.dat new file mode 100644 index 0000000000000000000000000000000000000000..e9d70a6168c5f92b72301314530e812f6eca8b0e --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/eu.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:944403e27ce783afc59aef3342d92bbe815657902f51a0a939a025bfbbe49ede +size 178023 diff --git a/venv/Lib/site-packages/babel/locale-data/eu_ES.dat b/venv/Lib/site-packages/babel/locale-data/eu_ES.dat new file mode 100644 index 0000000000000000000000000000000000000000..62f7cc611d3b358f1c078c49d0c68ceb3efb1331 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/eu_ES.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ewo.dat b/venv/Lib/site-packages/babel/locale-data/ewo.dat new file mode 100644 index 0000000000000000000000000000000000000000..5f7d570b939f7d6a95fc45e60dc44634fad7c76e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ewo.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ewo_CM.dat b/venv/Lib/site-packages/babel/locale-data/ewo_CM.dat new file mode 100644 index 0000000000000000000000000000000000000000..ae6b0f7ae364ed12b5d684649becc7b5d6514353 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ewo_CM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fa.dat b/venv/Lib/site-packages/babel/locale-data/fa.dat new file mode 100644 index 0000000000000000000000000000000000000000..427d10fa91719657949890520c498ac9a94188ab --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/fa.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:722fc5f797648b7c135e1975d32a993fb22898383514720e02bc6a4c43141329 +size 192269 diff --git a/venv/Lib/site-packages/babel/locale-data/fa_AF.dat b/venv/Lib/site-packages/babel/locale-data/fa_AF.dat new file mode 100644 index 0000000000000000000000000000000000000000..689b4c7840362c71773a77afc7e93625d572874d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fa_AF.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fa_IR.dat b/venv/Lib/site-packages/babel/locale-data/fa_IR.dat new file mode 100644 index 0000000000000000000000000000000000000000..b3dd8eb5d694cc4c3bd4657e3180b9b17bde6ab7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fa_IR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff.dat b/venv/Lib/site-packages/babel/locale-data/ff.dat new file mode 100644 index 0000000000000000000000000000000000000000..531fffa908c6769edd28b908e328fd1e5f2066b3 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Adlm.dat b/venv/Lib/site-packages/babel/locale-data/ff_Adlm.dat new file mode 100644 index 0000000000000000000000000000000000000000..0dd0f6e92575843de681215021343458c66a6cb9 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ff_Adlm.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:19bc18c9505b03c48024ffb5058316e1bdc75e2be08bc1ef443cc868ab89b6f8 +size 326252 diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Adlm_BF.dat b/venv/Lib/site-packages/babel/locale-data/ff_Adlm_BF.dat new file mode 100644 index 0000000000000000000000000000000000000000..84f0ffbd7e845e79af1695b1f236b612536ea607 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Adlm_BF.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Adlm_CM.dat b/venv/Lib/site-packages/babel/locale-data/ff_Adlm_CM.dat new file mode 100644 index 0000000000000000000000000000000000000000..78bf620829fcd019e61788bbcf138bbf0577a463 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Adlm_CM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Adlm_GH.dat b/venv/Lib/site-packages/babel/locale-data/ff_Adlm_GH.dat new file mode 100644 index 0000000000000000000000000000000000000000..6667263b5317ac54c6cafb42fe5465b0e8647cfa Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Adlm_GH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Adlm_GM.dat b/venv/Lib/site-packages/babel/locale-data/ff_Adlm_GM.dat new file mode 100644 index 0000000000000000000000000000000000000000..e641b279ac6aa6ec7d1f2819c16da35a391d3c17 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Adlm_GM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Adlm_GN.dat b/venv/Lib/site-packages/babel/locale-data/ff_Adlm_GN.dat new file mode 100644 index 0000000000000000000000000000000000000000..216df0ba8947c9c39ff6c50188cbb0cac01701bb Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Adlm_GN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Adlm_GW.dat b/venv/Lib/site-packages/babel/locale-data/ff_Adlm_GW.dat new file mode 100644 index 0000000000000000000000000000000000000000..63799caa1f251c8d2751071abaad62fa95c8055c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Adlm_GW.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Adlm_LR.dat b/venv/Lib/site-packages/babel/locale-data/ff_Adlm_LR.dat new file mode 100644 index 0000000000000000000000000000000000000000..f5e3cdebcf72c426e5e7c1a4094799955df62c6e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Adlm_LR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Adlm_MR.dat b/venv/Lib/site-packages/babel/locale-data/ff_Adlm_MR.dat new file mode 100644 index 0000000000000000000000000000000000000000..716f23fd9e8681c57ff5ed3423a1984e5366aefb Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Adlm_MR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Adlm_NE.dat b/venv/Lib/site-packages/babel/locale-data/ff_Adlm_NE.dat new file mode 100644 index 0000000000000000000000000000000000000000..12098834f16aad851f2730742ed71fe60741867d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Adlm_NE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Adlm_NG.dat b/venv/Lib/site-packages/babel/locale-data/ff_Adlm_NG.dat new file mode 100644 index 0000000000000000000000000000000000000000..a17d85c57ae003b64b27da1698e55b537897c284 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Adlm_NG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Adlm_SL.dat b/venv/Lib/site-packages/babel/locale-data/ff_Adlm_SL.dat new file mode 100644 index 0000000000000000000000000000000000000000..d8825521b855bb5274a2d61d1ad1a3d4d15cba8d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Adlm_SL.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Adlm_SN.dat b/venv/Lib/site-packages/babel/locale-data/ff_Adlm_SN.dat new file mode 100644 index 0000000000000000000000000000000000000000..125d99943cd9b850cfdfc171ace042fa61f69126 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Adlm_SN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Latn.dat b/venv/Lib/site-packages/babel/locale-data/ff_Latn.dat new file mode 100644 index 0000000000000000000000000000000000000000..df806dd47c3ad31254b1a43a9c21937667928f5e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Latn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Latn_BF.dat b/venv/Lib/site-packages/babel/locale-data/ff_Latn_BF.dat new file mode 100644 index 0000000000000000000000000000000000000000..bb3a2e0e48294214fcb4d19da441977cd4cc9c3e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Latn_BF.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Latn_CM.dat b/venv/Lib/site-packages/babel/locale-data/ff_Latn_CM.dat new file mode 100644 index 0000000000000000000000000000000000000000..a3229cdcab58ea5c07e67befbcc0562eaae4f42e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Latn_CM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Latn_GH.dat b/venv/Lib/site-packages/babel/locale-data/ff_Latn_GH.dat new file mode 100644 index 0000000000000000000000000000000000000000..58222300eb512e550f70ab56959fcfe5b82001ec Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Latn_GH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Latn_GM.dat b/venv/Lib/site-packages/babel/locale-data/ff_Latn_GM.dat new file mode 100644 index 0000000000000000000000000000000000000000..82022dfa7330c78ee90418a52cf4a37f6032ec48 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Latn_GM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Latn_GN.dat b/venv/Lib/site-packages/babel/locale-data/ff_Latn_GN.dat new file mode 100644 index 0000000000000000000000000000000000000000..1a99d48f0d12e50ca976a8f8717fdc9d5bb0406e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Latn_GN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Latn_GW.dat b/venv/Lib/site-packages/babel/locale-data/ff_Latn_GW.dat new file mode 100644 index 0000000000000000000000000000000000000000..a2b55bf7bd2cbd3e7ae4edfb3a16a4bac74ad4c8 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Latn_GW.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Latn_LR.dat b/venv/Lib/site-packages/babel/locale-data/ff_Latn_LR.dat new file mode 100644 index 0000000000000000000000000000000000000000..5dce447e7e27c1d6d614767ab460c02335cc840b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Latn_LR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Latn_MR.dat b/venv/Lib/site-packages/babel/locale-data/ff_Latn_MR.dat new file mode 100644 index 0000000000000000000000000000000000000000..e6178b867edf6925bbb35d19e323136d4cf6c830 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Latn_MR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Latn_NE.dat b/venv/Lib/site-packages/babel/locale-data/ff_Latn_NE.dat new file mode 100644 index 0000000000000000000000000000000000000000..82151e8f9f0d5641934229b32b53c19beb0d11c3 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Latn_NE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Latn_NG.dat b/venv/Lib/site-packages/babel/locale-data/ff_Latn_NG.dat new file mode 100644 index 0000000000000000000000000000000000000000..086889e64c39e90e63be03021450a012bb001e5c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Latn_NG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Latn_SL.dat b/venv/Lib/site-packages/babel/locale-data/ff_Latn_SL.dat new file mode 100644 index 0000000000000000000000000000000000000000..e50753de46b4d384c7bfcf4b57b55cd8e9bc6f20 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Latn_SL.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ff_Latn_SN.dat b/venv/Lib/site-packages/babel/locale-data/ff_Latn_SN.dat new file mode 100644 index 0000000000000000000000000000000000000000..faeff87cc7ef16dd2fddd101cb0b7ce4fa29edbd Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ff_Latn_SN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fi.dat b/venv/Lib/site-packages/babel/locale-data/fi.dat new file mode 100644 index 0000000000000000000000000000000000000000..68c88012ddf02f860cabe2b4561aea56d5942567 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/fi.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:55dfb3e911f5d7670fd24e4018e940a185355347f99a94109221f2a41f38e09c +size 204853 diff --git a/venv/Lib/site-packages/babel/locale-data/fi_FI.dat b/venv/Lib/site-packages/babel/locale-data/fi_FI.dat new file mode 100644 index 0000000000000000000000000000000000000000..fa20daec45d61d87841d13ae5f150ad0668c84e9 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fi_FI.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fil.dat b/venv/Lib/site-packages/babel/locale-data/fil.dat new file mode 100644 index 0000000000000000000000000000000000000000..b7cb20f673224c1386a9e486242558c9afc392f3 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/fil.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:83420d4c25e9a438234c68011f2f61a90f0c730ec6f4add72d32f256c856bae0 +size 144724 diff --git a/venv/Lib/site-packages/babel/locale-data/fil_PH.dat b/venv/Lib/site-packages/babel/locale-data/fil_PH.dat new file mode 100644 index 0000000000000000000000000000000000000000..dc08338cb8bd6cb1a8fa3905f27daaf89bf9c000 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fil_PH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fo.dat b/venv/Lib/site-packages/babel/locale-data/fo.dat new file mode 100644 index 0000000000000000000000000000000000000000..8e5d5d016e6213b22fed38c2f683c6610d349df3 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/fo.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e0fec74316c1eee85853202dd6b1480f59875d47bdce5401bd60adf0b0d184d3 +size 148411 diff --git a/venv/Lib/site-packages/babel/locale-data/fo_DK.dat b/venv/Lib/site-packages/babel/locale-data/fo_DK.dat new file mode 100644 index 0000000000000000000000000000000000000000..669088d75173dd1690c69e453d8960c25a4b5a93 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fo_DK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fo_FO.dat b/venv/Lib/site-packages/babel/locale-data/fo_FO.dat new file mode 100644 index 0000000000000000000000000000000000000000..7d8a81451b92357cbbfe4e5f6656d4aac0f31dd9 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fo_FO.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr.dat b/venv/Lib/site-packages/babel/locale-data/fr.dat new file mode 100644 index 0000000000000000000000000000000000000000..ead12597a644388c91492ce147648da64c47173f --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/fr.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ef3c24777edfbf57152926c569d70294f1a889ede08a644cfd5d95653398de9 +size 213357 diff --git a/venv/Lib/site-packages/babel/locale-data/fr_BE.dat b/venv/Lib/site-packages/babel/locale-data/fr_BE.dat new file mode 100644 index 0000000000000000000000000000000000000000..cc842fe06bf69365af497805eeca37366d4a3189 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_BE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_BF.dat b/venv/Lib/site-packages/babel/locale-data/fr_BF.dat new file mode 100644 index 0000000000000000000000000000000000000000..ba1ecc57a7dc4f1128a17407182f7a4faa3e6cf3 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_BF.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_BI.dat b/venv/Lib/site-packages/babel/locale-data/fr_BI.dat new file mode 100644 index 0000000000000000000000000000000000000000..d4036bede6982a40dedbd0610ebbfd9415bdab3c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_BI.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_BJ.dat b/venv/Lib/site-packages/babel/locale-data/fr_BJ.dat new file mode 100644 index 0000000000000000000000000000000000000000..562758e8509e57c9c9494e4ea34b4b4abaca09f5 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_BJ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_BL.dat b/venv/Lib/site-packages/babel/locale-data/fr_BL.dat new file mode 100644 index 0000000000000000000000000000000000000000..e311ee66cd8394009be17c132906f50ca4d10804 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_BL.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_CA.dat b/venv/Lib/site-packages/babel/locale-data/fr_CA.dat new file mode 100644 index 0000000000000000000000000000000000000000..da870066c3b328aaa058367d1d01df1bbdbe569c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_CA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_CD.dat b/venv/Lib/site-packages/babel/locale-data/fr_CD.dat new file mode 100644 index 0000000000000000000000000000000000000000..248278871fa714d437625e47d40e248934199f15 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_CD.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_CF.dat b/venv/Lib/site-packages/babel/locale-data/fr_CF.dat new file mode 100644 index 0000000000000000000000000000000000000000..2468e1eda5ea4cdddbb048e6051e3ecf12a571f5 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_CF.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_CG.dat b/venv/Lib/site-packages/babel/locale-data/fr_CG.dat new file mode 100644 index 0000000000000000000000000000000000000000..b7df1a92fbf90a31b9f15043adece20104351def Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_CG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_CH.dat b/venv/Lib/site-packages/babel/locale-data/fr_CH.dat new file mode 100644 index 0000000000000000000000000000000000000000..fa5b7b4771fdc94797ff2cc4b94d5e5a97df1ee0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_CH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_CI.dat b/venv/Lib/site-packages/babel/locale-data/fr_CI.dat new file mode 100644 index 0000000000000000000000000000000000000000..3d92afcfd400ef15a7b9d557b4cb2e12d87c3e49 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_CI.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_CM.dat b/venv/Lib/site-packages/babel/locale-data/fr_CM.dat new file mode 100644 index 0000000000000000000000000000000000000000..a779b4a7e9a02784135b7836dcd66cfcb0347063 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_CM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_DJ.dat b/venv/Lib/site-packages/babel/locale-data/fr_DJ.dat new file mode 100644 index 0000000000000000000000000000000000000000..79aa6e6701700ee97360b585c2dc3d4c63d70d5b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_DJ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_DZ.dat b/venv/Lib/site-packages/babel/locale-data/fr_DZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..3f56d231db0ab439b966e853f025de01403cf28a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_DZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_FR.dat b/venv/Lib/site-packages/babel/locale-data/fr_FR.dat new file mode 100644 index 0000000000000000000000000000000000000000..553d5e4a2bd44aa5cef5b83db863df2e2a6adf4c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_FR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_GA.dat b/venv/Lib/site-packages/babel/locale-data/fr_GA.dat new file mode 100644 index 0000000000000000000000000000000000000000..beb0dd5667847a73edce54227be9d93d125ac0b3 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_GA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_GF.dat b/venv/Lib/site-packages/babel/locale-data/fr_GF.dat new file mode 100644 index 0000000000000000000000000000000000000000..eb9ffc902a5f0da8fe66221a023cd4dc3fc1944d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_GF.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_GN.dat b/venv/Lib/site-packages/babel/locale-data/fr_GN.dat new file mode 100644 index 0000000000000000000000000000000000000000..c4f9f808c293c654a044531369b42046f65c2115 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_GN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_GP.dat b/venv/Lib/site-packages/babel/locale-data/fr_GP.dat new file mode 100644 index 0000000000000000000000000000000000000000..e2834c7dbbf7d4e23852dad6df30873c381ba7cd Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_GP.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_GQ.dat b/venv/Lib/site-packages/babel/locale-data/fr_GQ.dat new file mode 100644 index 0000000000000000000000000000000000000000..a04de173ae0f1e9a590b17661a786b5fad273106 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_GQ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_HT.dat b/venv/Lib/site-packages/babel/locale-data/fr_HT.dat new file mode 100644 index 0000000000000000000000000000000000000000..33b39563214156f84061ec466f63bc5485b998f2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_HT.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_KM.dat b/venv/Lib/site-packages/babel/locale-data/fr_KM.dat new file mode 100644 index 0000000000000000000000000000000000000000..9ece5936c5be9d70636f9c676ff0882bb014af70 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_KM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_LU.dat b/venv/Lib/site-packages/babel/locale-data/fr_LU.dat new file mode 100644 index 0000000000000000000000000000000000000000..062b9ab0244833879d9cbdce3fafd2c3db5fd580 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_LU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_MA.dat b/venv/Lib/site-packages/babel/locale-data/fr_MA.dat new file mode 100644 index 0000000000000000000000000000000000000000..6ee8eb9f0fd0dd36fbd7f3a86d7dc4e3fbedc9e9 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_MA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_MC.dat b/venv/Lib/site-packages/babel/locale-data/fr_MC.dat new file mode 100644 index 0000000000000000000000000000000000000000..52315a3da7afa3df5a01b35ada1e4b1ac70b7b9f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_MC.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_MF.dat b/venv/Lib/site-packages/babel/locale-data/fr_MF.dat new file mode 100644 index 0000000000000000000000000000000000000000..e5a1df0e02dfce3047bbd161e970b0e077566ed9 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_MF.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_MG.dat b/venv/Lib/site-packages/babel/locale-data/fr_MG.dat new file mode 100644 index 0000000000000000000000000000000000000000..c01d050a17972c3423c396bd4e3d36f3f61386fe Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_MG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_ML.dat b/venv/Lib/site-packages/babel/locale-data/fr_ML.dat new file mode 100644 index 0000000000000000000000000000000000000000..721771ea35aa86b54ec1d18805b8b5bd8969108e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_ML.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_MQ.dat b/venv/Lib/site-packages/babel/locale-data/fr_MQ.dat new file mode 100644 index 0000000000000000000000000000000000000000..90becb7632cba74c35e4d9b2f373efea98130b63 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_MQ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_MR.dat b/venv/Lib/site-packages/babel/locale-data/fr_MR.dat new file mode 100644 index 0000000000000000000000000000000000000000..28ef3f140c05fb7d1b947e19c75a8bd05f22818a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_MR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_MU.dat b/venv/Lib/site-packages/babel/locale-data/fr_MU.dat new file mode 100644 index 0000000000000000000000000000000000000000..76fc2ab4f1acdb6d11dabcd3a15e1db1a557cc32 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_MU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_NC.dat b/venv/Lib/site-packages/babel/locale-data/fr_NC.dat new file mode 100644 index 0000000000000000000000000000000000000000..6aaf03421f7ee350007519f69e4442199d1f2106 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_NC.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_NE.dat b/venv/Lib/site-packages/babel/locale-data/fr_NE.dat new file mode 100644 index 0000000000000000000000000000000000000000..143ac4fddc2c67587d4a474cdad73adde05923d9 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_NE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_PF.dat b/venv/Lib/site-packages/babel/locale-data/fr_PF.dat new file mode 100644 index 0000000000000000000000000000000000000000..e2f11dcdbf5fe9a8afade839270d0e0352356f73 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_PF.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_PM.dat b/venv/Lib/site-packages/babel/locale-data/fr_PM.dat new file mode 100644 index 0000000000000000000000000000000000000000..4f9cdf7be49a114bbf3e60bb6c44be0883d47312 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_PM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_RE.dat b/venv/Lib/site-packages/babel/locale-data/fr_RE.dat new file mode 100644 index 0000000000000000000000000000000000000000..214ad4faa870887bd9262b1feb54758402f1c362 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_RE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_RW.dat b/venv/Lib/site-packages/babel/locale-data/fr_RW.dat new file mode 100644 index 0000000000000000000000000000000000000000..6739c522d011141c04abb65c4e1538eefadee116 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_RW.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_SC.dat b/venv/Lib/site-packages/babel/locale-data/fr_SC.dat new file mode 100644 index 0000000000000000000000000000000000000000..1fedefe530a4e3b63870de2cb6d95d6fb1953150 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_SC.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_SN.dat b/venv/Lib/site-packages/babel/locale-data/fr_SN.dat new file mode 100644 index 0000000000000000000000000000000000000000..48207856b742d2f56de113dc0847956c313ebf20 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_SN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_SY.dat b/venv/Lib/site-packages/babel/locale-data/fr_SY.dat new file mode 100644 index 0000000000000000000000000000000000000000..8dd53967843f6251a6684da6adc200a35b06746d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_SY.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_TD.dat b/venv/Lib/site-packages/babel/locale-data/fr_TD.dat new file mode 100644 index 0000000000000000000000000000000000000000..6abebabdb50f21561aeecdc230048b9689476c14 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_TD.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_TG.dat b/venv/Lib/site-packages/babel/locale-data/fr_TG.dat new file mode 100644 index 0000000000000000000000000000000000000000..9395eaafb94a3e6bef84724ce14c09b0ff6a992a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_TG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_TN.dat b/venv/Lib/site-packages/babel/locale-data/fr_TN.dat new file mode 100644 index 0000000000000000000000000000000000000000..bf1e55153f84f2c719e60ac28bdf924eece46d70 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_TN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_VU.dat b/venv/Lib/site-packages/babel/locale-data/fr_VU.dat new file mode 100644 index 0000000000000000000000000000000000000000..f29eeed92eecf5d9849e71b2cfe1d2637e40033d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_VU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_WF.dat b/venv/Lib/site-packages/babel/locale-data/fr_WF.dat new file mode 100644 index 0000000000000000000000000000000000000000..2d38ac6f0c9206ad95ccd0f9330b864f78123a97 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_WF.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fr_YT.dat b/venv/Lib/site-packages/babel/locale-data/fr_YT.dat new file mode 100644 index 0000000000000000000000000000000000000000..9e9ba28c0345af71c670367417c5d9c22439a82a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fr_YT.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/frr.dat b/venv/Lib/site-packages/babel/locale-data/frr.dat new file mode 100644 index 0000000000000000000000000000000000000000..72f5352495dcd3b20aaa329e4767d299d9b2ee6c --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/frr.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:22d99df770cec0030671391613cdc15834b5a171157245f4104ea64a238aca80 +size 102994 diff --git a/venv/Lib/site-packages/babel/locale-data/frr_DE.dat b/venv/Lib/site-packages/babel/locale-data/frr_DE.dat new file mode 100644 index 0000000000000000000000000000000000000000..ecab3304dd5d074d0b6948e6d546fda5b7d9d4fd Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/frr_DE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fur.dat b/venv/Lib/site-packages/babel/locale-data/fur.dat new file mode 100644 index 0000000000000000000000000000000000000000..81a28ed2d63e3d0c9fa301e78555b53d9a44abf2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fur.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fur_IT.dat b/venv/Lib/site-packages/babel/locale-data/fur_IT.dat new file mode 100644 index 0000000000000000000000000000000000000000..2c40e5c09b7437bd06e1c08ee0a6da6182d121e4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fur_IT.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/fy.dat b/venv/Lib/site-packages/babel/locale-data/fy.dat new file mode 100644 index 0000000000000000000000000000000000000000..4c7af8aa370fd82011092ee5223b7ff96aae10fd --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/fy.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc971ef7a39a0a81bea0a7e14058acca381510ade9355b45f514fe7fd87bcb58 +size 108200 diff --git a/venv/Lib/site-packages/babel/locale-data/fy_NL.dat b/venv/Lib/site-packages/babel/locale-data/fy_NL.dat new file mode 100644 index 0000000000000000000000000000000000000000..1a8f5811a93f7c72affcf76e64b47abaa12855b0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/fy_NL.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ga.dat b/venv/Lib/site-packages/babel/locale-data/ga.dat new file mode 100644 index 0000000000000000000000000000000000000000..2059c4871c386add2d20f57e23f438819c57367b --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ga.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af1e4c2e0b4d522b01f55ee0bb47b674dc825c5d87f4a84b5542ee62f2cd521d +size 261523 diff --git a/venv/Lib/site-packages/babel/locale-data/ga_GB.dat b/venv/Lib/site-packages/babel/locale-data/ga_GB.dat new file mode 100644 index 0000000000000000000000000000000000000000..7432317e0d037e78fce88748f98dfa10c4651e3a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ga_GB.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ga_IE.dat b/venv/Lib/site-packages/babel/locale-data/ga_IE.dat new file mode 100644 index 0000000000000000000000000000000000000000..422b05a5f28b1c2c1f5983b93489fc75f63ffb4b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ga_IE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/gaa.dat b/venv/Lib/site-packages/babel/locale-data/gaa.dat new file mode 100644 index 0000000000000000000000000000000000000000..5028b29c694929897e0bbf8c44df5050454d8993 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/gaa.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/gaa_GH.dat b/venv/Lib/site-packages/babel/locale-data/gaa_GH.dat new file mode 100644 index 0000000000000000000000000000000000000000..7312993b691654663f9b0c0eaaff2147d64d3f59 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/gaa_GH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/gd.dat b/venv/Lib/site-packages/babel/locale-data/gd.dat new file mode 100644 index 0000000000000000000000000000000000000000..4afb551bb7344741e9522e7795487829f5b894f5 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/gd.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:02d4af47dec7d392ef14d2c7a4bb1beed3a029868e8d8bd614e2da0c31fac4c9 +size 280763 diff --git a/venv/Lib/site-packages/babel/locale-data/gd_GB.dat b/venv/Lib/site-packages/babel/locale-data/gd_GB.dat new file mode 100644 index 0000000000000000000000000000000000000000..e37057856938dc80f7ed5ff550d2cdeb308fcbdd Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/gd_GB.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/gez.dat b/venv/Lib/site-packages/babel/locale-data/gez.dat new file mode 100644 index 0000000000000000000000000000000000000000..c3fe514f814c9c03925481093ad6dfffe6926ff9 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/gez.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/gez_ER.dat b/venv/Lib/site-packages/babel/locale-data/gez_ER.dat new file mode 100644 index 0000000000000000000000000000000000000000..20c18a527b7f0746c831e82b8883d47e569ec9bd Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/gez_ER.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/gez_ET.dat b/venv/Lib/site-packages/babel/locale-data/gez_ET.dat new file mode 100644 index 0000000000000000000000000000000000000000..a70d43dd5c91e60f59c1a0de7b243ea8b46d8cc7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/gez_ET.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/gl.dat b/venv/Lib/site-packages/babel/locale-data/gl.dat new file mode 100644 index 0000000000000000000000000000000000000000..f12978be6f90f2cdbc96b62da7de2c0baa71aa7b --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/gl.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:376cef4b5820f1fde5e9238ba8822228206c6f101c02b15c94849e984c86c7b6 +size 153642 diff --git a/venv/Lib/site-packages/babel/locale-data/gl_ES.dat b/venv/Lib/site-packages/babel/locale-data/gl_ES.dat new file mode 100644 index 0000000000000000000000000000000000000000..d432bb25bf7072d14508ee98ce72f0184aecd1fb Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/gl_ES.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/gn.dat b/venv/Lib/site-packages/babel/locale-data/gn.dat new file mode 100644 index 0000000000000000000000000000000000000000..2d6eb9f5d021c2c3eb65589fc16c0ad7f1e73229 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/gn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/gn_PY.dat b/venv/Lib/site-packages/babel/locale-data/gn_PY.dat new file mode 100644 index 0000000000000000000000000000000000000000..a217cc7a8d5079e602149b839b2db11fd1966e67 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/gn_PY.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/gsw.dat b/venv/Lib/site-packages/babel/locale-data/gsw.dat new file mode 100644 index 0000000000000000000000000000000000000000..0d241c698a01460fc21731574de1c8550edf2fd1 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/gsw.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/gsw_CH.dat b/venv/Lib/site-packages/babel/locale-data/gsw_CH.dat new file mode 100644 index 0000000000000000000000000000000000000000..39ed5a8c190588586daa8b758362899cf2514ace Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/gsw_CH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/gsw_FR.dat b/venv/Lib/site-packages/babel/locale-data/gsw_FR.dat new file mode 100644 index 0000000000000000000000000000000000000000..8687c5c14a4cbcd5ad96fd2cb3a60a4e908123e5 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/gsw_FR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/gsw_LI.dat b/venv/Lib/site-packages/babel/locale-data/gsw_LI.dat new file mode 100644 index 0000000000000000000000000000000000000000..2e72e060d3bb15cb855e2e9995a3adc5a9a74dc9 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/gsw_LI.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/gu.dat b/venv/Lib/site-packages/babel/locale-data/gu.dat new file mode 100644 index 0000000000000000000000000000000000000000..454076b0df7231fc8bd81062b61c71b70e636509 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/gu.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e40fd3eaafff473b9674683d49fb5edb03aa470fc0773f8b24c249cc527cedc8 +size 208242 diff --git a/venv/Lib/site-packages/babel/locale-data/gu_IN.dat b/venv/Lib/site-packages/babel/locale-data/gu_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..a7071f7035c98fa3745e8041cd891996c26fc11e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/gu_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/guz.dat b/venv/Lib/site-packages/babel/locale-data/guz.dat new file mode 100644 index 0000000000000000000000000000000000000000..386e37bc5e0db8e9a27d4e0465e45a246b6455d5 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/guz.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/guz_KE.dat b/venv/Lib/site-packages/babel/locale-data/guz_KE.dat new file mode 100644 index 0000000000000000000000000000000000000000..3b2c102d89f2f5a9d921517ea32937bd28ad1ec4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/guz_KE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/gv.dat b/venv/Lib/site-packages/babel/locale-data/gv.dat new file mode 100644 index 0000000000000000000000000000000000000000..b493494c4de49b0efd2c7224f2d3355adbdce73d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/gv.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/gv_IM.dat b/venv/Lib/site-packages/babel/locale-data/gv_IM.dat new file mode 100644 index 0000000000000000000000000000000000000000..0793d83827e90b4cd4c95f50caebfb68a2a5328c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/gv_IM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ha.dat b/venv/Lib/site-packages/babel/locale-data/ha.dat new file mode 100644 index 0000000000000000000000000000000000000000..ac7515a1dc082baab960359c6ac17b35ef3ef7af --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ha.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d57cda82b885da09357913d5cd30d551382c206a527c7f830a7c4bcaba7dc0a +size 150526 diff --git a/venv/Lib/site-packages/babel/locale-data/ha_Arab.dat b/venv/Lib/site-packages/babel/locale-data/ha_Arab.dat new file mode 100644 index 0000000000000000000000000000000000000000..1395d9e02350c637398027e0190dc42ca4d27758 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ha_Arab.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ha_Arab_NG.dat b/venv/Lib/site-packages/babel/locale-data/ha_Arab_NG.dat new file mode 100644 index 0000000000000000000000000000000000000000..0a98ac88ed3910cd0a02bf619d1b1fe0d1b54238 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ha_Arab_NG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ha_Arab_SD.dat b/venv/Lib/site-packages/babel/locale-data/ha_Arab_SD.dat new file mode 100644 index 0000000000000000000000000000000000000000..e33c2b3c487031527e5cca3761d82f66343694d4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ha_Arab_SD.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ha_GH.dat b/venv/Lib/site-packages/babel/locale-data/ha_GH.dat new file mode 100644 index 0000000000000000000000000000000000000000..74d5780544564f5e9b043ba7804170ee7cff01b5 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ha_GH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ha_NE.dat b/venv/Lib/site-packages/babel/locale-data/ha_NE.dat new file mode 100644 index 0000000000000000000000000000000000000000..d06afa95c993d74d2066659fe3c2101b418343b6 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ha_NE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ha_NG.dat b/venv/Lib/site-packages/babel/locale-data/ha_NG.dat new file mode 100644 index 0000000000000000000000000000000000000000..0a98ac88ed3910cd0a02bf619d1b1fe0d1b54238 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ha_NG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/haw.dat b/venv/Lib/site-packages/babel/locale-data/haw.dat new file mode 100644 index 0000000000000000000000000000000000000000..8b2b47cdce299453888c1a863c7f690658e3e65a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/haw.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/haw_US.dat b/venv/Lib/site-packages/babel/locale-data/haw_US.dat new file mode 100644 index 0000000000000000000000000000000000000000..18706f16dccdaa507295e3e37df78dfec5542214 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/haw_US.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/he.dat b/venv/Lib/site-packages/babel/locale-data/he.dat new file mode 100644 index 0000000000000000000000000000000000000000..11232e48793f9e4e0333ca5970a987dc9d74acff --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/he.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3a00008ee85718fe8e9b714b8b91c5a06d6213efb2bc37c0530432d8d2193b0 +size 217062 diff --git a/venv/Lib/site-packages/babel/locale-data/he_IL.dat b/venv/Lib/site-packages/babel/locale-data/he_IL.dat new file mode 100644 index 0000000000000000000000000000000000000000..3a0da6c074e88d982b3a299f76daa29ae72142ea Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/he_IL.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/hi.dat b/venv/Lib/site-packages/babel/locale-data/hi.dat new file mode 100644 index 0000000000000000000000000000000000000000..3f9b86301039ae26b21447a732aad12910230685 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/hi.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d9ea481f0191f472ea17dd8ec5a5310525412696b48671c63d9d63c3936ec2f +size 221948 diff --git a/venv/Lib/site-packages/babel/locale-data/hi_IN.dat b/venv/Lib/site-packages/babel/locale-data/hi_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..9fbfd57dd5de3062e7aa6e73854d4d4f7c2aba71 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/hi_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/hi_Latn.dat b/venv/Lib/site-packages/babel/locale-data/hi_Latn.dat new file mode 100644 index 0000000000000000000000000000000000000000..17b23a7db73dbcc8af079c3a6987a0d566ebfd5b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/hi_Latn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/hi_Latn_IN.dat b/venv/Lib/site-packages/babel/locale-data/hi_Latn_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..9fbfd57dd5de3062e7aa6e73854d4d4f7c2aba71 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/hi_Latn_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/hnj.dat b/venv/Lib/site-packages/babel/locale-data/hnj.dat new file mode 100644 index 0000000000000000000000000000000000000000..07eeb51642690284dbd561c20dd5881f484a9ebc Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/hnj.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/hnj_Hmnp.dat b/venv/Lib/site-packages/babel/locale-data/hnj_Hmnp.dat new file mode 100644 index 0000000000000000000000000000000000000000..c8935a2eea155b1eecab03f3452844f5246abd81 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/hnj_Hmnp.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/hnj_Hmnp_US.dat b/venv/Lib/site-packages/babel/locale-data/hnj_Hmnp_US.dat new file mode 100644 index 0000000000000000000000000000000000000000..46c371477d04d4a659e6252ef6017a4809a3dcd6 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/hnj_Hmnp_US.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/hr.dat b/venv/Lib/site-packages/babel/locale-data/hr.dat new file mode 100644 index 0000000000000000000000000000000000000000..4da448dff8246d5235f5901297e54052cd045589 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/hr.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91dccaa569b22c0205c3b0f90cf286eda1d44236253397dcb5c04b4681deba38 +size 207636 diff --git a/venv/Lib/site-packages/babel/locale-data/hr_BA.dat b/venv/Lib/site-packages/babel/locale-data/hr_BA.dat new file mode 100644 index 0000000000000000000000000000000000000000..44129abfe5bad3dee3e5b5a554907eafba192fc6 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/hr_BA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/hr_HR.dat b/venv/Lib/site-packages/babel/locale-data/hr_HR.dat new file mode 100644 index 0000000000000000000000000000000000000000..a0ae43dde24a8349dec1a34c4a7c4c6e1728a0b1 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/hr_HR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/hsb.dat b/venv/Lib/site-packages/babel/locale-data/hsb.dat new file mode 100644 index 0000000000000000000000000000000000000000..7dd4c6003150de0bd60822a30cf9b6b8c9656b9a --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/hsb.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c396c34b7dfa87153e442865e1081a6b25e032037f541521e46257ce73c8fc1b +size 206887 diff --git a/venv/Lib/site-packages/babel/locale-data/hsb_DE.dat b/venv/Lib/site-packages/babel/locale-data/hsb_DE.dat new file mode 100644 index 0000000000000000000000000000000000000000..5de4a2c3f3fffeea3a779a48c3c7afb8653bf1b4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/hsb_DE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/hu.dat b/venv/Lib/site-packages/babel/locale-data/hu.dat new file mode 100644 index 0000000000000000000000000000000000000000..3ebbaa5ef7bc4cf94e11a3f475c3eaba393f4a1c --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/hu.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7664beec6227c357866e27e380cc977359b59c183a74ae88389203a0b6ff129a +size 147032 diff --git a/venv/Lib/site-packages/babel/locale-data/hu_HU.dat b/venv/Lib/site-packages/babel/locale-data/hu_HU.dat new file mode 100644 index 0000000000000000000000000000000000000000..113faedef4da0be13a26cbee6eeddea88b88a644 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/hu_HU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/hy.dat b/venv/Lib/site-packages/babel/locale-data/hy.dat new file mode 100644 index 0000000000000000000000000000000000000000..f4add8b554aaf8270641b8b85082dea9675becd5 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/hy.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:47a9f61bc41d924c65031060a532bb97e70f8701e0d37bc81b5a7099656b095e +size 202316 diff --git a/venv/Lib/site-packages/babel/locale-data/hy_AM.dat b/venv/Lib/site-packages/babel/locale-data/hy_AM.dat new file mode 100644 index 0000000000000000000000000000000000000000..fa2eaf7d3c331ebde0d1ff8bae1e07707b0fc083 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/hy_AM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ia.dat b/venv/Lib/site-packages/babel/locale-data/ia.dat new file mode 100644 index 0000000000000000000000000000000000000000..da30ba0667812025f705e0afd17ba452bb05491a --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ia.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:59ae320d30eff53036226a3af6fff8f46aa057c2ef40fd62b961aae8b14030e9 +size 133538 diff --git a/venv/Lib/site-packages/babel/locale-data/ia_001.dat b/venv/Lib/site-packages/babel/locale-data/ia_001.dat new file mode 100644 index 0000000000000000000000000000000000000000..b0a1770b08619694fb15ea2c0984aaf44ee309d4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ia_001.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/id.dat b/venv/Lib/site-packages/babel/locale-data/id.dat new file mode 100644 index 0000000000000000000000000000000000000000..3cfc48555bae4f7b8030172a3ce9841a5cd103c8 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/id.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:09f082ccadd557df286de1fbc7551e6b1fb161ccdf0b07b1b7027b69eb534390 +size 126977 diff --git a/venv/Lib/site-packages/babel/locale-data/id_ID.dat b/venv/Lib/site-packages/babel/locale-data/id_ID.dat new file mode 100644 index 0000000000000000000000000000000000000000..cf7c8e5ef56da81a261b222c7be58f0ba3816c90 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/id_ID.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ie.dat b/venv/Lib/site-packages/babel/locale-data/ie.dat new file mode 100644 index 0000000000000000000000000000000000000000..a6ae1fe3b6d41f7694a3acc206fab6b209ce1067 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ie.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ie_EE.dat b/venv/Lib/site-packages/babel/locale-data/ie_EE.dat new file mode 100644 index 0000000000000000000000000000000000000000..91566139adf95acb1a94eaa6e119314597a25ba7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ie_EE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ig.dat b/venv/Lib/site-packages/babel/locale-data/ig.dat new file mode 100644 index 0000000000000000000000000000000000000000..4f4627c00336d593718b876e49c94409c15127c5 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ig.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ig_NG.dat b/venv/Lib/site-packages/babel/locale-data/ig_NG.dat new file mode 100644 index 0000000000000000000000000000000000000000..4b5635b8b348cabc69689c1e37d3d39da1232cbe Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ig_NG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ii.dat b/venv/Lib/site-packages/babel/locale-data/ii.dat new file mode 100644 index 0000000000000000000000000000000000000000..93158e63d273ad861d54d2d2d32c46bc9589e481 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ii.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ii_CN.dat b/venv/Lib/site-packages/babel/locale-data/ii_CN.dat new file mode 100644 index 0000000000000000000000000000000000000000..ef6effaa17c3ec3cd7522b5a8689ee73b83d5d88 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ii_CN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/io.dat b/venv/Lib/site-packages/babel/locale-data/io.dat new file mode 100644 index 0000000000000000000000000000000000000000..33aa1fae3e4923f2b7d860bef47c671c16c616ab Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/io.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/io_001.dat b/venv/Lib/site-packages/babel/locale-data/io_001.dat new file mode 100644 index 0000000000000000000000000000000000000000..964a6ab69af59f7725e9e558106fbe6a822e36ff Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/io_001.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/is.dat b/venv/Lib/site-packages/babel/locale-data/is.dat new file mode 100644 index 0000000000000000000000000000000000000000..52328f0e964759b236ba0024d40ed7137f5db2fc --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/is.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:afd8274297fcd4da8f56c9152948921966ba554dff357cc97276b51a1a36f1df +size 163097 diff --git a/venv/Lib/site-packages/babel/locale-data/is_IS.dat b/venv/Lib/site-packages/babel/locale-data/is_IS.dat new file mode 100644 index 0000000000000000000000000000000000000000..b3649a764485e0c917239047845ef4d5382b405d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/is_IS.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/it.dat b/venv/Lib/site-packages/babel/locale-data/it.dat new file mode 100644 index 0000000000000000000000000000000000000000..1b8299cabb9306242ecb3f46824cff3dde197504 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/it.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9fca7129a32e4b67a40fb10e495fb73e655f7739bd36ac45e73034ef7c798ad5 +size 173579 diff --git a/venv/Lib/site-packages/babel/locale-data/it_CH.dat b/venv/Lib/site-packages/babel/locale-data/it_CH.dat new file mode 100644 index 0000000000000000000000000000000000000000..cddfb6b51e29118fcedef45a64702147c32e1207 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/it_CH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/it_IT.dat b/venv/Lib/site-packages/babel/locale-data/it_IT.dat new file mode 100644 index 0000000000000000000000000000000000000000..b9a944aa1cb160ca192597ef1b468bddefb7307d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/it_IT.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/it_SM.dat b/venv/Lib/site-packages/babel/locale-data/it_SM.dat new file mode 100644 index 0000000000000000000000000000000000000000..db8432aa4460d3468fc4b3cbde7c242293327d6e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/it_SM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/it_VA.dat b/venv/Lib/site-packages/babel/locale-data/it_VA.dat new file mode 100644 index 0000000000000000000000000000000000000000..30ecca00fc088b0a5d58223d5ed1d71d8bf7acbb Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/it_VA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/iu.dat b/venv/Lib/site-packages/babel/locale-data/iu.dat new file mode 100644 index 0000000000000000000000000000000000000000..ca5b1f7a3b7ce5758de06e21d7990589a412c6e0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/iu.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/iu_CA.dat b/venv/Lib/site-packages/babel/locale-data/iu_CA.dat new file mode 100644 index 0000000000000000000000000000000000000000..61bb544859cc38d21555cc7cc7b5eaa067dd5b5d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/iu_CA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/iu_Latn.dat b/venv/Lib/site-packages/babel/locale-data/iu_Latn.dat new file mode 100644 index 0000000000000000000000000000000000000000..20b7cedc76f10ede8d0b56938bc84316fe0f51e9 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/iu_Latn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/iu_Latn_CA.dat b/venv/Lib/site-packages/babel/locale-data/iu_Latn_CA.dat new file mode 100644 index 0000000000000000000000000000000000000000..61bb544859cc38d21555cc7cc7b5eaa067dd5b5d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/iu_Latn_CA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ja.dat b/venv/Lib/site-packages/babel/locale-data/ja.dat new file mode 100644 index 0000000000000000000000000000000000000000..77c14fb444f8434e4c26d59980105de2d000af67 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ja.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f3ac4f04e6351f57b47cb0ba83feb547f8a94b84066c1f6c5ecb7f270c1d016a +size 179695 diff --git a/venv/Lib/site-packages/babel/locale-data/ja_JP.dat b/venv/Lib/site-packages/babel/locale-data/ja_JP.dat new file mode 100644 index 0000000000000000000000000000000000000000..f0d4479b6d04853b694b33a342b2f8d109984a60 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ja_JP.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/jbo.dat b/venv/Lib/site-packages/babel/locale-data/jbo.dat new file mode 100644 index 0000000000000000000000000000000000000000..1bf2dbb9adf617cbe329946f4f5077d8b89b182d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/jbo.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/jbo_001.dat b/venv/Lib/site-packages/babel/locale-data/jbo_001.dat new file mode 100644 index 0000000000000000000000000000000000000000..dcc98aef622315e30a1d2f3a9114132cd6a5b98d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/jbo_001.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/jgo.dat b/venv/Lib/site-packages/babel/locale-data/jgo.dat new file mode 100644 index 0000000000000000000000000000000000000000..1b6230ad98233cf8fba6df5b8a06c3cb246e03e7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/jgo.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/jgo_CM.dat b/venv/Lib/site-packages/babel/locale-data/jgo_CM.dat new file mode 100644 index 0000000000000000000000000000000000000000..7a523f3be854c36007d124713884d61e2d7fedc2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/jgo_CM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/jmc.dat b/venv/Lib/site-packages/babel/locale-data/jmc.dat new file mode 100644 index 0000000000000000000000000000000000000000..a4abf969f6f7f28d7079b200f0e76e7dcbe0efd6 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/jmc.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/jmc_TZ.dat b/venv/Lib/site-packages/babel/locale-data/jmc_TZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..6abba3279d9ef516f3da5d2ccb97ad8b674016ea Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/jmc_TZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/jv.dat b/venv/Lib/site-packages/babel/locale-data/jv.dat new file mode 100644 index 0000000000000000000000000000000000000000..cdb610fc24546325d18aed96cd8e44874c6a01c3 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/jv.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ae70cdd90e81d73bb3ec6ce60d2ddc7452642a594965da2d610ea9fecc963d5 +size 103138 diff --git a/venv/Lib/site-packages/babel/locale-data/jv_ID.dat b/venv/Lib/site-packages/babel/locale-data/jv_ID.dat new file mode 100644 index 0000000000000000000000000000000000000000..b60dc4db6f97d0bb2c4e61c960e7863420a2841f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/jv_ID.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ka.dat b/venv/Lib/site-packages/babel/locale-data/ka.dat new file mode 100644 index 0000000000000000000000000000000000000000..5e3dcf0e37d13a334c9442e8e796d28bda7137ac --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ka.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:748b240e373b65d459d6b189207c4e3ffe3b58efdc7632c3c787a5b581136d41 +size 230234 diff --git a/venv/Lib/site-packages/babel/locale-data/ka_GE.dat b/venv/Lib/site-packages/babel/locale-data/ka_GE.dat new file mode 100644 index 0000000000000000000000000000000000000000..73278fabcf96d35b5b5e8a73bd75a6bbaba2a6a4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ka_GE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kaa.dat b/venv/Lib/site-packages/babel/locale-data/kaa.dat new file mode 100644 index 0000000000000000000000000000000000000000..e6b6abdb483106caf7a0fd488a763c354125ce6a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kaa.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kaa_Cyrl.dat b/venv/Lib/site-packages/babel/locale-data/kaa_Cyrl.dat new file mode 100644 index 0000000000000000000000000000000000000000..085710f6f028f7cdb08673215627197e7a90e1d0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kaa_Cyrl.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kaa_Cyrl_UZ.dat b/venv/Lib/site-packages/babel/locale-data/kaa_Cyrl_UZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..b2e4590f6f2f06c063b4ac533012c4123abcf501 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kaa_Cyrl_UZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kaa_Latn.dat b/venv/Lib/site-packages/babel/locale-data/kaa_Latn.dat new file mode 100644 index 0000000000000000000000000000000000000000..085710f6f028f7cdb08673215627197e7a90e1d0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kaa_Latn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kaa_Latn_UZ.dat b/venv/Lib/site-packages/babel/locale-data/kaa_Latn_UZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..b2e4590f6f2f06c063b4ac533012c4123abcf501 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kaa_Latn_UZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kab.dat b/venv/Lib/site-packages/babel/locale-data/kab.dat new file mode 100644 index 0000000000000000000000000000000000000000..8ac4d772771483d9686c67604e2682b3c5be8cc6 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/kab.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca42d1bdd46d1e963ccbb2431ce802d372b1032bc07f1cd8414978e0228aafab +size 121528 diff --git a/venv/Lib/site-packages/babel/locale-data/kab_DZ.dat b/venv/Lib/site-packages/babel/locale-data/kab_DZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..c0cbad8bd1b5633b172646b45c8bd21ba435c911 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kab_DZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kaj.dat b/venv/Lib/site-packages/babel/locale-data/kaj.dat new file mode 100644 index 0000000000000000000000000000000000000000..8d304e93b3f096cce394b45e813a427c8287847a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kaj.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kaj_NG.dat b/venv/Lib/site-packages/babel/locale-data/kaj_NG.dat new file mode 100644 index 0000000000000000000000000000000000000000..a94d6f7ce26e102ff62b870f19176c3221bce819 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kaj_NG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kam.dat b/venv/Lib/site-packages/babel/locale-data/kam.dat new file mode 100644 index 0000000000000000000000000000000000000000..2ef195ab440db50e94a4d74d98e448596a62df83 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kam.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kam_KE.dat b/venv/Lib/site-packages/babel/locale-data/kam_KE.dat new file mode 100644 index 0000000000000000000000000000000000000000..d16ca2a1d148fabd6ec58da05e93efaf7661ca3b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kam_KE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kcg.dat b/venv/Lib/site-packages/babel/locale-data/kcg.dat new file mode 100644 index 0000000000000000000000000000000000000000..3ff14c35c9af928727d6265f9fddf0ec625c3a77 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kcg.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kcg_NG.dat b/venv/Lib/site-packages/babel/locale-data/kcg_NG.dat new file mode 100644 index 0000000000000000000000000000000000000000..1e6dc36b116ecfc157b654d621b77537103276be Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kcg_NG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kde.dat b/venv/Lib/site-packages/babel/locale-data/kde.dat new file mode 100644 index 0000000000000000000000000000000000000000..6d51d911598cff46f5cfe1dd7c803c680fee4cf3 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kde.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kde_TZ.dat b/venv/Lib/site-packages/babel/locale-data/kde_TZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..2fcf1d47e7881326e0307bd78a9e9a33c9d75917 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kde_TZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kea.dat b/venv/Lib/site-packages/babel/locale-data/kea.dat new file mode 100644 index 0000000000000000000000000000000000000000..42d05295a225a21be8970f004b9054253beaa74b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kea.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kea_CV.dat b/venv/Lib/site-packages/babel/locale-data/kea_CV.dat new file mode 100644 index 0000000000000000000000000000000000000000..da97962e8c8ad12527b44ee2acbc3e310d342b68 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kea_CV.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ken.dat b/venv/Lib/site-packages/babel/locale-data/ken.dat new file mode 100644 index 0000000000000000000000000000000000000000..57e91a15bcdab4b6cf46e92f13a327e22596cc8b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ken.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ken_CM.dat b/venv/Lib/site-packages/babel/locale-data/ken_CM.dat new file mode 100644 index 0000000000000000000000000000000000000000..9ef618000d11c874a2cb699b99e79042e43aff7c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ken_CM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kgp.dat b/venv/Lib/site-packages/babel/locale-data/kgp.dat new file mode 100644 index 0000000000000000000000000000000000000000..ab907ad576955b532bf1af9af4bd3e5a76c100da --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/kgp.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38ac7565b05d1f0ef901dceb4fea5eb66df60e3f3025db54407fe86a2eefd2a2 +size 184092 diff --git a/venv/Lib/site-packages/babel/locale-data/kgp_BR.dat b/venv/Lib/site-packages/babel/locale-data/kgp_BR.dat new file mode 100644 index 0000000000000000000000000000000000000000..44b499db7bc27f8dfa4c704838c8e7814d76d14a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kgp_BR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/khq.dat b/venv/Lib/site-packages/babel/locale-data/khq.dat new file mode 100644 index 0000000000000000000000000000000000000000..61cc45f5bccfa826c072f8fe9026d88d4c3e363d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/khq.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/khq_ML.dat b/venv/Lib/site-packages/babel/locale-data/khq_ML.dat new file mode 100644 index 0000000000000000000000000000000000000000..91f7da18eb6a8ae209b0c686ce1fdb3583a5243b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/khq_ML.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ki.dat b/venv/Lib/site-packages/babel/locale-data/ki.dat new file mode 100644 index 0000000000000000000000000000000000000000..0a7eb8d195ef2057a266d04a4657e8880089b00d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ki.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ki_KE.dat b/venv/Lib/site-packages/babel/locale-data/ki_KE.dat new file mode 100644 index 0000000000000000000000000000000000000000..901b92145484f3cb60eb4765afa061ca8a689b4b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ki_KE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kk.dat b/venv/Lib/site-packages/babel/locale-data/kk.dat new file mode 100644 index 0000000000000000000000000000000000000000..99edbd3c7cf8e896a5cc404c44aa1c711ce1d5a7 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/kk.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f778eda4a71f8900516f278ec8982a11365718e9eda2c0769c679d8074a1335c +size 200871 diff --git a/venv/Lib/site-packages/babel/locale-data/kk_Arab.dat b/venv/Lib/site-packages/babel/locale-data/kk_Arab.dat new file mode 100644 index 0000000000000000000000000000000000000000..6df9c5c8d4d478c1782d13afa2a39bfe42fe2cb7 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/kk_Arab.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c1b199ba88b27f770da63710dd424f798c42d9f3b980acd975da292d0b02b0a +size 222820 diff --git a/venv/Lib/site-packages/babel/locale-data/kk_Arab_CN.dat b/venv/Lib/site-packages/babel/locale-data/kk_Arab_CN.dat new file mode 100644 index 0000000000000000000000000000000000000000..d8b9432a0e0199aef696ec1d337271d4df9f1204 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kk_Arab_CN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kk_Cyrl.dat b/venv/Lib/site-packages/babel/locale-data/kk_Cyrl.dat new file mode 100644 index 0000000000000000000000000000000000000000..082c754571d432c5153870bca6d1d743678167f0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kk_Cyrl.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kk_Cyrl_KZ.dat b/venv/Lib/site-packages/babel/locale-data/kk_Cyrl_KZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..ca827ac1dc2af99f50e83dd2cfe07ee383bc98f5 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kk_Cyrl_KZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kk_KZ.dat b/venv/Lib/site-packages/babel/locale-data/kk_KZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..ca827ac1dc2af99f50e83dd2cfe07ee383bc98f5 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kk_KZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kkj.dat b/venv/Lib/site-packages/babel/locale-data/kkj.dat new file mode 100644 index 0000000000000000000000000000000000000000..529c4175c342e598c0bdb3caff088658fb791a64 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kkj.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kkj_CM.dat b/venv/Lib/site-packages/babel/locale-data/kkj_CM.dat new file mode 100644 index 0000000000000000000000000000000000000000..231f08bd492e2b0f85f67f77e51370fdab6ca5be Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kkj_CM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kl.dat b/venv/Lib/site-packages/babel/locale-data/kl.dat new file mode 100644 index 0000000000000000000000000000000000000000..d82a25bb5c62473ba8cd2446af2b61db3e9f6904 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kl.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kl_GL.dat b/venv/Lib/site-packages/babel/locale-data/kl_GL.dat new file mode 100644 index 0000000000000000000000000000000000000000..a8fb28dc88213878d60939a3dd04142a49b1858c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kl_GL.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kln.dat b/venv/Lib/site-packages/babel/locale-data/kln.dat new file mode 100644 index 0000000000000000000000000000000000000000..65e435cb00ba22a1dec3bfd943147a7130f13bd2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kln.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kln_KE.dat b/venv/Lib/site-packages/babel/locale-data/kln_KE.dat new file mode 100644 index 0000000000000000000000000000000000000000..9a12beb465eaff7dba578149e2f984ef440eb5e4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kln_KE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/km.dat b/venv/Lib/site-packages/babel/locale-data/km.dat new file mode 100644 index 0000000000000000000000000000000000000000..6b850123340a0e87cbaa3f6d6df1b700b1c179e5 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/km.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ee78330becfb878e5304d017b0f71824152148c413ac253ce9330ca3cafb97b +size 176653 diff --git a/venv/Lib/site-packages/babel/locale-data/km_KH.dat b/venv/Lib/site-packages/babel/locale-data/km_KH.dat new file mode 100644 index 0000000000000000000000000000000000000000..2ccaba66acc1f88733b39bfec63f6c6b6a40fa5a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/km_KH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kn.dat b/venv/Lib/site-packages/babel/locale-data/kn.dat new file mode 100644 index 0000000000000000000000000000000000000000..f7c575b4e693c58680935e7e8932a3dce8b91ffa --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/kn.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f40071cb92997814861e892084303245f6616be670a01dc57c1d208e2b3f32c +size 267281 diff --git a/venv/Lib/site-packages/babel/locale-data/kn_IN.dat b/venv/Lib/site-packages/babel/locale-data/kn_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..1f0d6462b488b293474370e07ca4fe0caaecc2fb Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kn_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ko.dat b/venv/Lib/site-packages/babel/locale-data/ko.dat new file mode 100644 index 0000000000000000000000000000000000000000..157ab51103ca9570a90d2be7a3dd5609e7c05c79 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ko.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b582229e34cce592f0f80bd67ab511f21e05450d3d2c67e844dcaeb65da230b2 +size 154621 diff --git a/venv/Lib/site-packages/babel/locale-data/ko_CN.dat b/venv/Lib/site-packages/babel/locale-data/ko_CN.dat new file mode 100644 index 0000000000000000000000000000000000000000..170698df794a95b51921c796d9c22354a8b83434 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ko_CN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ko_KP.dat b/venv/Lib/site-packages/babel/locale-data/ko_KP.dat new file mode 100644 index 0000000000000000000000000000000000000000..7c76309ae8d52a14ffd9fbae7ca45c1798f33f95 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ko_KP.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ko_KR.dat b/venv/Lib/site-packages/babel/locale-data/ko_KR.dat new file mode 100644 index 0000000000000000000000000000000000000000..4af3b628f2f72c3564a82d3bd7386f9a9b0dfb4c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ko_KR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kok.dat b/venv/Lib/site-packages/babel/locale-data/kok.dat new file mode 100644 index 0000000000000000000000000000000000000000..f0677cae5bf7155035ac8877c818837a60cde397 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/kok.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d694b449781eb51fbd0c7b4bef53c0c36548469e756bd29fc684a7c37068c45b +size 179992 diff --git a/venv/Lib/site-packages/babel/locale-data/kok_Deva.dat b/venv/Lib/site-packages/babel/locale-data/kok_Deva.dat new file mode 100644 index 0000000000000000000000000000000000000000..e92bf9d5950f316888058b0b3d9094ad2401307d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kok_Deva.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kok_Deva_IN.dat b/venv/Lib/site-packages/babel/locale-data/kok_Deva_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..8fff8b19fd5e43af52a6ec2f67b993b0ea5273ed Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kok_Deva_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kok_Latn.dat b/venv/Lib/site-packages/babel/locale-data/kok_Latn.dat new file mode 100644 index 0000000000000000000000000000000000000000..d3fbcce66d5d2169602d26d893878f116497fd9c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kok_Latn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kok_Latn_IN.dat b/venv/Lib/site-packages/babel/locale-data/kok_Latn_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..8fff8b19fd5e43af52a6ec2f67b993b0ea5273ed Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kok_Latn_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kpe.dat b/venv/Lib/site-packages/babel/locale-data/kpe.dat new file mode 100644 index 0000000000000000000000000000000000000000..48cf0bf5552aaff040759624c53cdbd148024fff Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kpe.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kpe_GN.dat b/venv/Lib/site-packages/babel/locale-data/kpe_GN.dat new file mode 100644 index 0000000000000000000000000000000000000000..d333167e153bcde71c6dcff3a54ef2601a78443e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kpe_GN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kpe_LR.dat b/venv/Lib/site-packages/babel/locale-data/kpe_LR.dat new file mode 100644 index 0000000000000000000000000000000000000000..8afe47b96cd5fd09a1df002a544e5fadf189ba48 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kpe_LR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ks.dat b/venv/Lib/site-packages/babel/locale-data/ks.dat new file mode 100644 index 0000000000000000000000000000000000000000..7b199184f9e90eea7fe13c864daae00b10112b4f --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ks.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b2492029b1f05fc4cdba4da5ec2b680285dde7a15d5ee65e35814b1a0b70c0e +size 111691 diff --git a/venv/Lib/site-packages/babel/locale-data/ks_Arab.dat b/venv/Lib/site-packages/babel/locale-data/ks_Arab.dat new file mode 100644 index 0000000000000000000000000000000000000000..6441efedebe97ffe672bef2dc5e3e8e41075cc01 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ks_Arab.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ks_Arab_IN.dat b/venv/Lib/site-packages/babel/locale-data/ks_Arab_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..02a5d1167e2749317703102f646a9f4ebe2c75ea Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ks_Arab_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ks_Deva.dat b/venv/Lib/site-packages/babel/locale-data/ks_Deva.dat new file mode 100644 index 0000000000000000000000000000000000000000..e63809267213167fdc9f2a27ebded38bea1e8dd0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ks_Deva.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ks_Deva_IN.dat b/venv/Lib/site-packages/babel/locale-data/ks_Deva_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..02a5d1167e2749317703102f646a9f4ebe2c75ea Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ks_Deva_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ksb.dat b/venv/Lib/site-packages/babel/locale-data/ksb.dat new file mode 100644 index 0000000000000000000000000000000000000000..7ced57e880da350f50462955531ac87b5f114ec4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ksb.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ksb_TZ.dat b/venv/Lib/site-packages/babel/locale-data/ksb_TZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..6837e3753ed2bb1111b807d118e0c34cc2c6c613 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ksb_TZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ksf.dat b/venv/Lib/site-packages/babel/locale-data/ksf.dat new file mode 100644 index 0000000000000000000000000000000000000000..7fba25266c0be1b3674496c41723906c22560ce6 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ksf.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ksf_CM.dat b/venv/Lib/site-packages/babel/locale-data/ksf_CM.dat new file mode 100644 index 0000000000000000000000000000000000000000..fc29c4985abeaebc5af5a0ad920c871319fdb964 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ksf_CM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ksh.dat b/venv/Lib/site-packages/babel/locale-data/ksh.dat new file mode 100644 index 0000000000000000000000000000000000000000..b7bb1f17203d272c15a2312036a66185c1d62696 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ksh.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ksh_DE.dat b/venv/Lib/site-packages/babel/locale-data/ksh_DE.dat new file mode 100644 index 0000000000000000000000000000000000000000..9318d48d822f5bfaa4d4a4db2683468dcadf1eb6 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ksh_DE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ku.dat b/venv/Lib/site-packages/babel/locale-data/ku.dat new file mode 100644 index 0000000000000000000000000000000000000000..8430e80075700fc1b00bdb38a4a228ab0011c539 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ku.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6de072ae15e307c89185a346c6441ac6751c92eb6eb37309eb53e6f91a3c4aa5 +size 117087 diff --git a/venv/Lib/site-packages/babel/locale-data/ku_TR.dat b/venv/Lib/site-packages/babel/locale-data/ku_TR.dat new file mode 100644 index 0000000000000000000000000000000000000000..206426aa05d3c5da3867c45c81c9bb830bbfb06e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ku_TR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kw.dat b/venv/Lib/site-packages/babel/locale-data/kw.dat new file mode 100644 index 0000000000000000000000000000000000000000..3d103e3792d51747659d00f345b174d5bbf27a1f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kw.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kw_GB.dat b/venv/Lib/site-packages/babel/locale-data/kw_GB.dat new file mode 100644 index 0000000000000000000000000000000000000000..da81c10f13717d70f37d965b6685fd904cb1c684 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kw_GB.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kxv.dat b/venv/Lib/site-packages/babel/locale-data/kxv.dat new file mode 100644 index 0000000000000000000000000000000000000000..2849d6cc93edfb6138ab3d683f1001d3df97bb6f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kxv.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kxv_Deva.dat b/venv/Lib/site-packages/babel/locale-data/kxv_Deva.dat new file mode 100644 index 0000000000000000000000000000000000000000..184addcd430d0b365574dffb2d4ba45ffbef34ac Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kxv_Deva.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kxv_Deva_IN.dat b/venv/Lib/site-packages/babel/locale-data/kxv_Deva_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..8a1e28980c4166f7d6b942005b8528d8a3518db7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kxv_Deva_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kxv_Latn.dat b/venv/Lib/site-packages/babel/locale-data/kxv_Latn.dat new file mode 100644 index 0000000000000000000000000000000000000000..35b2695db7962af7f9f290d6faabfd5028771583 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kxv_Latn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kxv_Latn_IN.dat b/venv/Lib/site-packages/babel/locale-data/kxv_Latn_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..8a1e28980c4166f7d6b942005b8528d8a3518db7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kxv_Latn_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kxv_Orya.dat b/venv/Lib/site-packages/babel/locale-data/kxv_Orya.dat new file mode 100644 index 0000000000000000000000000000000000000000..98172abd950bd3cf13a880b488f2c748a9317e1b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kxv_Orya.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kxv_Orya_IN.dat b/venv/Lib/site-packages/babel/locale-data/kxv_Orya_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..8a1e28980c4166f7d6b942005b8528d8a3518db7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kxv_Orya_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kxv_Telu.dat b/venv/Lib/site-packages/babel/locale-data/kxv_Telu.dat new file mode 100644 index 0000000000000000000000000000000000000000..1b3ac8b8c11820ad46579b3bed22333a70ce3b10 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kxv_Telu.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/kxv_Telu_IN.dat b/venv/Lib/site-packages/babel/locale-data/kxv_Telu_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..8a1e28980c4166f7d6b942005b8528d8a3518db7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/kxv_Telu_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ky.dat b/venv/Lib/site-packages/babel/locale-data/ky.dat new file mode 100644 index 0000000000000000000000000000000000000000..a83894bfb226b441a82ae33d2c467daa6e827ace --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ky.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c01ffa2fd7172724089ee65b41dc8fd701426cac4ffcb45c0594e8e8ad106db +size 179889 diff --git a/venv/Lib/site-packages/babel/locale-data/ky_KG.dat b/venv/Lib/site-packages/babel/locale-data/ky_KG.dat new file mode 100644 index 0000000000000000000000000000000000000000..c61073fe2d704f7de254bf9937769fb98c59a71b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ky_KG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/la.dat b/venv/Lib/site-packages/babel/locale-data/la.dat new file mode 100644 index 0000000000000000000000000000000000000000..36656dc1b1c3224718d232b827ac5698e976b866 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/la.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/la_VA.dat b/venv/Lib/site-packages/babel/locale-data/la_VA.dat new file mode 100644 index 0000000000000000000000000000000000000000..31a68ac99d364d4c35e937cd4a90fa50580b7f4a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/la_VA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/lag.dat b/venv/Lib/site-packages/babel/locale-data/lag.dat new file mode 100644 index 0000000000000000000000000000000000000000..f8da045f8865c761792921ff7eb145ba8ad5f138 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/lag.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/lag_TZ.dat b/venv/Lib/site-packages/babel/locale-data/lag_TZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..7893a0eda2ad8833be220faac3668ceefcd9031c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/lag_TZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/lb.dat b/venv/Lib/site-packages/babel/locale-data/lb.dat new file mode 100644 index 0000000000000000000000000000000000000000..a5d8338145ffb60ea9090a4b0e0570465e777abf --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/lb.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9541a6f380dfc0b810def0b498bfdfa057f97526592834c8bb00917f9063815b +size 135641 diff --git a/venv/Lib/site-packages/babel/locale-data/lb_LU.dat b/venv/Lib/site-packages/babel/locale-data/lb_LU.dat new file mode 100644 index 0000000000000000000000000000000000000000..bcb56532aa2d3783f530d822f181b8a809f56afb Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/lb_LU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/lg.dat b/venv/Lib/site-packages/babel/locale-data/lg.dat new file mode 100644 index 0000000000000000000000000000000000000000..cd4e5a9d4bed9e9bab2079eb03b1b0b8928756ae Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/lg.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/lg_UG.dat b/venv/Lib/site-packages/babel/locale-data/lg_UG.dat new file mode 100644 index 0000000000000000000000000000000000000000..6ee321dc7f52d05a56322b21460ae97e859f2deb Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/lg_UG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/lij.dat b/venv/Lib/site-packages/babel/locale-data/lij.dat new file mode 100644 index 0000000000000000000000000000000000000000..f3062e4ff76e298ac3e5ea8026eb0291af78e5e5 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/lij.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21cf7cd92b7cda63cc7ee42aa8bb303ed3b2f0b96095f70b624fdfb480cceb94 +size 129648 diff --git a/venv/Lib/site-packages/babel/locale-data/lij_IT.dat b/venv/Lib/site-packages/babel/locale-data/lij_IT.dat new file mode 100644 index 0000000000000000000000000000000000000000..6969b5283273f116c0fe167c4f1b1c72fe05a617 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/lij_IT.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/lkt.dat b/venv/Lib/site-packages/babel/locale-data/lkt.dat new file mode 100644 index 0000000000000000000000000000000000000000..515ac6c47cd8bde606e213d4b5ef4b55b2b92234 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/lkt.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/lkt_US.dat b/venv/Lib/site-packages/babel/locale-data/lkt_US.dat new file mode 100644 index 0000000000000000000000000000000000000000..44a5969a02d4653b44ee1cef9a3ef8c460ded918 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/lkt_US.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/lld.dat b/venv/Lib/site-packages/babel/locale-data/lld.dat new file mode 100644 index 0000000000000000000000000000000000000000..04c0806888b89091b708c58fb431d5067842f8b2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/lld.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/lld_IT.dat b/venv/Lib/site-packages/babel/locale-data/lld_IT.dat new file mode 100644 index 0000000000000000000000000000000000000000..f8d12f0fab6585ad64cc8659af5880982f5a8345 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/lld_IT.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/lmo.dat b/venv/Lib/site-packages/babel/locale-data/lmo.dat new file mode 100644 index 0000000000000000000000000000000000000000..c7388c7dae2ce08b793d8c6f300e31975ed0f186 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/lmo.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/lmo_IT.dat b/venv/Lib/site-packages/babel/locale-data/lmo_IT.dat new file mode 100644 index 0000000000000000000000000000000000000000..50dd59272f2559d925bc535f62656e963fb2a760 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/lmo_IT.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ln.dat b/venv/Lib/site-packages/babel/locale-data/ln.dat new file mode 100644 index 0000000000000000000000000000000000000000..cc8edb15ba028473c951dd30c2fbefecbf8def42 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ln.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ln_AO.dat b/venv/Lib/site-packages/babel/locale-data/ln_AO.dat new file mode 100644 index 0000000000000000000000000000000000000000..60dd0ba87f4635fcacb66dc1b1146c1fab07757c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ln_AO.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ln_CD.dat b/venv/Lib/site-packages/babel/locale-data/ln_CD.dat new file mode 100644 index 0000000000000000000000000000000000000000..b87aad7d28925d9db976365cc1af27dfb736612a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ln_CD.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ln_CF.dat b/venv/Lib/site-packages/babel/locale-data/ln_CF.dat new file mode 100644 index 0000000000000000000000000000000000000000..b5a9a827ee2871c12c330fafdd13ba4d24343b24 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ln_CF.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ln_CG.dat b/venv/Lib/site-packages/babel/locale-data/ln_CG.dat new file mode 100644 index 0000000000000000000000000000000000000000..4059b369e75596e442343fb2c0bedadbb8a5dfe3 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ln_CG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/lo.dat b/venv/Lib/site-packages/babel/locale-data/lo.dat new file mode 100644 index 0000000000000000000000000000000000000000..a239731932e7a09b2d8ac442af5a0d3390c4b034 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/lo.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:857b604f89e4a9bf21ebaf53b1acdf20506c2b6dd036970265baaf6fa497581a +size 189363 diff --git a/venv/Lib/site-packages/babel/locale-data/lo_LA.dat b/venv/Lib/site-packages/babel/locale-data/lo_LA.dat new file mode 100644 index 0000000000000000000000000000000000000000..6f12ab55995942428f0faad4a1bf30ffc6ad8e20 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/lo_LA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/lrc.dat b/venv/Lib/site-packages/babel/locale-data/lrc.dat new file mode 100644 index 0000000000000000000000000000000000000000..4452aa52edf97353fe25e1da4d56ff02de86204e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/lrc.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/lrc_IQ.dat b/venv/Lib/site-packages/babel/locale-data/lrc_IQ.dat new file mode 100644 index 0000000000000000000000000000000000000000..b7fdaf27a0559fedab829c0ca1d18fed93160dd1 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/lrc_IQ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/lrc_IR.dat b/venv/Lib/site-packages/babel/locale-data/lrc_IR.dat new file mode 100644 index 0000000000000000000000000000000000000000..75d897526c32c812a089147faf1d6d4ee1fa9f0d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/lrc_IR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/lt.dat b/venv/Lib/site-packages/babel/locale-data/lt.dat new file mode 100644 index 0000000000000000000000000000000000000000..8e2997f01fcee71e161c8fc69aac992458733ad0 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/lt.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d61e538c5bcd4aeaab137267b539a72cdf705baf637e455a90020809c9a855b7 +size 262613 diff --git a/venv/Lib/site-packages/babel/locale-data/lt_LT.dat b/venv/Lib/site-packages/babel/locale-data/lt_LT.dat new file mode 100644 index 0000000000000000000000000000000000000000..abd28f771f27c9ae600a7bd2319cf2cbc972b96c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/lt_LT.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ltg.dat b/venv/Lib/site-packages/babel/locale-data/ltg.dat new file mode 100644 index 0000000000000000000000000000000000000000..8937b94340aaec75a9952957c4e9596d66f02937 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ltg.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ltg_LV.dat b/venv/Lib/site-packages/babel/locale-data/ltg_LV.dat new file mode 100644 index 0000000000000000000000000000000000000000..6afb15176f5af8c27324b9ddf6372de9959d30c3 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ltg_LV.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/lu.dat b/venv/Lib/site-packages/babel/locale-data/lu.dat new file mode 100644 index 0000000000000000000000000000000000000000..438bb41b1e962e9a330a94a7ca5bb2b8f104959d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/lu.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/lu_CD.dat b/venv/Lib/site-packages/babel/locale-data/lu_CD.dat new file mode 100644 index 0000000000000000000000000000000000000000..b2f405ccf6bc6b294b96546547731a655480d957 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/lu_CD.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/luo.dat b/venv/Lib/site-packages/babel/locale-data/luo.dat new file mode 100644 index 0000000000000000000000000000000000000000..1fbbe68e4cc171e4c2d5fa12a4a1ee5ca9b3366a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/luo.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/luo_KE.dat b/venv/Lib/site-packages/babel/locale-data/luo_KE.dat new file mode 100644 index 0000000000000000000000000000000000000000..9ad4a6a49e0351b00d3b218e1a6123b7dd0dce79 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/luo_KE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/luy.dat b/venv/Lib/site-packages/babel/locale-data/luy.dat new file mode 100644 index 0000000000000000000000000000000000000000..c82c89292138b3a1cb34b0bb8c3ec220463c34cb Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/luy.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/luy_KE.dat b/venv/Lib/site-packages/babel/locale-data/luy_KE.dat new file mode 100644 index 0000000000000000000000000000000000000000..e1b346e46e46347a6bee8be9d548f066a54d089b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/luy_KE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/lv.dat b/venv/Lib/site-packages/babel/locale-data/lv.dat new file mode 100644 index 0000000000000000000000000000000000000000..45fc147dafc4730e2b7ec73057830a953244cd49 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/lv.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b35d286c7b13624045f7dac00c6be4c6ea6ffbe26444f412d9a33ab16bdb3380 +size 201861 diff --git a/venv/Lib/site-packages/babel/locale-data/lv_LV.dat b/venv/Lib/site-packages/babel/locale-data/lv_LV.dat new file mode 100644 index 0000000000000000000000000000000000000000..37bb4e261bb466b1ddd8e02b315a257b0a43557a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/lv_LV.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mai.dat b/venv/Lib/site-packages/babel/locale-data/mai.dat new file mode 100644 index 0000000000000000000000000000000000000000..bde3b353b461a556480f3dd0f859922aa37fe52a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mai.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mai_IN.dat b/venv/Lib/site-packages/babel/locale-data/mai_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..288b92f8a8947a8e0c0ed4472cb29811d4ad3f47 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mai_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mas.dat b/venv/Lib/site-packages/babel/locale-data/mas.dat new file mode 100644 index 0000000000000000000000000000000000000000..7e254ed9466b903dd1389bc1b30f07d12cfef944 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mas.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mas_KE.dat b/venv/Lib/site-packages/babel/locale-data/mas_KE.dat new file mode 100644 index 0000000000000000000000000000000000000000..b264c8371c065ae8a34083e4f335c5cb73cd88f1 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mas_KE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mas_TZ.dat b/venv/Lib/site-packages/babel/locale-data/mas_TZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..d5c71c37f9a2807c88508942f9add20eee7995e8 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mas_TZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mdf.dat b/venv/Lib/site-packages/babel/locale-data/mdf.dat new file mode 100644 index 0000000000000000000000000000000000000000..5d4d3f839e8dbce60b786f9738e8b9216dbfde12 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mdf.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mdf_RU.dat b/venv/Lib/site-packages/babel/locale-data/mdf_RU.dat new file mode 100644 index 0000000000000000000000000000000000000000..9457135938f9f140fcded2860931c6bb14a8aabd Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mdf_RU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mer.dat b/venv/Lib/site-packages/babel/locale-data/mer.dat new file mode 100644 index 0000000000000000000000000000000000000000..f6657fe13d56aee002dd062da1b2ce9aa1a25b93 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mer.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mer_KE.dat b/venv/Lib/site-packages/babel/locale-data/mer_KE.dat new file mode 100644 index 0000000000000000000000000000000000000000..a7c286f72bb11d021537e292f6efd6bdbe19ea55 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mer_KE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mfe.dat b/venv/Lib/site-packages/babel/locale-data/mfe.dat new file mode 100644 index 0000000000000000000000000000000000000000..10eef776c01ea1debd6da686d7e74579d269f1a3 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mfe.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mfe_MU.dat b/venv/Lib/site-packages/babel/locale-data/mfe_MU.dat new file mode 100644 index 0000000000000000000000000000000000000000..2f4715ba083648ed21845f0e48b0f1808266b37f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mfe_MU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mg.dat b/venv/Lib/site-packages/babel/locale-data/mg.dat new file mode 100644 index 0000000000000000000000000000000000000000..f91a1dd194af199229fd02d8ac8ae03d07f9aefa Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mg.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mg_MG.dat b/venv/Lib/site-packages/babel/locale-data/mg_MG.dat new file mode 100644 index 0000000000000000000000000000000000000000..9e18e6cb756b87633bd09a2102d2f6844008e201 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mg_MG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mgh.dat b/venv/Lib/site-packages/babel/locale-data/mgh.dat new file mode 100644 index 0000000000000000000000000000000000000000..e8a28060538c61b1420bb56b67737c1c04f8a154 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mgh.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mgh_MZ.dat b/venv/Lib/site-packages/babel/locale-data/mgh_MZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..999e8efb02c824f2ee9b44e396f4b750de11d276 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mgh_MZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mgo.dat b/venv/Lib/site-packages/babel/locale-data/mgo.dat new file mode 100644 index 0000000000000000000000000000000000000000..edbda97941e390080a9c3a32bb144c0978ff1384 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mgo.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mgo_CM.dat b/venv/Lib/site-packages/babel/locale-data/mgo_CM.dat new file mode 100644 index 0000000000000000000000000000000000000000..667c017285337c4b48c3bdc86047738a83888882 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mgo_CM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mhn.dat b/venv/Lib/site-packages/babel/locale-data/mhn.dat new file mode 100644 index 0000000000000000000000000000000000000000..1a3303d9b5daedb0cc2d5c4d29d18b3f3ff2b246 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mhn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mhn_IT.dat b/venv/Lib/site-packages/babel/locale-data/mhn_IT.dat new file mode 100644 index 0000000000000000000000000000000000000000..c647205542d73e8daa4ecf485cd244deabf3c33e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mhn_IT.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mi.dat b/venv/Lib/site-packages/babel/locale-data/mi.dat new file mode 100644 index 0000000000000000000000000000000000000000..79eb095aa3549568dfb2542817542c8bed633a24 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mi.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mi_NZ.dat b/venv/Lib/site-packages/babel/locale-data/mi_NZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..7c8b4d19b8e9e4e3840b296766d8469ddde66f29 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mi_NZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mic.dat b/venv/Lib/site-packages/babel/locale-data/mic.dat new file mode 100644 index 0000000000000000000000000000000000000000..3ca1892e1d51369f5a68369b8c12da3bfb230daf Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mic.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mic_CA.dat b/venv/Lib/site-packages/babel/locale-data/mic_CA.dat new file mode 100644 index 0000000000000000000000000000000000000000..f43465a947872a0f4ec053bd7c88228619d50efb Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mic_CA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mk.dat b/venv/Lib/site-packages/babel/locale-data/mk.dat new file mode 100644 index 0000000000000000000000000000000000000000..a9db94a9fda8c1efc8c39dbbfa6ea7b5736960ce --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/mk.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c55254f9ab9bc36150fd31f305419de4b1d1e485355631a43ce7911e953e4fdf +size 216606 diff --git a/venv/Lib/site-packages/babel/locale-data/mk_MK.dat b/venv/Lib/site-packages/babel/locale-data/mk_MK.dat new file mode 100644 index 0000000000000000000000000000000000000000..33207d9a9960ba975c30fd1b4c2d6f418bee86fa Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mk_MK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ml.dat b/venv/Lib/site-packages/babel/locale-data/ml.dat new file mode 100644 index 0000000000000000000000000000000000000000..d60b610262c8176aabc108391cd97467e477fbf4 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ml.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b51d25b76b90bb39ac0605d622e469cfe0330f4d12fceaef2dcf909226005fe5 +size 246736 diff --git a/venv/Lib/site-packages/babel/locale-data/ml_IN.dat b/venv/Lib/site-packages/babel/locale-data/ml_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..5f89f111a5decfceccfb95ad80d6e552253c3268 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ml_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mn.dat b/venv/Lib/site-packages/babel/locale-data/mn.dat new file mode 100644 index 0000000000000000000000000000000000000000..9e47305c6dcf164de7f3963e3c0bd73d649eef2c --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/mn.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b7a12a670dddcfb7e751af0760d6fdb8e52e88ca6dd2067659de0a8e8505b90 +size 183647 diff --git a/venv/Lib/site-packages/babel/locale-data/mn_MN.dat b/venv/Lib/site-packages/babel/locale-data/mn_MN.dat new file mode 100644 index 0000000000000000000000000000000000000000..096cb10478eefce99d693c2877f3d1e444c3a75b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mn_MN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mn_Mong.dat b/venv/Lib/site-packages/babel/locale-data/mn_Mong.dat new file mode 100644 index 0000000000000000000000000000000000000000..287f85265b30743065120e2fa442bb5bfc54492f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mn_Mong.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mn_Mong_CN.dat b/venv/Lib/site-packages/babel/locale-data/mn_Mong_CN.dat new file mode 100644 index 0000000000000000000000000000000000000000..284cbee85de0bc4210e44769410b40a617b5b494 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mn_Mong_CN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mn_Mong_MN.dat b/venv/Lib/site-packages/babel/locale-data/mn_Mong_MN.dat new file mode 100644 index 0000000000000000000000000000000000000000..ad54681c07d5d696d72bba8f9a49c02c2d86baed Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mn_Mong_MN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mni.dat b/venv/Lib/site-packages/babel/locale-data/mni.dat new file mode 100644 index 0000000000000000000000000000000000000000..4ebcfc59aad390f57e5af3047d0d522d31ebdb50 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mni.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mni_Beng.dat b/venv/Lib/site-packages/babel/locale-data/mni_Beng.dat new file mode 100644 index 0000000000000000000000000000000000000000..de357a87140a76e8342b6d9c7fb878a91b06ced8 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mni_Beng.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mni_Beng_IN.dat b/venv/Lib/site-packages/babel/locale-data/mni_Beng_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..28787ccd0c661f1d3765f33dad8f51154d52ab47 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mni_Beng_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mni_Mtei.dat b/venv/Lib/site-packages/babel/locale-data/mni_Mtei.dat new file mode 100644 index 0000000000000000000000000000000000000000..654042f8bb4c2da1fb319cf9ec89d64d61458188 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mni_Mtei.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mni_Mtei_IN.dat b/venv/Lib/site-packages/babel/locale-data/mni_Mtei_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..28787ccd0c661f1d3765f33dad8f51154d52ab47 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mni_Mtei_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/moh.dat b/venv/Lib/site-packages/babel/locale-data/moh.dat new file mode 100644 index 0000000000000000000000000000000000000000..c301f3f730cdf8e657f9af60771d1ce434dd7db8 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/moh.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/moh_CA.dat b/venv/Lib/site-packages/babel/locale-data/moh_CA.dat new file mode 100644 index 0000000000000000000000000000000000000000..ba2eddea629cd2557f9bdd3e48cfe2be012bdf3f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/moh_CA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mr.dat b/venv/Lib/site-packages/babel/locale-data/mr.dat new file mode 100644 index 0000000000000000000000000000000000000000..d0958952b8b3b42bbfbc512c0a1fdf4d7b48de7a --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/mr.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:506d0592e7d4b50eeabf370afd610d46ae9280fcb8cc072f8980d02fe36b198f +size 234157 diff --git a/venv/Lib/site-packages/babel/locale-data/mr_IN.dat b/venv/Lib/site-packages/babel/locale-data/mr_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..a57af72d972822e818300a8c827367a7362d2b4a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mr_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ms.dat b/venv/Lib/site-packages/babel/locale-data/ms.dat new file mode 100644 index 0000000000000000000000000000000000000000..fceed36bae81315f608d04ec529a974bae74d4bb --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ms.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:97f610a1be30e2376ed14f99f9e3182b66cf0325345de7a46abd28953e46db5b +size 114970 diff --git a/venv/Lib/site-packages/babel/locale-data/ms_Arab.dat b/venv/Lib/site-packages/babel/locale-data/ms_Arab.dat new file mode 100644 index 0000000000000000000000000000000000000000..7ee5bee07c52d8711e69205a711aee26f4fd91d2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ms_Arab.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ms_Arab_BN.dat b/venv/Lib/site-packages/babel/locale-data/ms_Arab_BN.dat new file mode 100644 index 0000000000000000000000000000000000000000..1785baa75df82ae8b657074e9ec1d894ece1c20a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ms_Arab_BN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ms_Arab_MY.dat b/venv/Lib/site-packages/babel/locale-data/ms_Arab_MY.dat new file mode 100644 index 0000000000000000000000000000000000000000..5df0cb7512eee5622689658266dfa12550f73321 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ms_Arab_MY.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ms_BN.dat b/venv/Lib/site-packages/babel/locale-data/ms_BN.dat new file mode 100644 index 0000000000000000000000000000000000000000..1785baa75df82ae8b657074e9ec1d894ece1c20a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ms_BN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ms_ID.dat b/venv/Lib/site-packages/babel/locale-data/ms_ID.dat new file mode 100644 index 0000000000000000000000000000000000000000..07b0e7693690a52fa6abbbac6388fc95bcd01210 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ms_ID.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ms_MY.dat b/venv/Lib/site-packages/babel/locale-data/ms_MY.dat new file mode 100644 index 0000000000000000000000000000000000000000..5df0cb7512eee5622689658266dfa12550f73321 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ms_MY.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ms_SG.dat b/venv/Lib/site-packages/babel/locale-data/ms_SG.dat new file mode 100644 index 0000000000000000000000000000000000000000..33205113e184c9337fc92ac987a32e68b16c7325 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ms_SG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mt.dat b/venv/Lib/site-packages/babel/locale-data/mt.dat new file mode 100644 index 0000000000000000000000000000000000000000..502594b2908c824af35e6fb29e5212de1500fedc Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mt.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mt_MT.dat b/venv/Lib/site-packages/babel/locale-data/mt_MT.dat new file mode 100644 index 0000000000000000000000000000000000000000..9f4731e41b870956c24fa2e322e292705bcc1ff2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mt_MT.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mua.dat b/venv/Lib/site-packages/babel/locale-data/mua.dat new file mode 100644 index 0000000000000000000000000000000000000000..7d28adf1b12cfc6b77afbbc3959132275f1a9f96 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mua.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mua_CM.dat b/venv/Lib/site-packages/babel/locale-data/mua_CM.dat new file mode 100644 index 0000000000000000000000000000000000000000..5b71a89b73f4e0225d52cfe9a9efb20fd197bde9 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mua_CM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mus.dat b/venv/Lib/site-packages/babel/locale-data/mus.dat new file mode 100644 index 0000000000000000000000000000000000000000..b323269db48c396fa6b73444439b0a8cb15a1046 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mus.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mus_US.dat b/venv/Lib/site-packages/babel/locale-data/mus_US.dat new file mode 100644 index 0000000000000000000000000000000000000000..a506b8bdc53b29aa79518d3a7ac160cfdfe85fba Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mus_US.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/my.dat b/venv/Lib/site-packages/babel/locale-data/my.dat new file mode 100644 index 0000000000000000000000000000000000000000..0bf3edbf73a53d95c75a8f696d04912a7dd08ee7 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/my.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5cae4ff6b7254f2811ff6160bf0f487ca359db1c7f64df87b8d78272c0cffa1 +size 183534 diff --git a/venv/Lib/site-packages/babel/locale-data/my_MM.dat b/venv/Lib/site-packages/babel/locale-data/my_MM.dat new file mode 100644 index 0000000000000000000000000000000000000000..33bc9111bc7d012bd403d66369cc6c854e32bb40 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/my_MM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/myv.dat b/venv/Lib/site-packages/babel/locale-data/myv.dat new file mode 100644 index 0000000000000000000000000000000000000000..896bdd71e70083976936fe2c146e4688ccdf074f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/myv.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/myv_RU.dat b/venv/Lib/site-packages/babel/locale-data/myv_RU.dat new file mode 100644 index 0000000000000000000000000000000000000000..de64fee658593881d312351505ea347eeae06f7e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/myv_RU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mzn.dat b/venv/Lib/site-packages/babel/locale-data/mzn.dat new file mode 100644 index 0000000000000000000000000000000000000000..51d9f1323d3bca270ea4e58b3ed8843bc5b6902f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mzn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/mzn_IR.dat b/venv/Lib/site-packages/babel/locale-data/mzn_IR.dat new file mode 100644 index 0000000000000000000000000000000000000000..73990744c34b9dc21913fb29a7a2a7cb2fce118b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/mzn_IR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/naq.dat b/venv/Lib/site-packages/babel/locale-data/naq.dat new file mode 100644 index 0000000000000000000000000000000000000000..786b2ffedea8a833d5b635e02907404f6a235388 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/naq.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/naq_NA.dat b/venv/Lib/site-packages/babel/locale-data/naq_NA.dat new file mode 100644 index 0000000000000000000000000000000000000000..82c109a0e40453c362ef5af05fc22ee11ef15d2c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/naq_NA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nb.dat b/venv/Lib/site-packages/babel/locale-data/nb.dat new file mode 100644 index 0000000000000000000000000000000000000000..5abc2536ec7d0e253ec14958960b83981c94df6c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nb.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nb_NO.dat b/venv/Lib/site-packages/babel/locale-data/nb_NO.dat new file mode 100644 index 0000000000000000000000000000000000000000..fc57a39a55e6f0d10d4bdeb99da1c49e16111b66 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nb_NO.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nb_SJ.dat b/venv/Lib/site-packages/babel/locale-data/nb_SJ.dat new file mode 100644 index 0000000000000000000000000000000000000000..9af3a275de68e92a628034bcc058d913aa1f99b4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nb_SJ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nd.dat b/venv/Lib/site-packages/babel/locale-data/nd.dat new file mode 100644 index 0000000000000000000000000000000000000000..c13781ab1845c9e17e776fc7633d5c6b03cbfc7b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nd.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nd_ZW.dat b/venv/Lib/site-packages/babel/locale-data/nd_ZW.dat new file mode 100644 index 0000000000000000000000000000000000000000..bb86d3f6ae698e8f87e8a34483f98cee09460fb9 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nd_ZW.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nds.dat b/venv/Lib/site-packages/babel/locale-data/nds.dat new file mode 100644 index 0000000000000000000000000000000000000000..e1c76cae91eba026aa8ba057d694465376c5d940 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nds.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nds_DE.dat b/venv/Lib/site-packages/babel/locale-data/nds_DE.dat new file mode 100644 index 0000000000000000000000000000000000000000..771fba3e2ecb6b40cad0a4343eeb490c10b1c802 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nds_DE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nds_NL.dat b/venv/Lib/site-packages/babel/locale-data/nds_NL.dat new file mode 100644 index 0000000000000000000000000000000000000000..14b9b12306790de2097804d28e8e9ea2ab92740e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nds_NL.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ne.dat b/venv/Lib/site-packages/babel/locale-data/ne.dat new file mode 100644 index 0000000000000000000000000000000000000000..fbaf6cdf77f567876b3521d0453220006ece12df --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ne.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e4e6fc214aee75f269eb20b3847926602da6915635b1dd7423bf69497ceea6cd +size 210152 diff --git a/venv/Lib/site-packages/babel/locale-data/ne_IN.dat b/venv/Lib/site-packages/babel/locale-data/ne_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..647efe6d89a1cc182a20e0c20247296f92834a0c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ne_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ne_NP.dat b/venv/Lib/site-packages/babel/locale-data/ne_NP.dat new file mode 100644 index 0000000000000000000000000000000000000000..5c513db988b647f59c5b8f0daa7147efb43a53e3 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ne_NP.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nl.dat b/venv/Lib/site-packages/babel/locale-data/nl.dat new file mode 100644 index 0000000000000000000000000000000000000000..9a0e02df561051044148b33ef79a0baa8ba8a9b7 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/nl.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ccee793d05b9c163338d19941848b99781f50f5ac2f74350b76eb68db448cb36 +size 150031 diff --git a/venv/Lib/site-packages/babel/locale-data/nl_AW.dat b/venv/Lib/site-packages/babel/locale-data/nl_AW.dat new file mode 100644 index 0000000000000000000000000000000000000000..0bd826c468a7010a777176528b95795c904423d4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nl_AW.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nl_BE.dat b/venv/Lib/site-packages/babel/locale-data/nl_BE.dat new file mode 100644 index 0000000000000000000000000000000000000000..4023b7a2a8975e37c6e2b4df17d34c0d7e95354b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nl_BE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nl_BQ.dat b/venv/Lib/site-packages/babel/locale-data/nl_BQ.dat new file mode 100644 index 0000000000000000000000000000000000000000..8f686f79c1bcf0273415016ebaee024a15c79ff2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nl_BQ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nl_CW.dat b/venv/Lib/site-packages/babel/locale-data/nl_CW.dat new file mode 100644 index 0000000000000000000000000000000000000000..ea3eb94fe8753e8e1ea147664f09f6b1ce4903b2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nl_CW.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nl_NL.dat b/venv/Lib/site-packages/babel/locale-data/nl_NL.dat new file mode 100644 index 0000000000000000000000000000000000000000..c686473e2ce475ef8c48fa1595e2ad5179d7b014 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nl_NL.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nl_SR.dat b/venv/Lib/site-packages/babel/locale-data/nl_SR.dat new file mode 100644 index 0000000000000000000000000000000000000000..6ffb0f92c9f2219111867a3ac57fab37c3f1b44f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nl_SR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nl_SX.dat b/venv/Lib/site-packages/babel/locale-data/nl_SX.dat new file mode 100644 index 0000000000000000000000000000000000000000..6932aa19fdf9f10afa37ad18d667e7b5ab329c9c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nl_SX.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nmg.dat b/venv/Lib/site-packages/babel/locale-data/nmg.dat new file mode 100644 index 0000000000000000000000000000000000000000..1e508106d4c505b1a447dcfe3ae7d44675222bfd Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nmg.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nmg_CM.dat b/venv/Lib/site-packages/babel/locale-data/nmg_CM.dat new file mode 100644 index 0000000000000000000000000000000000000000..f675485dbffb6757f2c4c527c9265c6f9d234b72 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nmg_CM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nn.dat b/venv/Lib/site-packages/babel/locale-data/nn.dat new file mode 100644 index 0000000000000000000000000000000000000000..fde5bfc99a3bdfbcc428f9002eb2d1ede104a206 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nn_NO.dat b/venv/Lib/site-packages/babel/locale-data/nn_NO.dat new file mode 100644 index 0000000000000000000000000000000000000000..0e233b7d2ae91fc1fa221785eb341dd8f0837f94 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nn_NO.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nnh.dat b/venv/Lib/site-packages/babel/locale-data/nnh.dat new file mode 100644 index 0000000000000000000000000000000000000000..2389679051264463b4622188dc3be6e7b3f47918 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nnh.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nnh_CM.dat b/venv/Lib/site-packages/babel/locale-data/nnh_CM.dat new file mode 100644 index 0000000000000000000000000000000000000000..7722c099277483aea5ce2d679da8f078fe8a5770 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nnh_CM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/no.dat b/venv/Lib/site-packages/babel/locale-data/no.dat new file mode 100644 index 0000000000000000000000000000000000000000..0ded99c41631fbd77fc54f051eed1367c5e0ef71 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/no.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7191257d6f00ca58a2ba7661886991a8e2c9df90e37d789529dfebaf9440b5c +size 191212 diff --git a/venv/Lib/site-packages/babel/locale-data/nqo.dat b/venv/Lib/site-packages/babel/locale-data/nqo.dat new file mode 100644 index 0000000000000000000000000000000000000000..3cdde1276cd5c5dceb8c6f2f212a50ede7763e14 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/nqo.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:550cdc0279149c011300bf31a2c5c1b1096d942e32aa949934c930b6c58f4602 +size 109412 diff --git a/venv/Lib/site-packages/babel/locale-data/nqo_GN.dat b/venv/Lib/site-packages/babel/locale-data/nqo_GN.dat new file mode 100644 index 0000000000000000000000000000000000000000..3cdbcbcd5ae4700ac750c9e3a24b1f0338088001 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nqo_GN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nr.dat b/venv/Lib/site-packages/babel/locale-data/nr.dat new file mode 100644 index 0000000000000000000000000000000000000000..1306c925de68f0494c58a8bbae38d23e6c84a224 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nr.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nr_ZA.dat b/venv/Lib/site-packages/babel/locale-data/nr_ZA.dat new file mode 100644 index 0000000000000000000000000000000000000000..ff0ba0b081864023c8dc43e26fc41dba3ed8ae38 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nr_ZA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nso.dat b/venv/Lib/site-packages/babel/locale-data/nso.dat new file mode 100644 index 0000000000000000000000000000000000000000..25529c1af5588d068f2c17c89caff64ef7818b70 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nso.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nso_ZA.dat b/venv/Lib/site-packages/babel/locale-data/nso_ZA.dat new file mode 100644 index 0000000000000000000000000000000000000000..42f9efca9ca91ded4ab6bb32c1d8500f7eb83050 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nso_ZA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nus.dat b/venv/Lib/site-packages/babel/locale-data/nus.dat new file mode 100644 index 0000000000000000000000000000000000000000..6bc938281e5c8dd2ae139c32a3e097f70f84a57f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nus.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nus_SS.dat b/venv/Lib/site-packages/babel/locale-data/nus_SS.dat new file mode 100644 index 0000000000000000000000000000000000000000..b8b86575ec1940f98bef06533bf3d049e3de8ffc Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nus_SS.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nv.dat b/venv/Lib/site-packages/babel/locale-data/nv.dat new file mode 100644 index 0000000000000000000000000000000000000000..146e037b9543e98059b19a19639bf6b6c028eb68 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nv.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nv_US.dat b/venv/Lib/site-packages/babel/locale-data/nv_US.dat new file mode 100644 index 0000000000000000000000000000000000000000..2c78aa76506372a1532d53bac1b8e42e53677c51 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nv_US.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ny.dat b/venv/Lib/site-packages/babel/locale-data/ny.dat new file mode 100644 index 0000000000000000000000000000000000000000..e1fc061388f76d4949d585278c1b5809552e1996 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ny.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ny_MW.dat b/venv/Lib/site-packages/babel/locale-data/ny_MW.dat new file mode 100644 index 0000000000000000000000000000000000000000..003925586cac629d3ee8905b84490e4c68b0501f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ny_MW.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nyn.dat b/venv/Lib/site-packages/babel/locale-data/nyn.dat new file mode 100644 index 0000000000000000000000000000000000000000..ccd34096be729fa5b770ce802d74273ec91c6c26 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nyn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/nyn_UG.dat b/venv/Lib/site-packages/babel/locale-data/nyn_UG.dat new file mode 100644 index 0000000000000000000000000000000000000000..2e51c77b7f00af6db1bf126b0cf0905121ceed64 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/nyn_UG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/oc.dat b/venv/Lib/site-packages/babel/locale-data/oc.dat new file mode 100644 index 0000000000000000000000000000000000000000..b678c283ab791173b7f8d3b380937fac4843dd81 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/oc.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/oc_ES.dat b/venv/Lib/site-packages/babel/locale-data/oc_ES.dat new file mode 100644 index 0000000000000000000000000000000000000000..936a4bacaf1d69c4be16af8b8552127154dbaa44 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/oc_ES.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/oc_FR.dat b/venv/Lib/site-packages/babel/locale-data/oc_FR.dat new file mode 100644 index 0000000000000000000000000000000000000000..613abbe703e300c4514c9ef5f0f5a1d5d6565bc0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/oc_FR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/om.dat b/venv/Lib/site-packages/babel/locale-data/om.dat new file mode 100644 index 0000000000000000000000000000000000000000..c83455ff1ae8c40c618939a71d45d7e3fd6fec61 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/om.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/om_ET.dat b/venv/Lib/site-packages/babel/locale-data/om_ET.dat new file mode 100644 index 0000000000000000000000000000000000000000..82c438b4bdfe6d49fdec95ed1410a4d375a0f8a4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/om_ET.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/om_KE.dat b/venv/Lib/site-packages/babel/locale-data/om_KE.dat new file mode 100644 index 0000000000000000000000000000000000000000..daf3734d8bc3321ec6c6e6f46cec5bc18e8bf6c6 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/om_KE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/or.dat b/venv/Lib/site-packages/babel/locale-data/or.dat new file mode 100644 index 0000000000000000000000000000000000000000..fbf2098673cf4627222a8e1a73ed745d5c89abfb --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/or.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ddcdc2c20be051a6bb590659bca6f421bc629edb34ea8d033524f419ac66a93 +size 226771 diff --git a/venv/Lib/site-packages/babel/locale-data/or_IN.dat b/venv/Lib/site-packages/babel/locale-data/or_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..12b4f1bcbbce3f411f945bbcdaaee98c6c42350c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/or_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/os.dat b/venv/Lib/site-packages/babel/locale-data/os.dat new file mode 100644 index 0000000000000000000000000000000000000000..a90e8198ee26d4118dc21ca1e8a1da0ca1bdbea5 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/os.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/os_GE.dat b/venv/Lib/site-packages/babel/locale-data/os_GE.dat new file mode 100644 index 0000000000000000000000000000000000000000..205ddbf23aea70eb4ad61d0e4de3d7d4ec9d2c5a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/os_GE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/os_RU.dat b/venv/Lib/site-packages/babel/locale-data/os_RU.dat new file mode 100644 index 0000000000000000000000000000000000000000..f51d3d917392be3c302134ec56c2935ca1cb23b2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/os_RU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/osa.dat b/venv/Lib/site-packages/babel/locale-data/osa.dat new file mode 100644 index 0000000000000000000000000000000000000000..eb1d4ff42ffa3247631b07605977997ac1b02ba4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/osa.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/osa_US.dat b/venv/Lib/site-packages/babel/locale-data/osa_US.dat new file mode 100644 index 0000000000000000000000000000000000000000..03c110027bf4fc1ed63dbd85ad525ec60fa65e77 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/osa_US.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/pa.dat b/venv/Lib/site-packages/babel/locale-data/pa.dat new file mode 100644 index 0000000000000000000000000000000000000000..c81978e5b2ca99d1fb2773a3756619cbd49d9280 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/pa.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4c4eeff56a0510a9509a33b541e5f7bdc0ce39304b1f5640f2ce42a9e949541 +size 202684 diff --git a/venv/Lib/site-packages/babel/locale-data/pa_Arab.dat b/venv/Lib/site-packages/babel/locale-data/pa_Arab.dat new file mode 100644 index 0000000000000000000000000000000000000000..0d02acbd475a0e8dde9a58b0986bf85601c20630 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/pa_Arab.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/pa_Arab_PK.dat b/venv/Lib/site-packages/babel/locale-data/pa_Arab_PK.dat new file mode 100644 index 0000000000000000000000000000000000000000..eefdeba166313b4fc73728951d7b40134f0059fe Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/pa_Arab_PK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/pa_Guru.dat b/venv/Lib/site-packages/babel/locale-data/pa_Guru.dat new file mode 100644 index 0000000000000000000000000000000000000000..ed8c6b6f0425c4510e391e282e72733dc130d21d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/pa_Guru.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/pa_Guru_IN.dat b/venv/Lib/site-packages/babel/locale-data/pa_Guru_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..6af3517d71095fa5f27b527915d1a8871017af84 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/pa_Guru_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/pap.dat b/venv/Lib/site-packages/babel/locale-data/pap.dat new file mode 100644 index 0000000000000000000000000000000000000000..68b8dc4626d6a72322b5dd754766fc846e39e4b5 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/pap.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/pap_AW.dat b/venv/Lib/site-packages/babel/locale-data/pap_AW.dat new file mode 100644 index 0000000000000000000000000000000000000000..973cc7637c55c10d66dad0ab3d92a98c5897ce32 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/pap_AW.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/pap_CW.dat b/venv/Lib/site-packages/babel/locale-data/pap_CW.dat new file mode 100644 index 0000000000000000000000000000000000000000..3c481d471cdc3c17c26a82434e7d66c81070930e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/pap_CW.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/pcm.dat b/venv/Lib/site-packages/babel/locale-data/pcm.dat new file mode 100644 index 0000000000000000000000000000000000000000..412ced0147e88e7ff7c50cba012041d2e8cd55c4 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/pcm.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04fc80a0ecc0ecfa566781bdc3634c073bb526ab57c2765b7824ab2e4ee3f90b +size 161833 diff --git a/venv/Lib/site-packages/babel/locale-data/pcm_NG.dat b/venv/Lib/site-packages/babel/locale-data/pcm_NG.dat new file mode 100644 index 0000000000000000000000000000000000000000..7ee82746f22bcd192bab118da5ceaa98d4fa1a36 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/pcm_NG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/pis.dat b/venv/Lib/site-packages/babel/locale-data/pis.dat new file mode 100644 index 0000000000000000000000000000000000000000..55726a02fcfe8efcec0209eae4b2571bc180ccd6 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/pis.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/pis_SB.dat b/venv/Lib/site-packages/babel/locale-data/pis_SB.dat new file mode 100644 index 0000000000000000000000000000000000000000..3b1f17cde15d79277dcda75fd0c662b1f5d9c440 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/pis_SB.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/pl.dat b/venv/Lib/site-packages/babel/locale-data/pl.dat new file mode 100644 index 0000000000000000000000000000000000000000..e9efd8744ba9667b78add4afd8430c5a48374c70 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/pl.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd691cf670ff229ce88fe9eeca646e08b7560f7746ff0422706404e4da6348b5 +size 227506 diff --git a/venv/Lib/site-packages/babel/locale-data/pl_PL.dat b/venv/Lib/site-packages/babel/locale-data/pl_PL.dat new file mode 100644 index 0000000000000000000000000000000000000000..7a4339abac54c5a104e8dae0ee24a67d75bf51a3 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/pl_PL.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/prg.dat b/venv/Lib/site-packages/babel/locale-data/prg.dat new file mode 100644 index 0000000000000000000000000000000000000000..06219914d6b96ee3ef9d57adcdf6348b21cc253e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/prg.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/prg_PL.dat b/venv/Lib/site-packages/babel/locale-data/prg_PL.dat new file mode 100644 index 0000000000000000000000000000000000000000..7b1970517c0e7eda3f412ab77eae5a628c6b080a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/prg_PL.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ps.dat b/venv/Lib/site-packages/babel/locale-data/ps.dat new file mode 100644 index 0000000000000000000000000000000000000000..d865951f09e7631e7a723f01f6b0ff06067eed29 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ps.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d98bee9fb79195612487a3a6fd0c5d5b71eadc0c3262aa0cf27d38d7c56371b5 +size 158607 diff --git a/venv/Lib/site-packages/babel/locale-data/ps_AF.dat b/venv/Lib/site-packages/babel/locale-data/ps_AF.dat new file mode 100644 index 0000000000000000000000000000000000000000..94a50bffb0731a4244db3bc63bccc03552ae2d46 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ps_AF.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ps_PK.dat b/venv/Lib/site-packages/babel/locale-data/ps_PK.dat new file mode 100644 index 0000000000000000000000000000000000000000..691557eaaa20262a7dd86f8598f0c1543fa3e6ad Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ps_PK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/pt.dat b/venv/Lib/site-packages/babel/locale-data/pt.dat new file mode 100644 index 0000000000000000000000000000000000000000..0156921021d7ef6552b188e54d8897a710bc1232 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/pt.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e836ff7bfb5018b268a7cd36a4c8fc69e34672e2b16bd88a4c265804d33872bb +size 183448 diff --git a/venv/Lib/site-packages/babel/locale-data/pt_AO.dat b/venv/Lib/site-packages/babel/locale-data/pt_AO.dat new file mode 100644 index 0000000000000000000000000000000000000000..4cd1fbdac7cfc218a0c9ab5dad23b260c0a6d91a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/pt_AO.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/pt_BR.dat b/venv/Lib/site-packages/babel/locale-data/pt_BR.dat new file mode 100644 index 0000000000000000000000000000000000000000..22952c77d0156d99b1a57a17c6d3f4a2ec34fd83 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/pt_BR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/pt_CH.dat b/venv/Lib/site-packages/babel/locale-data/pt_CH.dat new file mode 100644 index 0000000000000000000000000000000000000000..268428655db5c8288d57d534df4d70b91453d16d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/pt_CH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/pt_CV.dat b/venv/Lib/site-packages/babel/locale-data/pt_CV.dat new file mode 100644 index 0000000000000000000000000000000000000000..78e2bbcf844a54d1973d06425f237743e89549b0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/pt_CV.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/pt_GQ.dat b/venv/Lib/site-packages/babel/locale-data/pt_GQ.dat new file mode 100644 index 0000000000000000000000000000000000000000..88968337f024e2090db6a647e327b3da3e3ae981 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/pt_GQ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/pt_GW.dat b/venv/Lib/site-packages/babel/locale-data/pt_GW.dat new file mode 100644 index 0000000000000000000000000000000000000000..d44108a14b441bb8e6befd35965e43a4278798e8 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/pt_GW.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/pt_LU.dat b/venv/Lib/site-packages/babel/locale-data/pt_LU.dat new file mode 100644 index 0000000000000000000000000000000000000000..af0b45b3dfa18f4a64fad761f6ecb6461986db26 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/pt_LU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/pt_MO.dat b/venv/Lib/site-packages/babel/locale-data/pt_MO.dat new file mode 100644 index 0000000000000000000000000000000000000000..4fcee0991caf305b91bec53eaf4499180449fa02 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/pt_MO.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/pt_MZ.dat b/venv/Lib/site-packages/babel/locale-data/pt_MZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..198075e8198e9bbcb9a3d49ab8ae1e912c572792 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/pt_MZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/pt_PT.dat b/venv/Lib/site-packages/babel/locale-data/pt_PT.dat new file mode 100644 index 0000000000000000000000000000000000000000..aa6a6ccb9080927139e20b0cc32493ca5c9b43f3 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/pt_PT.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/pt_ST.dat b/venv/Lib/site-packages/babel/locale-data/pt_ST.dat new file mode 100644 index 0000000000000000000000000000000000000000..cdccab774c4c8a1949ea8c9c3a42133a702d4e66 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/pt_ST.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/pt_TL.dat b/venv/Lib/site-packages/babel/locale-data/pt_TL.dat new file mode 100644 index 0000000000000000000000000000000000000000..7bb756cda597ecabd0864f06d527d249ed7ec3d3 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/pt_TL.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/qu.dat b/venv/Lib/site-packages/babel/locale-data/qu.dat new file mode 100644 index 0000000000000000000000000000000000000000..85cc9eca812e0277658be03e451a0b8aa1a9d412 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/qu.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/qu_BO.dat b/venv/Lib/site-packages/babel/locale-data/qu_BO.dat new file mode 100644 index 0000000000000000000000000000000000000000..bc994ff71279cddb8ff5f163e6c55b13603cfdb6 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/qu_BO.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/qu_EC.dat b/venv/Lib/site-packages/babel/locale-data/qu_EC.dat new file mode 100644 index 0000000000000000000000000000000000000000..8f7f46ad54b91576184c6b8c63dcc996b333f504 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/qu_EC.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/qu_PE.dat b/venv/Lib/site-packages/babel/locale-data/qu_PE.dat new file mode 100644 index 0000000000000000000000000000000000000000..07aacf94b96a35e1e5305c9539acf688c6f355b2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/qu_PE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/quc.dat b/venv/Lib/site-packages/babel/locale-data/quc.dat new file mode 100644 index 0000000000000000000000000000000000000000..f7e02d8abcbdbace395dc68ab09f34cb6f8e8538 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/quc.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/quc_GT.dat b/venv/Lib/site-packages/babel/locale-data/quc_GT.dat new file mode 100644 index 0000000000000000000000000000000000000000..c14f849cbbb44e7186dfce2305d938dccb991c23 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/quc_GT.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/raj.dat b/venv/Lib/site-packages/babel/locale-data/raj.dat new file mode 100644 index 0000000000000000000000000000000000000000..8f4477fa0201ca11adf07c795bc48a13ab188712 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/raj.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/raj_IN.dat b/venv/Lib/site-packages/babel/locale-data/raj_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..e56e75027f47427213473db8b21702ff874b6c75 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/raj_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/rhg.dat b/venv/Lib/site-packages/babel/locale-data/rhg.dat new file mode 100644 index 0000000000000000000000000000000000000000..192bbff035a534ee3776e2c02598e74b591cd8c0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/rhg.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/rhg_Rohg.dat b/venv/Lib/site-packages/babel/locale-data/rhg_Rohg.dat new file mode 100644 index 0000000000000000000000000000000000000000..01b82ecf252b8e27e8e21cd8ba16f40c5b5de863 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/rhg_Rohg.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/rhg_Rohg_BD.dat b/venv/Lib/site-packages/babel/locale-data/rhg_Rohg_BD.dat new file mode 100644 index 0000000000000000000000000000000000000000..cc14c7f83aba67864d14968a00ba2937e7adcd94 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/rhg_Rohg_BD.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/rhg_Rohg_MM.dat b/venv/Lib/site-packages/babel/locale-data/rhg_Rohg_MM.dat new file mode 100644 index 0000000000000000000000000000000000000000..6cfde86150cf0c630c1a25eaf24544221d3979e9 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/rhg_Rohg_MM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/rif.dat b/venv/Lib/site-packages/babel/locale-data/rif.dat new file mode 100644 index 0000000000000000000000000000000000000000..b5efc905394ac93ddca4c68a75831cd5788cb21b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/rif.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/rif_MA.dat b/venv/Lib/site-packages/babel/locale-data/rif_MA.dat new file mode 100644 index 0000000000000000000000000000000000000000..9b7f4342e75ed050ba9c3e2f4ea9969c3cfad261 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/rif_MA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/rm.dat b/venv/Lib/site-packages/babel/locale-data/rm.dat new file mode 100644 index 0000000000000000000000000000000000000000..2398d9074f095fd87b56ff2c852cc1467c2b8125 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/rm.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/rm_CH.dat b/venv/Lib/site-packages/babel/locale-data/rm_CH.dat new file mode 100644 index 0000000000000000000000000000000000000000..26eccfc329149ee1eba4e79a7a3c4a326227ab7d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/rm_CH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/rn.dat b/venv/Lib/site-packages/babel/locale-data/rn.dat new file mode 100644 index 0000000000000000000000000000000000000000..f21edd4ded5cf9afab85f5022d68935403280b43 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/rn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/rn_BI.dat b/venv/Lib/site-packages/babel/locale-data/rn_BI.dat new file mode 100644 index 0000000000000000000000000000000000000000..d1ef9755fd037d5bd16a8a1425871b3e7400da99 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/rn_BI.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ro.dat b/venv/Lib/site-packages/babel/locale-data/ro.dat new file mode 100644 index 0000000000000000000000000000000000000000..5e528369adb5f8433e194845d0984c36ed25f668 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ro.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d7752947aea3fa7420e246e0187e236baca00ead64dc2084af290459e786f326 +size 200714 diff --git a/venv/Lib/site-packages/babel/locale-data/ro_MD.dat b/venv/Lib/site-packages/babel/locale-data/ro_MD.dat new file mode 100644 index 0000000000000000000000000000000000000000..82b8bb6d93ef041761e5d3fd6a8269e66c70463e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ro_MD.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ro_RO.dat b/venv/Lib/site-packages/babel/locale-data/ro_RO.dat new file mode 100644 index 0000000000000000000000000000000000000000..3517a61009c522d0149fbc45d50ddd88fd119194 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ro_RO.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/rof.dat b/venv/Lib/site-packages/babel/locale-data/rof.dat new file mode 100644 index 0000000000000000000000000000000000000000..6f0e55144527317134867c80a2096bfafc9fc64a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/rof.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/rof_TZ.dat b/venv/Lib/site-packages/babel/locale-data/rof_TZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..d7ffaeb0a76c472368770e0b89c4ca3f548e0bec Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/rof_TZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/root.dat b/venv/Lib/site-packages/babel/locale-data/root.dat new file mode 100644 index 0000000000000000000000000000000000000000..0557e0d278b3190a121837bd1b22b7b500904ad7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/root.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ru.dat b/venv/Lib/site-packages/babel/locale-data/ru.dat new file mode 100644 index 0000000000000000000000000000000000000000..1da8625802eb3fdfe1e1b5cb051c92609be6c2fe --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ru.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f160ffeff4f3d2279a1235cd945432f311527c2c2c55ffc251ca07c857ea920b +size 305832 diff --git a/venv/Lib/site-packages/babel/locale-data/ru_BY.dat b/venv/Lib/site-packages/babel/locale-data/ru_BY.dat new file mode 100644 index 0000000000000000000000000000000000000000..e8ef98d49b3f9e7a332dd318b2eae72abb3bda1b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ru_BY.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ru_KG.dat b/venv/Lib/site-packages/babel/locale-data/ru_KG.dat new file mode 100644 index 0000000000000000000000000000000000000000..f3e59502c9630323391f612d73430c070032f36e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ru_KG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ru_KZ.dat b/venv/Lib/site-packages/babel/locale-data/ru_KZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..b66765a5cd34a1c674992aa836c3adbb96c7f187 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ru_KZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ru_MD.dat b/venv/Lib/site-packages/babel/locale-data/ru_MD.dat new file mode 100644 index 0000000000000000000000000000000000000000..d70419944cc220a58cc228563058cc4188a468cd Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ru_MD.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ru_RU.dat b/venv/Lib/site-packages/babel/locale-data/ru_RU.dat new file mode 100644 index 0000000000000000000000000000000000000000..a11835701502cde3d61172ac31ce75aba85650c2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ru_RU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ru_UA.dat b/venv/Lib/site-packages/babel/locale-data/ru_UA.dat new file mode 100644 index 0000000000000000000000000000000000000000..cebd8c23b818cb244dc79471fb2c8fef39295fdf Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ru_UA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/rw.dat b/venv/Lib/site-packages/babel/locale-data/rw.dat new file mode 100644 index 0000000000000000000000000000000000000000..d767b3093d8803f48495b46720153470ee2d2b50 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/rw.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/rw_RW.dat b/venv/Lib/site-packages/babel/locale-data/rw_RW.dat new file mode 100644 index 0000000000000000000000000000000000000000..4ade0dd6463c6ca8ded2cf511a016204f72993bc Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/rw_RW.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/rwk.dat b/venv/Lib/site-packages/babel/locale-data/rwk.dat new file mode 100644 index 0000000000000000000000000000000000000000..fd69cc075357bd892714a04ac375d53d14d8c166 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/rwk.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/rwk_TZ.dat b/venv/Lib/site-packages/babel/locale-data/rwk_TZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..fedafc3ef2eb0ed4c45dc0672420040a1e12edd2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/rwk_TZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sa.dat b/venv/Lib/site-packages/babel/locale-data/sa.dat new file mode 100644 index 0000000000000000000000000000000000000000..76f67c4d570eb3c69cb0067c45af14aa9429cc0d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sa.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sa_IN.dat b/venv/Lib/site-packages/babel/locale-data/sa_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..317817512296780bbc08e5a16a6fc9f0b0fae82e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sa_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sah.dat b/venv/Lib/site-packages/babel/locale-data/sah.dat new file mode 100644 index 0000000000000000000000000000000000000000..bad972f99b8ff84db7fcb3a149f2d52b78ceecce Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sah.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sah_RU.dat b/venv/Lib/site-packages/babel/locale-data/sah_RU.dat new file mode 100644 index 0000000000000000000000000000000000000000..44075f9fa05087862b23d993c4cbb3feee664763 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sah_RU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/saq.dat b/venv/Lib/site-packages/babel/locale-data/saq.dat new file mode 100644 index 0000000000000000000000000000000000000000..9532083360997414160626483375e8a66942cd08 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/saq.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/saq_KE.dat b/venv/Lib/site-packages/babel/locale-data/saq_KE.dat new file mode 100644 index 0000000000000000000000000000000000000000..ffd91c3524ca86dea29df7af3d62dd3ef27b1aac Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/saq_KE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sat.dat b/venv/Lib/site-packages/babel/locale-data/sat.dat new file mode 100644 index 0000000000000000000000000000000000000000..3a63c743e9e7cf2c64850e6d3a64e1ea744ea046 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sat.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sat_Deva.dat b/venv/Lib/site-packages/babel/locale-data/sat_Deva.dat new file mode 100644 index 0000000000000000000000000000000000000000..9a1af369a0d66e19e5c8d92040e1e3e276107975 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sat_Deva.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sat_Deva_IN.dat b/venv/Lib/site-packages/babel/locale-data/sat_Deva_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..1781be05559c4785f3de05c40b9e72bb66e3976c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sat_Deva_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sat_Olck.dat b/venv/Lib/site-packages/babel/locale-data/sat_Olck.dat new file mode 100644 index 0000000000000000000000000000000000000000..444b35844ee4767f280814e5577d674a8a992633 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sat_Olck.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sat_Olck_IN.dat b/venv/Lib/site-packages/babel/locale-data/sat_Olck_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..1781be05559c4785f3de05c40b9e72bb66e3976c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sat_Olck_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sbp.dat b/venv/Lib/site-packages/babel/locale-data/sbp.dat new file mode 100644 index 0000000000000000000000000000000000000000..e1ea58b95cafa2a8a1be83a601dc3922b1a4a3a7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sbp.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sbp_TZ.dat b/venv/Lib/site-packages/babel/locale-data/sbp_TZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..2292ffb6f713c108e496b514adc70ffcc6bb427f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sbp_TZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sc.dat b/venv/Lib/site-packages/babel/locale-data/sc.dat new file mode 100644 index 0000000000000000000000000000000000000000..3623311e6a666f2e7f0ea7bccd3eb946b5601278 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/sc.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:22d6a58cc30bc4e10ce03106ff20cd564f07e00990aead710a70c4f007d10c3b +size 189970 diff --git a/venv/Lib/site-packages/babel/locale-data/sc_IT.dat b/venv/Lib/site-packages/babel/locale-data/sc_IT.dat new file mode 100644 index 0000000000000000000000000000000000000000..12c8c5630fb293389f3f1f9f64ba514d9444fa20 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sc_IT.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/scn.dat b/venv/Lib/site-packages/babel/locale-data/scn.dat new file mode 100644 index 0000000000000000000000000000000000000000..c8ebaec1509ce5d9b454877b51f44535d82fe853 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/scn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/scn_IT.dat b/venv/Lib/site-packages/babel/locale-data/scn_IT.dat new file mode 100644 index 0000000000000000000000000000000000000000..0e8b90ec46da7160c9ca3adc39be0b71c7835188 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/scn_IT.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sd.dat b/venv/Lib/site-packages/babel/locale-data/sd.dat new file mode 100644 index 0000000000000000000000000000000000000000..11e9ad2cf985c9cf7be67c2dbffedc38c06cfa12 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/sd.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54330896ea8da410a17002ef8ddda51a597ab112bab2b005ee9d82a201205e51 +size 154300 diff --git a/venv/Lib/site-packages/babel/locale-data/sd_Arab.dat b/venv/Lib/site-packages/babel/locale-data/sd_Arab.dat new file mode 100644 index 0000000000000000000000000000000000000000..8003f26f9e289645c45b938a95ae9b5e6da27670 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sd_Arab.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sd_Arab_PK.dat b/venv/Lib/site-packages/babel/locale-data/sd_Arab_PK.dat new file mode 100644 index 0000000000000000000000000000000000000000..42f6290f13c23b37fe618ea639def889b7d77fe8 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sd_Arab_PK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sd_Deva.dat b/venv/Lib/site-packages/babel/locale-data/sd_Deva.dat new file mode 100644 index 0000000000000000000000000000000000000000..5193db74b6d4e5540d2e78ed42f4df92293d155d Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sd_Deva.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sd_Deva_IN.dat b/venv/Lib/site-packages/babel/locale-data/sd_Deva_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..21aee01ca3c81d80b437d36e0ff6fe8722208eec Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sd_Deva_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sdh.dat b/venv/Lib/site-packages/babel/locale-data/sdh.dat new file mode 100644 index 0000000000000000000000000000000000000000..f51767d16291d64ebd08ac206081beec41893da0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sdh.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sdh_IQ.dat b/venv/Lib/site-packages/babel/locale-data/sdh_IQ.dat new file mode 100644 index 0000000000000000000000000000000000000000..774d04d58131d20e0f41869658d9b86527c6e423 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sdh_IQ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sdh_IR.dat b/venv/Lib/site-packages/babel/locale-data/sdh_IR.dat new file mode 100644 index 0000000000000000000000000000000000000000..6e83d1f11ec54d6d342c30130bc602a3734ad066 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sdh_IR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/se.dat b/venv/Lib/site-packages/babel/locale-data/se.dat new file mode 100644 index 0000000000000000000000000000000000000000..8da459229016874775b910345a0204d96094e472 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/se.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/se_FI.dat b/venv/Lib/site-packages/babel/locale-data/se_FI.dat new file mode 100644 index 0000000000000000000000000000000000000000..2f927646782dd3c588ff94cbeae5e2bd725e5c5c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/se_FI.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/se_NO.dat b/venv/Lib/site-packages/babel/locale-data/se_NO.dat new file mode 100644 index 0000000000000000000000000000000000000000..09eca0d2b90185593876c25eb6b9ac7d7e7475a1 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/se_NO.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/se_SE.dat b/venv/Lib/site-packages/babel/locale-data/se_SE.dat new file mode 100644 index 0000000000000000000000000000000000000000..632b54e7c2c279853e98bc4376cc3b8509e5fbc3 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/se_SE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/seh.dat b/venv/Lib/site-packages/babel/locale-data/seh.dat new file mode 100644 index 0000000000000000000000000000000000000000..e61f09ba4f51b8ae980211e2bf304965f2249131 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/seh.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/seh_MZ.dat b/venv/Lib/site-packages/babel/locale-data/seh_MZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..ba30e958ac150994928afc1416a42d02b1f4eaa0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/seh_MZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ses.dat b/venv/Lib/site-packages/babel/locale-data/ses.dat new file mode 100644 index 0000000000000000000000000000000000000000..f9858d965c73945b3a7fcc0578124ffd34d488d3 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ses.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ses_ML.dat b/venv/Lib/site-packages/babel/locale-data/ses_ML.dat new file mode 100644 index 0000000000000000000000000000000000000000..a0010889626d998765bcb8341368b773fb0591f5 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ses_ML.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sg.dat b/venv/Lib/site-packages/babel/locale-data/sg.dat new file mode 100644 index 0000000000000000000000000000000000000000..8ce0d409ecf73a0225169b2ee7c7d7af0d658864 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sg.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sg_CF.dat b/venv/Lib/site-packages/babel/locale-data/sg_CF.dat new file mode 100644 index 0000000000000000000000000000000000000000..0ca555a69e81432f4499cc9ea2d3dd532f62fd84 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sg_CF.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/shi.dat b/venv/Lib/site-packages/babel/locale-data/shi.dat new file mode 100644 index 0000000000000000000000000000000000000000..f3d106679e47f50ef0ee7ec2a04dd4c7aef844e9 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/shi.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/shi_Latn.dat b/venv/Lib/site-packages/babel/locale-data/shi_Latn.dat new file mode 100644 index 0000000000000000000000000000000000000000..fecc8217a3a7ce7f38d2ceab1d31bfbbab058b8f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/shi_Latn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/shi_Latn_MA.dat b/venv/Lib/site-packages/babel/locale-data/shi_Latn_MA.dat new file mode 100644 index 0000000000000000000000000000000000000000..14955853f11ba0456a324ba01a15e69b344035b6 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/shi_Latn_MA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/shi_Tfng.dat b/venv/Lib/site-packages/babel/locale-data/shi_Tfng.dat new file mode 100644 index 0000000000000000000000000000000000000000..63ebefe7836a18f2c25e3eae285b52075a7c70d7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/shi_Tfng.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/shi_Tfng_MA.dat b/venv/Lib/site-packages/babel/locale-data/shi_Tfng_MA.dat new file mode 100644 index 0000000000000000000000000000000000000000..14955853f11ba0456a324ba01a15e69b344035b6 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/shi_Tfng_MA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/shn.dat b/venv/Lib/site-packages/babel/locale-data/shn.dat new file mode 100644 index 0000000000000000000000000000000000000000..7eb56999cfe4dcfec3e2a5c2f52b31dc1adc52a5 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/shn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/shn_MM.dat b/venv/Lib/site-packages/babel/locale-data/shn_MM.dat new file mode 100644 index 0000000000000000000000000000000000000000..3cace2923308a496a9b54e51f207f66a211388c4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/shn_MM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/shn_TH.dat b/venv/Lib/site-packages/babel/locale-data/shn_TH.dat new file mode 100644 index 0000000000000000000000000000000000000000..cc5364a2d984bd1db01ccf2d78ecd678b52cd7e1 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/shn_TH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/si.dat b/venv/Lib/site-packages/babel/locale-data/si.dat new file mode 100644 index 0000000000000000000000000000000000000000..96f8ab3033613b66f7ce3dd4a0c31c33b729f826 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/si.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8aeabed2b6de732ce15f4a515f951876028aceb9f4f6990bb9c2aeaec5bf67de +size 216775 diff --git a/venv/Lib/site-packages/babel/locale-data/si_LK.dat b/venv/Lib/site-packages/babel/locale-data/si_LK.dat new file mode 100644 index 0000000000000000000000000000000000000000..eb323029502a6044f9ab907cadcd096e7cbd5ae1 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/si_LK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sid.dat b/venv/Lib/site-packages/babel/locale-data/sid.dat new file mode 100644 index 0000000000000000000000000000000000000000..3445845df95cb84e640ceb39779467a6d7da7cf2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sid.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sid_ET.dat b/venv/Lib/site-packages/babel/locale-data/sid_ET.dat new file mode 100644 index 0000000000000000000000000000000000000000..1be7a4a9060cd200310d19dcebbb586c48b706eb Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sid_ET.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sk.dat b/venv/Lib/site-packages/babel/locale-data/sk.dat new file mode 100644 index 0000000000000000000000000000000000000000..bbab1b38f91e2180ea158f82ca92311261f31b19 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/sk.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bbf4e7b86e3ecef2f193142ea5d36f3d2f93622dbcc5e88fc4b8addbc871c193 +size 218242 diff --git a/venv/Lib/site-packages/babel/locale-data/sk_SK.dat b/venv/Lib/site-packages/babel/locale-data/sk_SK.dat new file mode 100644 index 0000000000000000000000000000000000000000..4ba6c84139206eace0430588a3194e3b2e07177c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sk_SK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/skr.dat b/venv/Lib/site-packages/babel/locale-data/skr.dat new file mode 100644 index 0000000000000000000000000000000000000000..d9fc42902123f12cd4886b8e6cbb84146bcb2932 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/skr.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/skr_PK.dat b/venv/Lib/site-packages/babel/locale-data/skr_PK.dat new file mode 100644 index 0000000000000000000000000000000000000000..8db57bc586b6a2352cf618c05985073fb8de3c54 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/skr_PK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sl.dat b/venv/Lib/site-packages/babel/locale-data/sl.dat new file mode 100644 index 0000000000000000000000000000000000000000..bea4b6dfb0510ed9aea2640e58c62e0446bc5d85 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/sl.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:784254f1dbbe5b00a40af8859aeb14a87f07eac325d8f1c6fe4852ba6501ddca +size 210137 diff --git a/venv/Lib/site-packages/babel/locale-data/sl_SI.dat b/venv/Lib/site-packages/babel/locale-data/sl_SI.dat new file mode 100644 index 0000000000000000000000000000000000000000..b4955823a5ffd7ed7e855f25a37114b3308eba11 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sl_SI.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sma.dat b/venv/Lib/site-packages/babel/locale-data/sma.dat new file mode 100644 index 0000000000000000000000000000000000000000..925c9565690eb2ccb1fb4e9dcbc126a2f9a0f578 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sma.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sma_NO.dat b/venv/Lib/site-packages/babel/locale-data/sma_NO.dat new file mode 100644 index 0000000000000000000000000000000000000000..325e16cc601d985ccc4ea77f2ebda7ee20f27bd1 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sma_NO.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sma_SE.dat b/venv/Lib/site-packages/babel/locale-data/sma_SE.dat new file mode 100644 index 0000000000000000000000000000000000000000..b9cb4e75432c2271f0c4530b650cf17882caf524 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sma_SE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/smj.dat b/venv/Lib/site-packages/babel/locale-data/smj.dat new file mode 100644 index 0000000000000000000000000000000000000000..377b17c7023540028324205ecba59267f9cdb8e2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/smj.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/smj_NO.dat b/venv/Lib/site-packages/babel/locale-data/smj_NO.dat new file mode 100644 index 0000000000000000000000000000000000000000..7cc36547fc202742bd6c92af1270d907c54d034a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/smj_NO.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/smj_SE.dat b/venv/Lib/site-packages/babel/locale-data/smj_SE.dat new file mode 100644 index 0000000000000000000000000000000000000000..78aa9de9e710fc9325c156d781058e30c8d827e0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/smj_SE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/smn.dat b/venv/Lib/site-packages/babel/locale-data/smn.dat new file mode 100644 index 0000000000000000000000000000000000000000..f63177affd2dac60e2d8fd144362c1bb8dcb37f3 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/smn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/smn_FI.dat b/venv/Lib/site-packages/babel/locale-data/smn_FI.dat new file mode 100644 index 0000000000000000000000000000000000000000..a88e29d9de08a73a47ff0e85a90ef2ca79409a66 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/smn_FI.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sms.dat b/venv/Lib/site-packages/babel/locale-data/sms.dat new file mode 100644 index 0000000000000000000000000000000000000000..590f25adbddb3883f99ec5739e418c55e3e995e6 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sms.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sms_FI.dat b/venv/Lib/site-packages/babel/locale-data/sms_FI.dat new file mode 100644 index 0000000000000000000000000000000000000000..91bdf45ea9b4a2826d121a196f97d995f299b4f0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sms_FI.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sn.dat b/venv/Lib/site-packages/babel/locale-data/sn.dat new file mode 100644 index 0000000000000000000000000000000000000000..cb8e1bd84853eb5d4bab203b741f8dc69f301217 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sn_ZW.dat b/venv/Lib/site-packages/babel/locale-data/sn_ZW.dat new file mode 100644 index 0000000000000000000000000000000000000000..4dd1932db2306017bf98ba7f556aa4610759bb08 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sn_ZW.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/so.dat b/venv/Lib/site-packages/babel/locale-data/so.dat new file mode 100644 index 0000000000000000000000000000000000000000..e4be169f9ce36783709d5204e6c1798f05213fc4 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/so.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b0016480c83ea9a6588474ff972a1a82067c50cfca5f5c5b4b89a207797928df +size 166227 diff --git a/venv/Lib/site-packages/babel/locale-data/so_DJ.dat b/venv/Lib/site-packages/babel/locale-data/so_DJ.dat new file mode 100644 index 0000000000000000000000000000000000000000..756644b6d4fc3c62c3317de59cb5180cc5105970 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/so_DJ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/so_ET.dat b/venv/Lib/site-packages/babel/locale-data/so_ET.dat new file mode 100644 index 0000000000000000000000000000000000000000..abd6c12547ff495072603b833697f526480faea2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/so_ET.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/so_KE.dat b/venv/Lib/site-packages/babel/locale-data/so_KE.dat new file mode 100644 index 0000000000000000000000000000000000000000..2c422f93be494a29087d1df7e70fc56741ea1dd6 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/so_KE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/so_SO.dat b/venv/Lib/site-packages/babel/locale-data/so_SO.dat new file mode 100644 index 0000000000000000000000000000000000000000..aa7955c507825ed0cf07fbc45fb8176f8d706e9b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/so_SO.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sq.dat b/venv/Lib/site-packages/babel/locale-data/sq.dat new file mode 100644 index 0000000000000000000000000000000000000000..10bb2f10a2ab713977fa178635f681359e082a26 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/sq.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f254de8f2026fbde22c694ba0e5cbb35048736c6a67eda8b21d3b83b13d6aa89 +size 160229 diff --git a/venv/Lib/site-packages/babel/locale-data/sq_AL.dat b/venv/Lib/site-packages/babel/locale-data/sq_AL.dat new file mode 100644 index 0000000000000000000000000000000000000000..5a5320fce78a249a2ede83a487834c2aba9fc4c2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sq_AL.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sq_MK.dat b/venv/Lib/site-packages/babel/locale-data/sq_MK.dat new file mode 100644 index 0000000000000000000000000000000000000000..32565ce7c375306da1fb3223f08e11300148748a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sq_MK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sq_XK.dat b/venv/Lib/site-packages/babel/locale-data/sq_XK.dat new file mode 100644 index 0000000000000000000000000000000000000000..bbe0062ec8c42c6cd349aa34d64ecf1c87aff874 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sq_XK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sr.dat b/venv/Lib/site-packages/babel/locale-data/sr.dat new file mode 100644 index 0000000000000000000000000000000000000000..5a547aef36019ce12f735bb8659fa8bc98047db3 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/sr.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0001372cdfc22d15b396310444861e7597a9c4b2035b310d90be309aef086fa7 +size 265725 diff --git a/venv/Lib/site-packages/babel/locale-data/sr_Cyrl.dat b/venv/Lib/site-packages/babel/locale-data/sr_Cyrl.dat new file mode 100644 index 0000000000000000000000000000000000000000..89154355eb169abd69d29b60f028cdc711db14fc Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sr_Cyrl.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sr_Cyrl_BA.dat b/venv/Lib/site-packages/babel/locale-data/sr_Cyrl_BA.dat new file mode 100644 index 0000000000000000000000000000000000000000..6a0aaf69a1ec25e1ba9a921985b33c66b31241b4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sr_Cyrl_BA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sr_Cyrl_ME.dat b/venv/Lib/site-packages/babel/locale-data/sr_Cyrl_ME.dat new file mode 100644 index 0000000000000000000000000000000000000000..357ab293176b6418e8d7acf46dfc0deb795b57af Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sr_Cyrl_ME.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sr_Cyrl_RS.dat b/venv/Lib/site-packages/babel/locale-data/sr_Cyrl_RS.dat new file mode 100644 index 0000000000000000000000000000000000000000..b26330986819e979ae2f69dd23733cef18c8bba0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sr_Cyrl_RS.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sr_Cyrl_XK.dat b/venv/Lib/site-packages/babel/locale-data/sr_Cyrl_XK.dat new file mode 100644 index 0000000000000000000000000000000000000000..b574d058a91e78c50aac552b26f4f8822dc690d1 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sr_Cyrl_XK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sr_Latn.dat b/venv/Lib/site-packages/babel/locale-data/sr_Latn.dat new file mode 100644 index 0000000000000000000000000000000000000000..efcc3d05fe3ee60de0754e70a1e53d7de73a4316 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/sr_Latn.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d63a0a5d846fe548a24f6d6cfd96baa84f9503c5e9162d47cd89d53a32a9c5bf +size 217950 diff --git a/venv/Lib/site-packages/babel/locale-data/sr_Latn_BA.dat b/venv/Lib/site-packages/babel/locale-data/sr_Latn_BA.dat new file mode 100644 index 0000000000000000000000000000000000000000..d1be6b892586f58be464ea56d38b8c8cdd3a8f54 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sr_Latn_BA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sr_Latn_ME.dat b/venv/Lib/site-packages/babel/locale-data/sr_Latn_ME.dat new file mode 100644 index 0000000000000000000000000000000000000000..b8b9a5b4bfde9df9249517fd8cc79444c88f6a42 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sr_Latn_ME.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sr_Latn_RS.dat b/venv/Lib/site-packages/babel/locale-data/sr_Latn_RS.dat new file mode 100644 index 0000000000000000000000000000000000000000..b26330986819e979ae2f69dd23733cef18c8bba0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sr_Latn_RS.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sr_Latn_XK.dat b/venv/Lib/site-packages/babel/locale-data/sr_Latn_XK.dat new file mode 100644 index 0000000000000000000000000000000000000000..778db676e1814bb2650ccf42cc356f68d231f56f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sr_Latn_XK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ss.dat b/venv/Lib/site-packages/babel/locale-data/ss.dat new file mode 100644 index 0000000000000000000000000000000000000000..91c10e2c036419d78257cd0f1cf4ea870082f287 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ss.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ss_SZ.dat b/venv/Lib/site-packages/babel/locale-data/ss_SZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..b4fcf77904aad4b123c599eee895c194903c1973 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ss_SZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ss_ZA.dat b/venv/Lib/site-packages/babel/locale-data/ss_ZA.dat new file mode 100644 index 0000000000000000000000000000000000000000..67315698ed962181e364d2a1242be770b8e2ef93 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ss_ZA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ssy.dat b/venv/Lib/site-packages/babel/locale-data/ssy.dat new file mode 100644 index 0000000000000000000000000000000000000000..a42b5e83b5fe50bcad0bef85aa75ccb920c10b50 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ssy.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ssy_ER.dat b/venv/Lib/site-packages/babel/locale-data/ssy_ER.dat new file mode 100644 index 0000000000000000000000000000000000000000..1d28855a7056fc961022a4aa34ce3ce6a2234a70 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ssy_ER.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/st.dat b/venv/Lib/site-packages/babel/locale-data/st.dat new file mode 100644 index 0000000000000000000000000000000000000000..26d9b21a3242ddf795e9bd56538ff6e9c11ad135 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/st.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/st_LS.dat b/venv/Lib/site-packages/babel/locale-data/st_LS.dat new file mode 100644 index 0000000000000000000000000000000000000000..50eef7844fcd01a53c341198517466d5ff8baa72 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/st_LS.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/st_ZA.dat b/venv/Lib/site-packages/babel/locale-data/st_ZA.dat new file mode 100644 index 0000000000000000000000000000000000000000..9539d6249c3db89c3f93d47981ff61f51dc72d14 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/st_ZA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/su.dat b/venv/Lib/site-packages/babel/locale-data/su.dat new file mode 100644 index 0000000000000000000000000000000000000000..011036d541ad874cf0ea91cd231a89a315b7667c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/su.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/su_Latn.dat b/venv/Lib/site-packages/babel/locale-data/su_Latn.dat new file mode 100644 index 0000000000000000000000000000000000000000..79e460ed88bcbc6255655dd2141f8e03de55b37c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/su_Latn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/su_Latn_ID.dat b/venv/Lib/site-packages/babel/locale-data/su_Latn_ID.dat new file mode 100644 index 0000000000000000000000000000000000000000..5c45bdcea34a8c8de4db40d0d9deeaddda1da834 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/su_Latn_ID.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sv.dat b/venv/Lib/site-packages/babel/locale-data/sv.dat new file mode 100644 index 0000000000000000000000000000000000000000..40e146e7d18edae02d109a83c819a469bee6631a --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/sv.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:453bd0da58bd70a1c811b565edf23c10d56b99c09ad601119374bd3b66c72a60 +size 198967 diff --git a/venv/Lib/site-packages/babel/locale-data/sv_AX.dat b/venv/Lib/site-packages/babel/locale-data/sv_AX.dat new file mode 100644 index 0000000000000000000000000000000000000000..bfb414d6bab40d59c092aded29c864b8eaa77f6a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sv_AX.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sv_FI.dat b/venv/Lib/site-packages/babel/locale-data/sv_FI.dat new file mode 100644 index 0000000000000000000000000000000000000000..49deaf31f211efd7a9640bce5260adbfc06216bc Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sv_FI.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sv_SE.dat b/venv/Lib/site-packages/babel/locale-data/sv_SE.dat new file mode 100644 index 0000000000000000000000000000000000000000..57a602a0393956695b2a2692ac681d894e516fc6 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sv_SE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sw.dat b/venv/Lib/site-packages/babel/locale-data/sw.dat new file mode 100644 index 0000000000000000000000000000000000000000..39c35e80306ab177745e9c9cf411c448eed87921 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/sw.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c34b97d0c07efdb65058e9db7720d5835b9155ed63f8af9e823444c6866913c5 +size 145419 diff --git a/venv/Lib/site-packages/babel/locale-data/sw_CD.dat b/venv/Lib/site-packages/babel/locale-data/sw_CD.dat new file mode 100644 index 0000000000000000000000000000000000000000..b1a7f0e5cdb8605748f6ed73d20996016e371470 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sw_CD.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sw_KE.dat b/venv/Lib/site-packages/babel/locale-data/sw_KE.dat new file mode 100644 index 0000000000000000000000000000000000000000..f19305af90b915b31fedf29b2740ebbb1d45e491 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sw_KE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sw_TZ.dat b/venv/Lib/site-packages/babel/locale-data/sw_TZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..a267886d23723f85dc7654a69c05d7103b0ae57a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sw_TZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/sw_UG.dat b/venv/Lib/site-packages/babel/locale-data/sw_UG.dat new file mode 100644 index 0000000000000000000000000000000000000000..0d160d55aedbb97aa5b9cc0b3b0c2633e3a3a2ab Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/sw_UG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/syr.dat b/venv/Lib/site-packages/babel/locale-data/syr.dat new file mode 100644 index 0000000000000000000000000000000000000000..3e2a4f045e0722e597b1e9c791a7a68061d7527d --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/syr.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a112a136ac0379ff95fee33a16cacfa853089a8d1461c241b1fb277e90be10e +size 111439 diff --git a/venv/Lib/site-packages/babel/locale-data/syr_IQ.dat b/venv/Lib/site-packages/babel/locale-data/syr_IQ.dat new file mode 100644 index 0000000000000000000000000000000000000000..7821e9248c152da6644e407c6b87b30a8910afe4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/syr_IQ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/syr_SY.dat b/venv/Lib/site-packages/babel/locale-data/syr_SY.dat new file mode 100644 index 0000000000000000000000000000000000000000..1edf041cc887052babca9f2caf72b5e81fbccd78 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/syr_SY.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/szl.dat b/venv/Lib/site-packages/babel/locale-data/szl.dat new file mode 100644 index 0000000000000000000000000000000000000000..4a767b486d696d83b0387bb68a178ad0e5718390 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/szl.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/szl_PL.dat b/venv/Lib/site-packages/babel/locale-data/szl_PL.dat new file mode 100644 index 0000000000000000000000000000000000000000..f0b99548a66ae7f85d6a9d393c42ee1d480a396a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/szl_PL.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ta.dat b/venv/Lib/site-packages/babel/locale-data/ta.dat new file mode 100644 index 0000000000000000000000000000000000000000..7356dbc9959920189109eaab2f99c8112e3ff3ba --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ta.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45122bc6167da5da464a122b431ed940138f2969f5e4e1a478bf3240ecbeb73f +size 277264 diff --git a/venv/Lib/site-packages/babel/locale-data/ta_IN.dat b/venv/Lib/site-packages/babel/locale-data/ta_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..cd08ee8f866708b9c87a2bc2977b7cb9f69f98b6 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ta_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ta_LK.dat b/venv/Lib/site-packages/babel/locale-data/ta_LK.dat new file mode 100644 index 0000000000000000000000000000000000000000..f473b057d5c0d7e14b517ce3a11933761b2508bc Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ta_LK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ta_MY.dat b/venv/Lib/site-packages/babel/locale-data/ta_MY.dat new file mode 100644 index 0000000000000000000000000000000000000000..8e791e9214f750549b6680b8caa2fd509741c8fb Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ta_MY.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ta_SG.dat b/venv/Lib/site-packages/babel/locale-data/ta_SG.dat new file mode 100644 index 0000000000000000000000000000000000000000..9f1131ccc6893f14071a114793cd8333070feebb Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ta_SG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/te.dat b/venv/Lib/site-packages/babel/locale-data/te.dat new file mode 100644 index 0000000000000000000000000000000000000000..19729f5d2e0e81619796cf29811e54c21b6946dd --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/te.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a114d096fe5d21961abf66905a28ef736c26d15c284754f05943cbfea87392e5 +size 261668 diff --git a/venv/Lib/site-packages/babel/locale-data/te_IN.dat b/venv/Lib/site-packages/babel/locale-data/te_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..d76a4160aae915af1deb7a4247c0b403254f7566 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/te_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/teo.dat b/venv/Lib/site-packages/babel/locale-data/teo.dat new file mode 100644 index 0000000000000000000000000000000000000000..d4cfa1af3ce1251d5f7136667b09f6b9d39c8244 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/teo.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/teo_KE.dat b/venv/Lib/site-packages/babel/locale-data/teo_KE.dat new file mode 100644 index 0000000000000000000000000000000000000000..66b33cad9b32e26ab006d8c8edfdba62fdbbcaf9 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/teo_KE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/teo_UG.dat b/venv/Lib/site-packages/babel/locale-data/teo_UG.dat new file mode 100644 index 0000000000000000000000000000000000000000..e81befadb02575014d87ac56a32748024923c7c8 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/teo_UG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/tg.dat b/venv/Lib/site-packages/babel/locale-data/tg.dat new file mode 100644 index 0000000000000000000000000000000000000000..a64c36d48c272702f2c0743e2142c40476d2c30f --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/tg.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:12b32fd18e121a7a3d8134896e13152995e249efca3525056a805e20368ff2d9 +size 117163 diff --git a/venv/Lib/site-packages/babel/locale-data/tg_TJ.dat b/venv/Lib/site-packages/babel/locale-data/tg_TJ.dat new file mode 100644 index 0000000000000000000000000000000000000000..1982383d7723bedac26e3a377e713b531d94f3ef Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/tg_TJ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/th.dat b/venv/Lib/site-packages/babel/locale-data/th.dat new file mode 100644 index 0000000000000000000000000000000000000000..7a40b1fea7cec500ca89570eb3aa800b909463f1 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/th.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9721bf977fd0cdfa678c2bfc2d56914efa6f7c89a456ba9c0e850aae75e5211e +size 215576 diff --git a/venv/Lib/site-packages/babel/locale-data/th_TH.dat b/venv/Lib/site-packages/babel/locale-data/th_TH.dat new file mode 100644 index 0000000000000000000000000000000000000000..c2a4c994dad4bd585234e3c67da775b2e0eceb0a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/th_TH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ti.dat b/venv/Lib/site-packages/babel/locale-data/ti.dat new file mode 100644 index 0000000000000000000000000000000000000000..0cef33301cd6b2ff70da8821380ffc48e01fda79 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ti.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b8912e3be984289f24227e32e94b852413b84d6b69396880c125121d8767838 +size 214273 diff --git a/venv/Lib/site-packages/babel/locale-data/ti_ER.dat b/venv/Lib/site-packages/babel/locale-data/ti_ER.dat new file mode 100644 index 0000000000000000000000000000000000000000..41ca554cd3a41b5580a46398b3eca270090e64db Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ti_ER.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ti_ET.dat b/venv/Lib/site-packages/babel/locale-data/ti_ET.dat new file mode 100644 index 0000000000000000000000000000000000000000..50a447b53cc6ff74b69b9d9f1d22859fd7c35525 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ti_ET.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/tig.dat b/venv/Lib/site-packages/babel/locale-data/tig.dat new file mode 100644 index 0000000000000000000000000000000000000000..ed1b2a7914395580a6660a4d659b6ba4d2130d37 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/tig.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/tig_ER.dat b/venv/Lib/site-packages/babel/locale-data/tig_ER.dat new file mode 100644 index 0000000000000000000000000000000000000000..5632fa6fe202158b3275d64e9bd86b462546123f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/tig_ER.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/tk.dat b/venv/Lib/site-packages/babel/locale-data/tk.dat new file mode 100644 index 0000000000000000000000000000000000000000..f885fcc8277f7fd6c28ff31d0d362861596715c7 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/tk.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf98b892c8536ac0c4a2590da6a5e7ce5661ef91206c084bd32953d3fd288a8a +size 164932 diff --git a/venv/Lib/site-packages/babel/locale-data/tk_TM.dat b/venv/Lib/site-packages/babel/locale-data/tk_TM.dat new file mode 100644 index 0000000000000000000000000000000000000000..01e7cf61f21ffc4e5128226c660b6b5aad2e8da4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/tk_TM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/tn.dat b/venv/Lib/site-packages/babel/locale-data/tn.dat new file mode 100644 index 0000000000000000000000000000000000000000..65c0267f90af6d066d4f5eb915966b7870205dcd Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/tn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/tn_BW.dat b/venv/Lib/site-packages/babel/locale-data/tn_BW.dat new file mode 100644 index 0000000000000000000000000000000000000000..5da0cc5d97fb4fcaf4813eb8bdc51db7a65e04d4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/tn_BW.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/tn_ZA.dat b/venv/Lib/site-packages/babel/locale-data/tn_ZA.dat new file mode 100644 index 0000000000000000000000000000000000000000..a559a128c3d4dcd2f0145c1fc3cca4dff18fbdb9 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/tn_ZA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/to.dat b/venv/Lib/site-packages/babel/locale-data/to.dat new file mode 100644 index 0000000000000000000000000000000000000000..f36af97a72791fd576255701bc47d7fdd303394c --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/to.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:081afa81182ed2aa3ffa42283a5b8fc2efd9747e3e48f3c91eda3f111703cc70 +size 145255 diff --git a/venv/Lib/site-packages/babel/locale-data/to_TO.dat b/venv/Lib/site-packages/babel/locale-data/to_TO.dat new file mode 100644 index 0000000000000000000000000000000000000000..8cdedf551c10c7f831f8ac8cdd22eb89e28f9797 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/to_TO.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/tok.dat b/venv/Lib/site-packages/babel/locale-data/tok.dat new file mode 100644 index 0000000000000000000000000000000000000000..a8b7a88673fbeeed37aea2e487d06a1a45fe49fc Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/tok.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/tok_001.dat b/venv/Lib/site-packages/babel/locale-data/tok_001.dat new file mode 100644 index 0000000000000000000000000000000000000000..ea39a455828717e17926de41fa64304a8e2c2c29 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/tok_001.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/tpi.dat b/venv/Lib/site-packages/babel/locale-data/tpi.dat new file mode 100644 index 0000000000000000000000000000000000000000..0434b6fa6c7bf2a76f9433be1323c5fa87110f6b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/tpi.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/tpi_PG.dat b/venv/Lib/site-packages/babel/locale-data/tpi_PG.dat new file mode 100644 index 0000000000000000000000000000000000000000..9057c6e44a6112984a2fbe817aae13e5cbddbdae Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/tpi_PG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/tr.dat b/venv/Lib/site-packages/babel/locale-data/tr.dat new file mode 100644 index 0000000000000000000000000000000000000000..a772d53d5624a6ade05a825474c487b3b8d45cc0 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/tr.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50b6e33af990a9c4f5676ffc6c139eecbcf0801520dcb58cd8c88b9266fc33ac +size 150824 diff --git a/venv/Lib/site-packages/babel/locale-data/tr_CY.dat b/venv/Lib/site-packages/babel/locale-data/tr_CY.dat new file mode 100644 index 0000000000000000000000000000000000000000..a0bbd6f0dc0659c9c1634813916e372114f743f7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/tr_CY.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/tr_TR.dat b/venv/Lib/site-packages/babel/locale-data/tr_TR.dat new file mode 100644 index 0000000000000000000000000000000000000000..8c20ebb664b3658195f3fb4f3e18d78c8ead8d23 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/tr_TR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/trv.dat b/venv/Lib/site-packages/babel/locale-data/trv.dat new file mode 100644 index 0000000000000000000000000000000000000000..1b784bc836f2eb84f6b2bbb36f84449499cccc22 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/trv.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/trv_TW.dat b/venv/Lib/site-packages/babel/locale-data/trv_TW.dat new file mode 100644 index 0000000000000000000000000000000000000000..da4e716dbb3fbec59c66d1e6dab3897c6488411c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/trv_TW.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/trw.dat b/venv/Lib/site-packages/babel/locale-data/trw.dat new file mode 100644 index 0000000000000000000000000000000000000000..debc8009e9e3184949bfbf2803e2ee2f1f085087 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/trw.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d5ed4b182b55abbf5172510c25b81113801376a7e557f2831f107022749f00a7 +size 110107 diff --git a/venv/Lib/site-packages/babel/locale-data/trw_PK.dat b/venv/Lib/site-packages/babel/locale-data/trw_PK.dat new file mode 100644 index 0000000000000000000000000000000000000000..593e957e62cb45cb33c9a7318deefdd05f72ab4f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/trw_PK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ts.dat b/venv/Lib/site-packages/babel/locale-data/ts.dat new file mode 100644 index 0000000000000000000000000000000000000000..900383d330181cd8d106c2c8cf6410d460afad5a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ts.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ts_ZA.dat b/venv/Lib/site-packages/babel/locale-data/ts_ZA.dat new file mode 100644 index 0000000000000000000000000000000000000000..536403200a9ea876cb802ac385d6c0d9a554ecfd Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ts_ZA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/tt.dat b/venv/Lib/site-packages/babel/locale-data/tt.dat new file mode 100644 index 0000000000000000000000000000000000000000..a4f34eb861d9c8a2eb8b556472fa6280791f4273 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/tt.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5fe27404a107cb4d5aa00470c1bd12583b8d9b595916b4f46a42abcc16631cf3 +size 111014 diff --git a/venv/Lib/site-packages/babel/locale-data/tt_RU.dat b/venv/Lib/site-packages/babel/locale-data/tt_RU.dat new file mode 100644 index 0000000000000000000000000000000000000000..88ba72f3fd4593f9e5a8896be971a244e5d95b88 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/tt_RU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/twq.dat b/venv/Lib/site-packages/babel/locale-data/twq.dat new file mode 100644 index 0000000000000000000000000000000000000000..2f99122fb0f0bc4ad624fb4a057b645d0b13e280 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/twq.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/twq_NE.dat b/venv/Lib/site-packages/babel/locale-data/twq_NE.dat new file mode 100644 index 0000000000000000000000000000000000000000..be95079d2000b7bf5fc13b5ad62b802304e5a64b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/twq_NE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/tyv.dat b/venv/Lib/site-packages/babel/locale-data/tyv.dat new file mode 100644 index 0000000000000000000000000000000000000000..fe1564b9e8a89215858944fa5ea27ae84bc33911 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/tyv.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/tyv_RU.dat b/venv/Lib/site-packages/babel/locale-data/tyv_RU.dat new file mode 100644 index 0000000000000000000000000000000000000000..92ab47b5d72424023cb8635ca395ddacffc18a6f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/tyv_RU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/tzm.dat b/venv/Lib/site-packages/babel/locale-data/tzm.dat new file mode 100644 index 0000000000000000000000000000000000000000..14f6276b96dbbe533ce1f7ffef01f6f0eed2bcc1 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/tzm.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/tzm_MA.dat b/venv/Lib/site-packages/babel/locale-data/tzm_MA.dat new file mode 100644 index 0000000000000000000000000000000000000000..b74c9377556d2b62102e2f4cbca1f9022152d3c9 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/tzm_MA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ug.dat b/venv/Lib/site-packages/babel/locale-data/ug.dat new file mode 100644 index 0000000000000000000000000000000000000000..3a8222cd7dad2db6fd485630a3ff0f06c8c09a55 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ug.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d1249c5144ab989638fa91889c221c5693cc92ce9313f4039e3da064dc43bde +size 117801 diff --git a/venv/Lib/site-packages/babel/locale-data/ug_CN.dat b/venv/Lib/site-packages/babel/locale-data/ug_CN.dat new file mode 100644 index 0000000000000000000000000000000000000000..997752b72d3df2f59159a2c2f97de4a7af2b2240 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ug_CN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/uk.dat b/venv/Lib/site-packages/babel/locale-data/uk.dat new file mode 100644 index 0000000000000000000000000000000000000000..79ee78c9b7f0386c2f4aa0f4db327b0d088dba63 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/uk.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6fc88486f2dd431abbaed96aa71d5cf6fa7afa7de33463c64ae0563616409c50 +size 339125 diff --git a/venv/Lib/site-packages/babel/locale-data/uk_UA.dat b/venv/Lib/site-packages/babel/locale-data/uk_UA.dat new file mode 100644 index 0000000000000000000000000000000000000000..e1ff80ca19cda32f9bf19a5de99432b59f554e5b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/uk_UA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ur.dat b/venv/Lib/site-packages/babel/locale-data/ur.dat new file mode 100644 index 0000000000000000000000000000000000000000..02c1b633e120d5832b75e6f96a332bb8f27b5b12 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/ur.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4532fce544560cc0376a56d940e0d409b55303da317985e8e645adb8bd575ba8 +size 167002 diff --git a/venv/Lib/site-packages/babel/locale-data/ur_IN.dat b/venv/Lib/site-packages/babel/locale-data/ur_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..582a1fc3d19aa4a857f9a3afb7779be4ec222496 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ur_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ur_PK.dat b/venv/Lib/site-packages/babel/locale-data/ur_PK.dat new file mode 100644 index 0000000000000000000000000000000000000000..5a3d6cecc3bdae30f5aed848b89bd781e19cb6f3 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ur_PK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/uz.dat b/venv/Lib/site-packages/babel/locale-data/uz.dat new file mode 100644 index 0000000000000000000000000000000000000000..c8bf62691b03136f901377dcbd7fd394213d77ec --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/uz.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8b08f7ba4c5be052b4ad962d0bae9fb50993b6bd52813cf2d765aedca910610a +size 138052 diff --git a/venv/Lib/site-packages/babel/locale-data/uz_Arab.dat b/venv/Lib/site-packages/babel/locale-data/uz_Arab.dat new file mode 100644 index 0000000000000000000000000000000000000000..0ed5c3aed59f37a7215b06805bfe45650e99b3f2 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/uz_Arab.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/uz_Arab_AF.dat b/venv/Lib/site-packages/babel/locale-data/uz_Arab_AF.dat new file mode 100644 index 0000000000000000000000000000000000000000..d7355f66e596155722c067bd079ff867346bd7e7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/uz_Arab_AF.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/uz_Cyrl.dat b/venv/Lib/site-packages/babel/locale-data/uz_Cyrl.dat new file mode 100644 index 0000000000000000000000000000000000000000..382b3cc0fece0a218c57cd39762e13c804bf25ec Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/uz_Cyrl.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/uz_Cyrl_UZ.dat b/venv/Lib/site-packages/babel/locale-data/uz_Cyrl_UZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..0e9fb275c0f92fa00d2fc38c5254738325279575 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/uz_Cyrl_UZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/uz_Latn.dat b/venv/Lib/site-packages/babel/locale-data/uz_Latn.dat new file mode 100644 index 0000000000000000000000000000000000000000..217235e4e1d1b6d531bb9ab9c81ec5abb1f5a1d9 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/uz_Latn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/uz_Latn_UZ.dat b/venv/Lib/site-packages/babel/locale-data/uz_Latn_UZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..0e9fb275c0f92fa00d2fc38c5254738325279575 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/uz_Latn_UZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/vai.dat b/venv/Lib/site-packages/babel/locale-data/vai.dat new file mode 100644 index 0000000000000000000000000000000000000000..c69f2cba6d61430abb43ff07b4e2408b729ca3e8 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/vai.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/vai_Latn.dat b/venv/Lib/site-packages/babel/locale-data/vai_Latn.dat new file mode 100644 index 0000000000000000000000000000000000000000..849c491d409bfc38d82a5a7374be6ace9f82c641 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/vai_Latn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/vai_Latn_LR.dat b/venv/Lib/site-packages/babel/locale-data/vai_Latn_LR.dat new file mode 100644 index 0000000000000000000000000000000000000000..f3bc7f0396f2859f201621a4e2ccb58d0608da66 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/vai_Latn_LR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/vai_Vaii.dat b/venv/Lib/site-packages/babel/locale-data/vai_Vaii.dat new file mode 100644 index 0000000000000000000000000000000000000000..6519e24e6ad03612674b240fa9b1d444d4c5eb81 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/vai_Vaii.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/vai_Vaii_LR.dat b/venv/Lib/site-packages/babel/locale-data/vai_Vaii_LR.dat new file mode 100644 index 0000000000000000000000000000000000000000..f3bc7f0396f2859f201621a4e2ccb58d0608da66 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/vai_Vaii_LR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ve.dat b/venv/Lib/site-packages/babel/locale-data/ve.dat new file mode 100644 index 0000000000000000000000000000000000000000..517c7a44997f3189bda46cfde8530100ee38b3ca Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ve.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/ve_ZA.dat b/venv/Lib/site-packages/babel/locale-data/ve_ZA.dat new file mode 100644 index 0000000000000000000000000000000000000000..81c087b33b7685b3fcb0739a20bb27dab52bdb84 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/ve_ZA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/vec.dat b/venv/Lib/site-packages/babel/locale-data/vec.dat new file mode 100644 index 0000000000000000000000000000000000000000..ec089c32ba31835fccb5d96164c4fed101d250cc --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/vec.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce890b7ec8132bb7123f829a495f043293e51e23a423ab46deb58cee8eef7003 +size 160413 diff --git a/venv/Lib/site-packages/babel/locale-data/vec_IT.dat b/venv/Lib/site-packages/babel/locale-data/vec_IT.dat new file mode 100644 index 0000000000000000000000000000000000000000..a1f0238ce44ca634ea287f9635b5d09d96b79115 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/vec_IT.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/vi.dat b/venv/Lib/site-packages/babel/locale-data/vi.dat new file mode 100644 index 0000000000000000000000000000000000000000..6437bb0368f6bac02d6562763b2a583b68e084df --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/vi.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17de5af9fbcb3c8789a8e970c7882bf539d667456948fcb337027444f735a84f +size 134138 diff --git a/venv/Lib/site-packages/babel/locale-data/vi_VN.dat b/venv/Lib/site-packages/babel/locale-data/vi_VN.dat new file mode 100644 index 0000000000000000000000000000000000000000..d1942c8e335e6e9e02beafd5cbeffb23029c59ed Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/vi_VN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/vmw.dat b/venv/Lib/site-packages/babel/locale-data/vmw.dat new file mode 100644 index 0000000000000000000000000000000000000000..7116de27b700b439127acc9de6ea0cabe360e607 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/vmw.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/vmw_MZ.dat b/venv/Lib/site-packages/babel/locale-data/vmw_MZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..2199974574a79609080f7cf1560c912ab9c7c827 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/vmw_MZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/vo.dat b/venv/Lib/site-packages/babel/locale-data/vo.dat new file mode 100644 index 0000000000000000000000000000000000000000..00137183bbd21aeab6f981e3453c5b47e6854e09 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/vo.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/vo_001.dat b/venv/Lib/site-packages/babel/locale-data/vo_001.dat new file mode 100644 index 0000000000000000000000000000000000000000..e06ed1c85e3c0b08dabf848eba79512b8c10fafd Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/vo_001.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/vun.dat b/venv/Lib/site-packages/babel/locale-data/vun.dat new file mode 100644 index 0000000000000000000000000000000000000000..8fd175bb1e187a480391d75ef57ce7644e02f1b0 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/vun.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/vun_TZ.dat b/venv/Lib/site-packages/babel/locale-data/vun_TZ.dat new file mode 100644 index 0000000000000000000000000000000000000000..a29794a6f9d73b75476ef3f3c716ae05015e3ea5 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/vun_TZ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/wa.dat b/venv/Lib/site-packages/babel/locale-data/wa.dat new file mode 100644 index 0000000000000000000000000000000000000000..6699fd2144c05b3bdf3d90b68a26f83f97b77325 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/wa.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/wa_BE.dat b/venv/Lib/site-packages/babel/locale-data/wa_BE.dat new file mode 100644 index 0000000000000000000000000000000000000000..63f30c15cc8f655a055f4fd7d588f731066e342b Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/wa_BE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/wae.dat b/venv/Lib/site-packages/babel/locale-data/wae.dat new file mode 100644 index 0000000000000000000000000000000000000000..7deede2ee56acf65146675c6a0a39be4766f14dc Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/wae.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/wae_CH.dat b/venv/Lib/site-packages/babel/locale-data/wae_CH.dat new file mode 100644 index 0000000000000000000000000000000000000000..7e10feea10bcd838bdf077b8e20916c987bf7173 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/wae_CH.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/wal.dat b/venv/Lib/site-packages/babel/locale-data/wal.dat new file mode 100644 index 0000000000000000000000000000000000000000..99770a061d1c86977278f6eaa113c29d1411ca66 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/wal.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/wal_ET.dat b/venv/Lib/site-packages/babel/locale-data/wal_ET.dat new file mode 100644 index 0000000000000000000000000000000000000000..fa5fc6d0184a41415ae0fc0cae9751caeed86aa5 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/wal_ET.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/wbp.dat b/venv/Lib/site-packages/babel/locale-data/wbp.dat new file mode 100644 index 0000000000000000000000000000000000000000..22bcdd776485af2da5d12af077bb58850113d536 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/wbp.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/wbp_AU.dat b/venv/Lib/site-packages/babel/locale-data/wbp_AU.dat new file mode 100644 index 0000000000000000000000000000000000000000..3b6b5b1ead5876326af14ea312c06d6d1c4afc08 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/wbp_AU.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/wo.dat b/venv/Lib/site-packages/babel/locale-data/wo.dat new file mode 100644 index 0000000000000000000000000000000000000000..ed881e934f3fd6cdd89036fd582fc11ec01d5f8e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/wo.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/wo_SN.dat b/venv/Lib/site-packages/babel/locale-data/wo_SN.dat new file mode 100644 index 0000000000000000000000000000000000000000..ce673ad4306aaa8967a3b9a50e1bfba2aaa4a8ea Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/wo_SN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/xh.dat b/venv/Lib/site-packages/babel/locale-data/xh.dat new file mode 100644 index 0000000000000000000000000000000000000000..487e18a08ca92ff4bce72a69ed2d27833acd3263 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/xh.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/xh_ZA.dat b/venv/Lib/site-packages/babel/locale-data/xh_ZA.dat new file mode 100644 index 0000000000000000000000000000000000000000..68d7166887ed2effb6a387e52dfc667358ff3377 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/xh_ZA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/xnr.dat b/venv/Lib/site-packages/babel/locale-data/xnr.dat new file mode 100644 index 0000000000000000000000000000000000000000..598d61c9da289eac37c573d776ae3402680dd0de --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/xnr.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3add74ce2e05e07e58ab1ea420918f6b2eb9466f866a6d9e27b9003a0a09a09d +size 142585 diff --git a/venv/Lib/site-packages/babel/locale-data/xnr_IN.dat b/venv/Lib/site-packages/babel/locale-data/xnr_IN.dat new file mode 100644 index 0000000000000000000000000000000000000000..360f58c4fa0f4ad5fdadb966363991affb7a4c1e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/xnr_IN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/xog.dat b/venv/Lib/site-packages/babel/locale-data/xog.dat new file mode 100644 index 0000000000000000000000000000000000000000..365dd8aa975725c0d08e3c262d85656ca001c0b7 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/xog.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/xog_UG.dat b/venv/Lib/site-packages/babel/locale-data/xog_UG.dat new file mode 100644 index 0000000000000000000000000000000000000000..b5fb4da0af1505ceb63a61825547c7e3017291b4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/xog_UG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/yav.dat b/venv/Lib/site-packages/babel/locale-data/yav.dat new file mode 100644 index 0000000000000000000000000000000000000000..547b6b9122c1925224864cdba2a536a3d619e1ac Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/yav.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/yav_CM.dat b/venv/Lib/site-packages/babel/locale-data/yav_CM.dat new file mode 100644 index 0000000000000000000000000000000000000000..2a0cbb26e74f95921164edf7f90f6aa18f35aaff Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/yav_CM.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/yi.dat b/venv/Lib/site-packages/babel/locale-data/yi.dat new file mode 100644 index 0000000000000000000000000000000000000000..c39639f0da098f347ba5b105fb449d0ffa12f12a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/yi.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/yi_UA.dat b/venv/Lib/site-packages/babel/locale-data/yi_UA.dat new file mode 100644 index 0000000000000000000000000000000000000000..9f967db03a6a2562ea66f9128f5e5c90a563cf6e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/yi_UA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/yo.dat b/venv/Lib/site-packages/babel/locale-data/yo.dat new file mode 100644 index 0000000000000000000000000000000000000000..f0aa6c3556f74cdca3b56e137b8799e723aad38a --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/yo.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8962e0fb4f0593d4092d93eea2481b09e5e4c9fc9035aa2fe754d3de2d692a06 +size 110427 diff --git a/venv/Lib/site-packages/babel/locale-data/yo_BJ.dat b/venv/Lib/site-packages/babel/locale-data/yo_BJ.dat new file mode 100644 index 0000000000000000000000000000000000000000..b4239959572bb8a2427c6d39a153a28cc86d2805 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/yo_BJ.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/yo_NG.dat b/venv/Lib/site-packages/babel/locale-data/yo_NG.dat new file mode 100644 index 0000000000000000000000000000000000000000..e473a96cddad82c1ecea13a10d948711a58b3f25 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/yo_NG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/yrl.dat b/venv/Lib/site-packages/babel/locale-data/yrl.dat new file mode 100644 index 0000000000000000000000000000000000000000..143454882bac99eae575c7bfc5d38d9339496365 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/yrl.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da7c03bb0e50fdd2f81f63b19790a5cd9536530d748fe9283f94607e727aef2d +size 186854 diff --git a/venv/Lib/site-packages/babel/locale-data/yrl_BR.dat b/venv/Lib/site-packages/babel/locale-data/yrl_BR.dat new file mode 100644 index 0000000000000000000000000000000000000000..bf1012ee0cf20f18292aef66ad38efcf69a087ba Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/yrl_BR.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/yrl_CO.dat b/venv/Lib/site-packages/babel/locale-data/yrl_CO.dat new file mode 100644 index 0000000000000000000000000000000000000000..c8a8c22e3f14787173f074fb40d702be24f05238 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/yrl_CO.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/yrl_VE.dat b/venv/Lib/site-packages/babel/locale-data/yrl_VE.dat new file mode 100644 index 0000000000000000000000000000000000000000..d8ebd8edd7b82dfdf299db4043236f6d9a95afc1 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/yrl_VE.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/yue.dat b/venv/Lib/site-packages/babel/locale-data/yue.dat new file mode 100644 index 0000000000000000000000000000000000000000..9715b5be10c4d53ab26a2fa998ec594d79931ec2 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/yue.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:96f4daa075d25591ea71be54091f0878389544213d211b2b0e486fd1b1b0cc28 +size 143872 diff --git a/venv/Lib/site-packages/babel/locale-data/yue_Hans.dat b/venv/Lib/site-packages/babel/locale-data/yue_Hans.dat new file mode 100644 index 0000000000000000000000000000000000000000..19b0c46e6238e45a902969b60cb5f2b4b3cabb1d --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/yue_Hans.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9b4ccf0b53e1fe42e9e1aa72e6090f5b13acddb183093c776587f841bf70169 +size 145194 diff --git a/venv/Lib/site-packages/babel/locale-data/yue_Hans_CN.dat b/venv/Lib/site-packages/babel/locale-data/yue_Hans_CN.dat new file mode 100644 index 0000000000000000000000000000000000000000..1ba619717ab3d2d840011e43b75240b76956877f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/yue_Hans_CN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/yue_Hant.dat b/venv/Lib/site-packages/babel/locale-data/yue_Hant.dat new file mode 100644 index 0000000000000000000000000000000000000000..d67403460f660fca99a552aba9a23d38dd231b68 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/yue_Hant.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/yue_Hant_CN.dat b/venv/Lib/site-packages/babel/locale-data/yue_Hant_CN.dat new file mode 100644 index 0000000000000000000000000000000000000000..1ba619717ab3d2d840011e43b75240b76956877f Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/yue_Hant_CN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/yue_Hant_HK.dat b/venv/Lib/site-packages/babel/locale-data/yue_Hant_HK.dat new file mode 100644 index 0000000000000000000000000000000000000000..853efcbb39cd8feceb97d63ab194363fec67d658 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/yue_Hant_HK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/za.dat b/venv/Lib/site-packages/babel/locale-data/za.dat new file mode 100644 index 0000000000000000000000000000000000000000..174e68390a5448f82d344df41dd4431f29332228 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/za.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/za_CN.dat b/venv/Lib/site-packages/babel/locale-data/za_CN.dat new file mode 100644 index 0000000000000000000000000000000000000000..f0cbb5db71e7d7d5fe859d0f21d94adfa8e6923a Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/za_CN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/zgh.dat b/venv/Lib/site-packages/babel/locale-data/zgh.dat new file mode 100644 index 0000000000000000000000000000000000000000..a0c342c249e4a0c423ee229bcfc19ab664ea0233 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/zgh.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/zgh_MA.dat b/venv/Lib/site-packages/babel/locale-data/zgh_MA.dat new file mode 100644 index 0000000000000000000000000000000000000000..8475afed46521f62fdc9fac49663211f9ff4ac96 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/zgh_MA.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/zh.dat b/venv/Lib/site-packages/babel/locale-data/zh.dat new file mode 100644 index 0000000000000000000000000000000000000000..9bc2142977d1047e5369eb70a6f3e1068c5b5ef2 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/zh.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a94a499d54de4f5fb08276ca3507e4b241928c0d3c997d9793da5fe48f61682 +size 152100 diff --git a/venv/Lib/site-packages/babel/locale-data/zh_Hans.dat b/venv/Lib/site-packages/babel/locale-data/zh_Hans.dat new file mode 100644 index 0000000000000000000000000000000000000000..c5c94bf8bcb2fe714f5a073d67f013a3d7ef7a66 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/zh_Hans.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/zh_Hans_CN.dat b/venv/Lib/site-packages/babel/locale-data/zh_Hans_CN.dat new file mode 100644 index 0000000000000000000000000000000000000000..09d08c10851e614c5ea75983800d9c111cb3ad26 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/zh_Hans_CN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/zh_Hans_HK.dat b/venv/Lib/site-packages/babel/locale-data/zh_Hans_HK.dat new file mode 100644 index 0000000000000000000000000000000000000000..2396da0a225cde1e1bbd9b905ad6fd5a99f147de Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/zh_Hans_HK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/zh_Hans_MO.dat b/venv/Lib/site-packages/babel/locale-data/zh_Hans_MO.dat new file mode 100644 index 0000000000000000000000000000000000000000..4f0232e532f08bcc4c8c3381cbf63fcf2485a227 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/zh_Hans_MO.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/zh_Hans_MY.dat b/venv/Lib/site-packages/babel/locale-data/zh_Hans_MY.dat new file mode 100644 index 0000000000000000000000000000000000000000..bddaab921a963ca4a05fc3f904288ccae557b577 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/zh_Hans_MY.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/zh_Hans_SG.dat b/venv/Lib/site-packages/babel/locale-data/zh_Hans_SG.dat new file mode 100644 index 0000000000000000000000000000000000000000..646b57d613d526c3f99aa2a36d4a86044543889c Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/zh_Hans_SG.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/zh_Hant.dat b/venv/Lib/site-packages/babel/locale-data/zh_Hant.dat new file mode 100644 index 0000000000000000000000000000000000000000..99ee34240518ecbd87c6f610b98a8c487fde4945 --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/zh_Hant.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df56911add7c6e5e8c76223d880a33c25b5d912410dfbd13bf323c82277c0812 +size 154802 diff --git a/venv/Lib/site-packages/babel/locale-data/zh_Hant_HK.dat b/venv/Lib/site-packages/babel/locale-data/zh_Hant_HK.dat new file mode 100644 index 0000000000000000000000000000000000000000..d8ef238fd10abdfad85d7c4292819b9d8bbde99e Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/zh_Hant_HK.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/zh_Hant_MO.dat b/venv/Lib/site-packages/babel/locale-data/zh_Hant_MO.dat new file mode 100644 index 0000000000000000000000000000000000000000..2e4683576c2fa445db1ecdf739959e4695dc94c4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/zh_Hant_MO.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/zh_Hant_MY.dat b/venv/Lib/site-packages/babel/locale-data/zh_Hant_MY.dat new file mode 100644 index 0000000000000000000000000000000000000000..1198fb41648f90122ae72f1772fdc0c2b8574ca5 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/zh_Hant_MY.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/zh_Hant_TW.dat b/venv/Lib/site-packages/babel/locale-data/zh_Hant_TW.dat new file mode 100644 index 0000000000000000000000000000000000000000..657e88859949c4db157635d5a2f7089c1acb69c4 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/zh_Hant_TW.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/zh_Latn.dat b/venv/Lib/site-packages/babel/locale-data/zh_Latn.dat new file mode 100644 index 0000000000000000000000000000000000000000..c5c94bf8bcb2fe714f5a073d67f013a3d7ef7a66 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/zh_Latn.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/zh_Latn_CN.dat b/venv/Lib/site-packages/babel/locale-data/zh_Latn_CN.dat new file mode 100644 index 0000000000000000000000000000000000000000..09d08c10851e614c5ea75983800d9c111cb3ad26 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/zh_Latn_CN.dat differ diff --git a/venv/Lib/site-packages/babel/locale-data/zu.dat b/venv/Lib/site-packages/babel/locale-data/zu.dat new file mode 100644 index 0000000000000000000000000000000000000000..c623e6cd43f955354eb0fcc4977dbd44ff24cdba --- /dev/null +++ b/venv/Lib/site-packages/babel/locale-data/zu.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7b8f20de8235163911395df21d9d860309fff30af6cb774c923f7c3475b85fc4 +size 138626 diff --git a/venv/Lib/site-packages/babel/locale-data/zu_ZA.dat b/venv/Lib/site-packages/babel/locale-data/zu_ZA.dat new file mode 100644 index 0000000000000000000000000000000000000000..026694ca6b9e4822497aadb5c7c1a66bd3137750 Binary files /dev/null and b/venv/Lib/site-packages/babel/locale-data/zu_ZA.dat differ diff --git a/venv/Lib/site-packages/babel/localedata.py b/venv/Lib/site-packages/babel/localedata.py new file mode 100644 index 0000000000000000000000000000000000000000..59f1db09e7972e56f88a14db48269343063559b7 --- /dev/null +++ b/venv/Lib/site-packages/babel/localedata.py @@ -0,0 +1,278 @@ +""" + babel.localedata + ~~~~~~~~~~~~~~~~ + + Low-level locale data access. + + :note: The `Locale` class, which uses this module under the hood, provides a + more convenient interface for accessing the locale data. + + :copyright: (c) 2013-2025 by the Babel Team. + :license: BSD, see LICENSE for more details. +""" + +from __future__ import annotations + +import os +import pickle +import re +import sys +import threading +from collections import abc +from collections.abc import Iterator, Mapping, MutableMapping +from functools import lru_cache +from itertools import chain +from typing import Any + +_cache: dict[str, Any] = {} +_cache_lock = threading.RLock() +_dirname = os.path.join(os.path.dirname(__file__), 'locale-data') +_windows_reserved_name_re = re.compile("^(con|prn|aux|nul|com[0-9]|lpt[0-9])$", re.I) + + +def normalize_locale(name: str) -> str | None: + """Normalize a locale ID by stripping spaces and apply proper casing. + + Returns the normalized locale ID string or `None` if the ID is not + recognized. + """ + if not name or not isinstance(name, str): + return None + name = name.strip().lower() + for locale_id in chain.from_iterable([_cache, locale_identifiers()]): + if name == locale_id.lower(): + return locale_id + + +def resolve_locale_filename(name: os.PathLike[str] | str) -> str: + """ + Resolve a locale identifier to a `.dat` path on disk. + """ + + # Clean up any possible relative paths. + name = os.path.basename(name) + + # Ensure we're not left with one of the Windows reserved names. + if sys.platform == "win32" and _windows_reserved_name_re.match(os.path.splitext(name)[0]): + raise ValueError(f"Name {name} is invalid on Windows") + + # Build the path. + return os.path.join(_dirname, f"{name}.dat") + + +def exists(name: str) -> bool: + """Check whether locale data is available for the given locale. + + Returns `True` if it exists, `False` otherwise. + + :param name: the locale identifier string + """ + if not name or not isinstance(name, str): + return False + if name in _cache: + return True + file_found = os.path.exists(resolve_locale_filename(name)) + return True if file_found else bool(normalize_locale(name)) + + +@lru_cache(maxsize=None) +def locale_identifiers() -> list[str]: + """Return a list of all locale identifiers for which locale data is + available. + + This data is cached after the first invocation. + You can clear the cache by calling `locale_identifiers.cache_clear()`. + + .. versionadded:: 0.8.1 + + :return: a list of locale identifiers (strings) + """ + return [ + stem + for stem, extension in + (os.path.splitext(filename) for filename in os.listdir(_dirname)) + if extension == '.dat' and stem != 'root' + ] + + +def _is_non_likely_script(name: str) -> bool: + """Return whether the locale is of the form ``lang_Script``, + and the script is not the likely script for the language. + + This implements the behavior of the ``nonlikelyScript`` value of the + ``localRules`` attribute for parent locales added in CLDR 45. + """ + from babel.core import get_global, parse_locale + + try: + lang, territory, script, variant, *rest = parse_locale(name) + except ValueError: + return False + + if lang and script and not territory and not variant and not rest: + likely_subtag = get_global('likely_subtags').get(lang) + _, _, likely_script, *_ = parse_locale(likely_subtag) + return script != likely_script + return False + + +def load(name: os.PathLike[str] | str, merge_inherited: bool = True) -> dict[str, Any]: + """Load the locale data for the given locale. + + The locale data is a dictionary that contains much of the data defined by + the Common Locale Data Repository (CLDR). This data is stored as a + collection of pickle files inside the ``babel`` package. + + >>> d = load('en_US') + >>> d['languages']['sv'] + u'Swedish' + + Note that the results are cached, and subsequent requests for the same + locale return the same dictionary: + + >>> d1 = load('en_US') + >>> d2 = load('en_US') + >>> d1 is d2 + True + + :param name: the locale identifier string (or "root") + :param merge_inherited: whether the inherited data should be merged into + the data of the requested locale + :raise `IOError`: if no locale data file is found for the given locale + identifier, or one of the locales it inherits from + """ + name = os.path.basename(name) + _cache_lock.acquire() + try: + data = _cache.get(name) + if not data: + # Load inherited data + if name == 'root' or not merge_inherited: + data = {} + else: + from babel.core import get_global + parent = get_global('parent_exceptions').get(name) + if not parent: + if _is_non_likely_script(name): + parent = 'root' + else: + parts = name.split('_') + parent = "root" if len(parts) == 1 else "_".join(parts[:-1]) + data = load(parent).copy() + filename = resolve_locale_filename(name) + with open(filename, 'rb') as fileobj: + if name != 'root' and merge_inherited: + merge(data, pickle.load(fileobj)) + else: + data = pickle.load(fileobj) + _cache[name] = data + return data + finally: + _cache_lock.release() + + +def merge(dict1: MutableMapping[Any, Any], dict2: Mapping[Any, Any]) -> None: + """Merge the data from `dict2` into the `dict1` dictionary, making copies + of nested dictionaries. + + >>> d = {1: 'foo', 3: 'baz'} + >>> merge(d, {1: 'Foo', 2: 'Bar'}) + >>> sorted(d.items()) + [(1, 'Foo'), (2, 'Bar'), (3, 'baz')] + + :param dict1: the dictionary to merge into + :param dict2: the dictionary containing the data that should be merged + """ + for key, val2 in dict2.items(): + if val2 is not None: + val1 = dict1.get(key) + if isinstance(val2, dict): + if val1 is None: + val1 = {} + if isinstance(val1, Alias): + val1 = (val1, val2) + elif isinstance(val1, tuple): + alias, others = val1 + others = others.copy() + merge(others, val2) + val1 = (alias, others) + else: + val1 = val1.copy() + merge(val1, val2) + else: + val1 = val2 + dict1[key] = val1 + + +class Alias: + """Representation of an alias in the locale data. + + An alias is a value that refers to some other part of the locale data, + as specified by the `keys`. + """ + + def __init__(self, keys: tuple[str, ...]) -> None: + self.keys = tuple(keys) + + def __repr__(self) -> str: + return f"<{type(self).__name__} {self.keys!r}>" + + def resolve(self, data: Mapping[str | int | None, Any]) -> Mapping[str | int | None, Any]: + """Resolve the alias based on the given data. + + This is done recursively, so if one alias resolves to a second alias, + that second alias will also be resolved. + + :param data: the locale data + :type data: `dict` + """ + base = data + for key in self.keys: + data = data[key] + if isinstance(data, Alias): + data = data.resolve(base) + elif isinstance(data, tuple): + alias, others = data + data = alias.resolve(base) + return data + + +class LocaleDataDict(abc.MutableMapping): + """Dictionary wrapper that automatically resolves aliases to the actual + values. + """ + + def __init__(self, data: MutableMapping[str | int | None, Any], base: Mapping[str | int | None, Any] | None = None): + self._data = data + if base is None: + base = data + self.base = base + + def __len__(self) -> int: + return len(self._data) + + def __iter__(self) -> Iterator[str | int | None]: + return iter(self._data) + + def __getitem__(self, key: str | int | None) -> Any: + orig = val = self._data[key] + if isinstance(val, Alias): # resolve an alias + val = val.resolve(self.base) + if isinstance(val, tuple): # Merge a partial dict with an alias + alias, others = val + val = alias.resolve(self.base).copy() + merge(val, others) + if isinstance(val, dict): # Return a nested alias-resolving dict + val = LocaleDataDict(val, base=self.base) + if val is not orig: + self._data[key] = val + return val + + def __setitem__(self, key: str | int | None, value: Any) -> None: + self._data[key] = value + + def __delitem__(self, key: str | int | None) -> None: + del self._data[key] + + def copy(self) -> LocaleDataDict: + return LocaleDataDict(self._data.copy(), base=self.base) diff --git a/venv/Lib/site-packages/babel/localtime/__init__.py b/venv/Lib/site-packages/babel/localtime/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..854c07496a10277f5df1b8b6d3d39eb6e851689e --- /dev/null +++ b/venv/Lib/site-packages/babel/localtime/__init__.py @@ -0,0 +1,43 @@ +""" + babel.localtime + ~~~~~~~~~~~~~~~ + + Babel specific fork of tzlocal to determine the local timezone + of the system. + + :copyright: (c) 2013-2025 by the Babel Team. + :license: BSD, see LICENSE for more details. +""" + +import datetime +import sys + +if sys.platform == 'win32': + from babel.localtime._win32 import _get_localzone +else: + from babel.localtime._unix import _get_localzone + + +# TODO(3.0): the offset constants are not part of the public API +# and should be removed +from babel.localtime._fallback import ( + DSTDIFF, # noqa: F401 + DSTOFFSET, # noqa: F401 + STDOFFSET, # noqa: F401 + ZERO, # noqa: F401 + _FallbackLocalTimezone, +) + + +def get_localzone() -> datetime.tzinfo: + """Returns the current underlying local timezone object. + Generally this function does not need to be used, it's a + better idea to use the :data:`LOCALTZ` singleton instead. + """ + return _get_localzone() + + +try: + LOCALTZ = get_localzone() +except LookupError: + LOCALTZ = _FallbackLocalTimezone() diff --git a/venv/Lib/site-packages/babel/localtime/__pycache__/__init__.cpython-313.pyc b/venv/Lib/site-packages/babel/localtime/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..703084a6805fab4c1ea68fe938967cef155d6c65 Binary files /dev/null and b/venv/Lib/site-packages/babel/localtime/__pycache__/__init__.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/localtime/__pycache__/_fallback.cpython-313.pyc b/venv/Lib/site-packages/babel/localtime/__pycache__/_fallback.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3b2c43535bfe13e766b9f91e474507639dcb2656 Binary files /dev/null and b/venv/Lib/site-packages/babel/localtime/__pycache__/_fallback.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/localtime/__pycache__/_helpers.cpython-313.pyc b/venv/Lib/site-packages/babel/localtime/__pycache__/_helpers.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5cc8df9b43895439f7915b7787a86cb144811cdd Binary files /dev/null and b/venv/Lib/site-packages/babel/localtime/__pycache__/_helpers.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/localtime/__pycache__/_unix.cpython-313.pyc b/venv/Lib/site-packages/babel/localtime/__pycache__/_unix.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e9cc2275a652eda958f1e48c419bb4b4128276d8 Binary files /dev/null and b/venv/Lib/site-packages/babel/localtime/__pycache__/_unix.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/localtime/__pycache__/_win32.cpython-313.pyc b/venv/Lib/site-packages/babel/localtime/__pycache__/_win32.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3cd533ff4d268472c05dac8d25564e76048e9034 Binary files /dev/null and b/venv/Lib/site-packages/babel/localtime/__pycache__/_win32.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/localtime/_fallback.py b/venv/Lib/site-packages/babel/localtime/_fallback.py new file mode 100644 index 0000000000000000000000000000000000000000..fab6867c3c67f28e1c5a9d44e1ab9f4aee308d99 --- /dev/null +++ b/venv/Lib/site-packages/babel/localtime/_fallback.py @@ -0,0 +1,44 @@ +""" + babel.localtime._fallback + ~~~~~~~~~~~~~~~~~~~~~~~~~ + + Emulated fallback local timezone when all else fails. + + :copyright: (c) 2013-2025 by the Babel Team. + :license: BSD, see LICENSE for more details. +""" + +import datetime +import time + +STDOFFSET = datetime.timedelta(seconds=-time.timezone) +DSTOFFSET = datetime.timedelta(seconds=-time.altzone) if time.daylight else STDOFFSET + +DSTDIFF = DSTOFFSET - STDOFFSET +ZERO = datetime.timedelta(0) + + +class _FallbackLocalTimezone(datetime.tzinfo): + + def utcoffset(self, dt: datetime.datetime) -> datetime.timedelta: + if self._isdst(dt): + return DSTOFFSET + else: + return STDOFFSET + + def dst(self, dt: datetime.datetime) -> datetime.timedelta: + if self._isdst(dt): + return DSTDIFF + else: + return ZERO + + def tzname(self, dt: datetime.datetime) -> str: + return time.tzname[self._isdst(dt)] + + def _isdst(self, dt: datetime.datetime) -> bool: + tt = (dt.year, dt.month, dt.day, + dt.hour, dt.minute, dt.second, + dt.weekday(), 0, -1) + stamp = time.mktime(tt) + tt = time.localtime(stamp) + return tt.tm_isdst > 0 diff --git a/venv/Lib/site-packages/babel/localtime/_helpers.py b/venv/Lib/site-packages/babel/localtime/_helpers.py new file mode 100644 index 0000000000000000000000000000000000000000..e7e67052c1fbdb7e88761fd6e8f08e97d54cb54e --- /dev/null +++ b/venv/Lib/site-packages/babel/localtime/_helpers.py @@ -0,0 +1,57 @@ +try: + import pytz +except ModuleNotFoundError: + pytz = None + +try: + import zoneinfo +except ModuleNotFoundError: + zoneinfo = None + + +def _get_tzinfo(tzenv: str): + """Get the tzinfo from `zoneinfo` or `pytz` + + :param tzenv: timezone in the form of Continent/City + :return: tzinfo object or None if not found + """ + if pytz: + try: + return pytz.timezone(tzenv) + except pytz.UnknownTimeZoneError: + pass + else: + try: + return zoneinfo.ZoneInfo(tzenv) + except ValueError as ve: + # This is somewhat hacky, but since _validate_tzfile_path() doesn't + # raise a specific error type, we'll need to check the message to be + # one we know to be from that function. + # If so, we pretend it meant that the TZ didn't exist, for the benefit + # of `babel.localtime` catching the `LookupError` raised by + # `_get_tzinfo_or_raise()`. + # See https://github.com/python-babel/babel/issues/1092 + if str(ve).startswith("ZoneInfo keys "): + return None + except zoneinfo.ZoneInfoNotFoundError: + pass + + return None + + +def _get_tzinfo_or_raise(tzenv: str): + tzinfo = _get_tzinfo(tzenv) + if tzinfo is None: + raise LookupError( + f"Can not find timezone {tzenv}. \n" + "Timezone names are generally in the form `Continent/City`.", + ) + return tzinfo + + +def _get_tzinfo_from_file(tzfilename: str): + with open(tzfilename, 'rb') as tzfile: + if pytz: + return pytz.tzfile.build_tzinfo('local', tzfile) + else: + return zoneinfo.ZoneInfo.from_file(tzfile) diff --git a/venv/Lib/site-packages/babel/localtime/_unix.py b/venv/Lib/site-packages/babel/localtime/_unix.py new file mode 100644 index 0000000000000000000000000000000000000000..782a7d246ce2ca8cf2bb70857f670e11aeeacee0 --- /dev/null +++ b/venv/Lib/site-packages/babel/localtime/_unix.py @@ -0,0 +1,104 @@ +import datetime +import os +import re + +from babel.localtime._helpers import ( + _get_tzinfo, + _get_tzinfo_from_file, + _get_tzinfo_or_raise, +) + + +def _tz_from_env(tzenv: str) -> datetime.tzinfo: + if tzenv[0] == ':': + tzenv = tzenv[1:] + + # TZ specifies a file + if os.path.exists(tzenv): + return _get_tzinfo_from_file(tzenv) + + # TZ specifies a zoneinfo zone. + return _get_tzinfo_or_raise(tzenv) + + +def _get_localzone(_root: str = '/') -> datetime.tzinfo: + """Tries to find the local timezone configuration. + This method prefers finding the timezone name and passing that to + zoneinfo or pytz, over passing in the localtime file, as in the later + case the zoneinfo name is unknown. + The parameter _root makes the function look for files like /etc/localtime + beneath the _root directory. This is primarily used by the tests. + In normal usage you call the function without parameters. + """ + + tzenv = os.environ.get('TZ') + if tzenv: + return _tz_from_env(tzenv) + + # This is actually a pretty reliable way to test for the local time + # zone on operating systems like OS X. On OS X especially this is the + # only one that actually works. + try: + link_dst = os.readlink('/etc/localtime') + except OSError: + pass + else: + pos = link_dst.find('/zoneinfo/') + if pos >= 0: + # On occasion, the `/etc/localtime` symlink has a double slash, e.g. + # "/usr/share/zoneinfo//UTC", which would make `zoneinfo.ZoneInfo` + # complain (no absolute paths allowed), and we'd end up returning + # `None` (as a fix for #1092). + # Instead, let's just "fix" the double slash symlink by stripping + # leading slashes before passing the assumed zone name forward. + zone_name = link_dst[pos + 10:].lstrip("/") + tzinfo = _get_tzinfo(zone_name) + if tzinfo is not None: + return tzinfo + + # Now look for distribution specific configuration files + # that contain the timezone name. + tzpath = os.path.join(_root, 'etc/timezone') + if os.path.exists(tzpath): + with open(tzpath, 'rb') as tzfile: + data = tzfile.read() + + # Issue #3 in tzlocal was that /etc/timezone was a zoneinfo file. + # That's a misconfiguration, but we need to handle it gracefully: + if data[:5] != b'TZif2': + etctz = data.strip().decode() + # Get rid of host definitions and comments: + if ' ' in etctz: + etctz, dummy = etctz.split(' ', 1) + if '#' in etctz: + etctz, dummy = etctz.split('#', 1) + + return _get_tzinfo_or_raise(etctz.replace(' ', '_')) + + # CentOS has a ZONE setting in /etc/sysconfig/clock, + # OpenSUSE has a TIMEZONE setting in /etc/sysconfig/clock and + # Gentoo has a TIMEZONE setting in /etc/conf.d/clock + # We look through these files for a timezone: + timezone_re = re.compile(r'\s*(TIME)?ZONE\s*=\s*"(?P.+)"') + + for filename in ('etc/sysconfig/clock', 'etc/conf.d/clock'): + tzpath = os.path.join(_root, filename) + if not os.path.exists(tzpath): + continue + with open(tzpath) as tzfile: + for line in tzfile: + match = timezone_re.match(line) + if match is not None: + # We found a timezone + etctz = match.group("etctz") + return _get_tzinfo_or_raise(etctz.replace(' ', '_')) + + # No explicit setting existed. Use localtime + for filename in ('etc/localtime', 'usr/local/etc/localtime'): + tzpath = os.path.join(_root, filename) + + if not os.path.exists(tzpath): + continue + return _get_tzinfo_from_file(tzpath) + + raise LookupError('Can not find any timezone configuration') diff --git a/venv/Lib/site-packages/babel/localtime/_win32.py b/venv/Lib/site-packages/babel/localtime/_win32.py new file mode 100644 index 0000000000000000000000000000000000000000..1a52567bc44cf0f5688cccffa869673b72b8cde7 --- /dev/null +++ b/venv/Lib/site-packages/babel/localtime/_win32.py @@ -0,0 +1,98 @@ +from __future__ import annotations + +try: + import winreg +except ImportError: + winreg = None + +import datetime +from typing import Any, Dict, cast + +from babel.core import get_global +from babel.localtime._helpers import _get_tzinfo_or_raise + +# When building the cldr data on windows this module gets imported. +# Because at that point there is no global.dat yet this call will +# fail. We want to catch it down in that case then and just assume +# the mapping was empty. +try: + tz_names: dict[str, str] = cast(Dict[str, str], get_global('windows_zone_mapping')) +except RuntimeError: + tz_names = {} + + +def valuestodict(key) -> dict[str, Any]: + """Convert a registry key's values to a dictionary.""" + dict = {} + size = winreg.QueryInfoKey(key)[1] + for i in range(size): + data = winreg.EnumValue(key, i) + dict[data[0]] = data[1] + return dict + + +def get_localzone_name() -> str: + # Windows is special. It has unique time zone names (in several + # meanings of the word) available, but unfortunately, they can be + # translated to the language of the operating system, so we need to + # do a backwards lookup, by going through all time zones and see which + # one matches. + handle = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) + + TZLOCALKEYNAME = r'SYSTEM\CurrentControlSet\Control\TimeZoneInformation' + localtz = winreg.OpenKey(handle, TZLOCALKEYNAME) + keyvalues = valuestodict(localtz) + localtz.Close() + if 'TimeZoneKeyName' in keyvalues: + # Windows 7 (and Vista?) + + # For some reason this returns a string with loads of NUL bytes at + # least on some systems. I don't know if this is a bug somewhere, I + # just work around it. + tzkeyname = keyvalues['TimeZoneKeyName'].split('\x00', 1)[0] + else: + # Windows 2000 or XP + + # This is the localized name: + tzwin = keyvalues['StandardName'] + + # Open the list of timezones to look up the real name: + TZKEYNAME = r'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones' + tzkey = winreg.OpenKey(handle, TZKEYNAME) + + # Now, match this value to Time Zone information + tzkeyname = None + for i in range(winreg.QueryInfoKey(tzkey)[0]): + subkey = winreg.EnumKey(tzkey, i) + sub = winreg.OpenKey(tzkey, subkey) + data = valuestodict(sub) + sub.Close() + if data.get('Std', None) == tzwin: + tzkeyname = subkey + break + + tzkey.Close() + handle.Close() + + if tzkeyname is None: + raise LookupError('Can not find Windows timezone configuration') + + timezone = tz_names.get(tzkeyname) + if timezone is None: + # Nope, that didn't work. Try adding 'Standard Time', + # it seems to work a lot of times: + timezone = tz_names.get(f"{tzkeyname} Standard Time") + + # Return what we have. + if timezone is None: + raise LookupError(f"Can not find timezone {tzkeyname}") + + return timezone + + +def _get_localzone() -> datetime.tzinfo: + if winreg is None: + raise LookupError( + 'Runtime support not available') + + return _get_tzinfo_or_raise(get_localzone_name()) diff --git a/venv/Lib/site-packages/babel/messages/__init__.py b/venv/Lib/site-packages/babel/messages/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ca83faa97dd7e54f6f3681bb5af245da8687a107 --- /dev/null +++ b/venv/Lib/site-packages/babel/messages/__init__.py @@ -0,0 +1,21 @@ +""" + babel.messages + ~~~~~~~~~~~~~~ + + Support for ``gettext`` message catalogs. + + :copyright: (c) 2013-2025 by the Babel Team. + :license: BSD, see LICENSE for more details. +""" + +from babel.messages.catalog import ( + Catalog, + Message, + TranslationError, +) + +__all__ = [ + "Catalog", + "Message", + "TranslationError", +] diff --git a/venv/Lib/site-packages/babel/messages/__pycache__/__init__.cpython-313.pyc b/venv/Lib/site-packages/babel/messages/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..daa7c36d8a4e0755885ebf4401b11c034c258c1c Binary files /dev/null and b/venv/Lib/site-packages/babel/messages/__pycache__/__init__.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/messages/__pycache__/_compat.cpython-313.pyc b/venv/Lib/site-packages/babel/messages/__pycache__/_compat.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..72bea0fb78904cf16179f502e8cb259f4f8ba743 Binary files /dev/null and b/venv/Lib/site-packages/babel/messages/__pycache__/_compat.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/messages/__pycache__/catalog.cpython-313.pyc b/venv/Lib/site-packages/babel/messages/__pycache__/catalog.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e1fa2e309877aa4dc5cf8bd8824c46f5b7686d81 Binary files /dev/null and b/venv/Lib/site-packages/babel/messages/__pycache__/catalog.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/messages/__pycache__/checkers.cpython-313.pyc b/venv/Lib/site-packages/babel/messages/__pycache__/checkers.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b241b8808c85bb6869562ff922036e4a52e70821 Binary files /dev/null and b/venv/Lib/site-packages/babel/messages/__pycache__/checkers.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/messages/__pycache__/extract.cpython-313.pyc b/venv/Lib/site-packages/babel/messages/__pycache__/extract.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6b042bec9c193cbabdcd37ddfc049a753b8f1d8d Binary files /dev/null and b/venv/Lib/site-packages/babel/messages/__pycache__/extract.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/messages/__pycache__/frontend.cpython-313.pyc b/venv/Lib/site-packages/babel/messages/__pycache__/frontend.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4b4eedd5d83591df2732441671b31363870323f6 Binary files /dev/null and b/venv/Lib/site-packages/babel/messages/__pycache__/frontend.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/messages/__pycache__/jslexer.cpython-313.pyc b/venv/Lib/site-packages/babel/messages/__pycache__/jslexer.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4f63d91f7723ed0dfd4401f011b728015eee62af Binary files /dev/null and b/venv/Lib/site-packages/babel/messages/__pycache__/jslexer.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/messages/__pycache__/mofile.cpython-313.pyc b/venv/Lib/site-packages/babel/messages/__pycache__/mofile.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8e0225ccb278bb7223104ea7d0ad0dc8d2948a43 Binary files /dev/null and b/venv/Lib/site-packages/babel/messages/__pycache__/mofile.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/messages/__pycache__/plurals.cpython-313.pyc b/venv/Lib/site-packages/babel/messages/__pycache__/plurals.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c8dcffe8d1ab6e02029646b9d86112cb29b84fb8 Binary files /dev/null and b/venv/Lib/site-packages/babel/messages/__pycache__/plurals.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/messages/__pycache__/pofile.cpython-313.pyc b/venv/Lib/site-packages/babel/messages/__pycache__/pofile.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e9603818f2f5854bfa9d41cb081c95c8047c8ff8 Binary files /dev/null and b/venv/Lib/site-packages/babel/messages/__pycache__/pofile.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/messages/__pycache__/setuptools_frontend.cpython-313.pyc b/venv/Lib/site-packages/babel/messages/__pycache__/setuptools_frontend.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fb03c13397fea8f88a8a19924c958d1927eb0034 Binary files /dev/null and b/venv/Lib/site-packages/babel/messages/__pycache__/setuptools_frontend.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/babel/messages/_compat.py b/venv/Lib/site-packages/babel/messages/_compat.py new file mode 100644 index 0000000000000000000000000000000000000000..319b545f0327962b145858e20a89ceb2b641fb67 --- /dev/null +++ b/venv/Lib/site-packages/babel/messages/_compat.py @@ -0,0 +1,34 @@ +import sys +from functools import partial + + +def find_entrypoints(group_name: str): + """ + Find entrypoints of a given group using either `importlib.metadata` or the + older `pkg_resources` mechanism. + + Yields tuples of the entrypoint name and a callable function that will + load the actual entrypoint. + """ + if sys.version_info >= (3, 10): + # "Changed in version 3.10: importlib.metadata is no longer provisional." + try: + from importlib.metadata import entry_points + except ImportError: + pass + else: + eps = entry_points(group=group_name) + # Only do this if this implementation of `importlib.metadata` is + # modern enough to not return a dict. + if not isinstance(eps, dict): + for entry_point in eps: + yield (entry_point.name, entry_point.load) + return + + try: + from pkg_resources import working_set + except ImportError: + pass + else: + for entry_point in working_set.iter_entry_points(group_name): + yield (entry_point.name, partial(entry_point.load, require=True)) diff --git a/venv/Lib/site-packages/babel/messages/catalog.py b/venv/Lib/site-packages/babel/messages/catalog.py new file mode 100644 index 0000000000000000000000000000000000000000..f84a5bd1b389ff2b1f4fff4202722103dab54bb7 --- /dev/null +++ b/venv/Lib/site-packages/babel/messages/catalog.py @@ -0,0 +1,1000 @@ +""" + babel.messages.catalog + ~~~~~~~~~~~~~~~~~~~~~~ + + Data structures for message catalogs. + + :copyright: (c) 2013-2025 by the Babel Team. + :license: BSD, see LICENSE for more details. +""" +from __future__ import annotations + +import datetime +import re +from collections.abc import Iterable, Iterator +from copy import copy +from difflib import SequenceMatcher +from email import message_from_string +from heapq import nlargest +from string import Formatter +from typing import TYPE_CHECKING + +from babel import __version__ as VERSION +from babel.core import Locale, UnknownLocaleError +from babel.dates import format_datetime +from babel.messages.plurals import get_plural +from babel.util import LOCALTZ, FixedOffsetTimezone, _cmp, distinct + +if TYPE_CHECKING: + from typing_extensions import TypeAlias + + _MessageID: TypeAlias = str | tuple[str, ...] | list[str] + +__all__ = [ + 'DEFAULT_HEADER', + 'PYTHON_FORMAT', + 'Catalog', + 'Message', + 'TranslationError', +] + + +def get_close_matches(word, possibilities, n=3, cutoff=0.6): + """A modified version of ``difflib.get_close_matches``. + + It just passes ``autojunk=False`` to the ``SequenceMatcher``, to work + around https://github.com/python/cpython/issues/90825. + """ + if not n > 0: # pragma: no cover + raise ValueError(f"n must be > 0: {n!r}") + if not 0.0 <= cutoff <= 1.0: # pragma: no cover + raise ValueError(f"cutoff must be in [0.0, 1.0]: {cutoff!r}") + result = [] + s = SequenceMatcher(autojunk=False) # only line changed from difflib.py + s.set_seq2(word) + for x in possibilities: + s.set_seq1(x) + if s.real_quick_ratio() >= cutoff and \ + s.quick_ratio() >= cutoff and \ + s.ratio() >= cutoff: + result.append((s.ratio(), x)) + + # Move the best scorers to head of list + result = nlargest(n, result) + # Strip scores for the best n matches + return [x for score, x in result] + + +PYTHON_FORMAT = re.compile(r''' + \% + (?:\(([\w]*)\))? + ( + [-#0\ +]?(?:\*|[\d]+)? + (?:\.(?:\*|[\d]+))? + [hlL]? + ) + ([diouxXeEfFgGcrs%]) +''', re.VERBOSE) + + +def _has_python_brace_format(string: str) -> bool: + if "{" not in string: + return False + fmt = Formatter() + try: + # `fmt.parse` returns 3-or-4-tuples of the form + # `(literal_text, field_name, format_spec, conversion)`; + # if `field_name` is set, this smells like brace format + field_name_seen = False + for t in fmt.parse(string): + if t[1] is not None: + field_name_seen = True + # We cannot break here, as we need to consume the whole string + # to ensure that it is a valid format string. + except ValueError: + return False + return field_name_seen + + +def _parse_datetime_header(value: str) -> datetime.datetime: + match = re.match(r'^(?P.*?)(?P[+-]\d{4})?$', value) + + dt = datetime.datetime.strptime(match.group('datetime'), '%Y-%m-%d %H:%M') + + # Separate the offset into a sign component, hours, and # minutes + tzoffset = match.group('tzoffset') + if tzoffset is not None: + plus_minus_s, rest = tzoffset[0], tzoffset[1:] + hours_offset_s, mins_offset_s = rest[:2], rest[2:] + + # Make them all integers + plus_minus = int(f"{plus_minus_s}1") + hours_offset = int(hours_offset_s) + mins_offset = int(mins_offset_s) + + # Calculate net offset + net_mins_offset = hours_offset * 60 + net_mins_offset += mins_offset + net_mins_offset *= plus_minus + + # Create an offset object + tzoffset = FixedOffsetTimezone(net_mins_offset) + + # Store the offset in a datetime object + dt = dt.replace(tzinfo=tzoffset) + + return dt + + +class Message: + """Representation of a single message in a catalog.""" + + def __init__( + self, + id: _MessageID, + string: _MessageID | None = '', + locations: Iterable[tuple[str, int]] = (), + flags: Iterable[str] = (), + auto_comments: Iterable[str] = (), + user_comments: Iterable[str] = (), + previous_id: _MessageID = (), + lineno: int | None = None, + context: str | None = None, + ) -> None: + """Create the message object. + + :param id: the message ID, or a ``(singular, plural)`` tuple for + pluralizable messages + :param string: the translated message string, or a + ``(singular, plural)`` tuple for pluralizable messages + :param locations: a sequence of ``(filename, lineno)`` tuples + :param flags: a set or sequence of flags + :param auto_comments: a sequence of automatic comments for the message + :param user_comments: a sequence of user comments for the message + :param previous_id: the previous message ID, or a ``(singular, plural)`` + tuple for pluralizable messages + :param lineno: the line number on which the msgid line was found in the + PO file, if any + :param context: the message context + """ + self.id = id + if not string and self.pluralizable: + string = ('', '') + self.string = string + self.locations = list(distinct(locations)) + self.flags = set(flags) + if id and self.python_format: + self.flags.add('python-format') + else: + self.flags.discard('python-format') + if id and self.python_brace_format: + self.flags.add('python-brace-format') + else: + self.flags.discard('python-brace-format') + self.auto_comments = list(distinct(auto_comments)) + self.user_comments = list(distinct(user_comments)) + if isinstance(previous_id, str): + self.previous_id = [previous_id] + else: + self.previous_id = list(previous_id) + self.lineno = lineno + self.context = context + + def __repr__(self) -> str: + return f"<{type(self).__name__} {self.id!r} (flags: {list(self.flags)!r})>" + + def __cmp__(self, other: object) -> int: + """Compare Messages, taking into account plural ids""" + def values_to_compare(obj): + if isinstance(obj, Message) and obj.pluralizable: + return obj.id[0], obj.context or '' + return obj.id, obj.context or '' + return _cmp(values_to_compare(self), values_to_compare(other)) + + def __gt__(self, other: object) -> bool: + return self.__cmp__(other) > 0 + + def __lt__(self, other: object) -> bool: + return self.__cmp__(other) < 0 + + def __ge__(self, other: object) -> bool: + return self.__cmp__(other) >= 0 + + def __le__(self, other: object) -> bool: + return self.__cmp__(other) <= 0 + + def __eq__(self, other: object) -> bool: + return self.__cmp__(other) == 0 + + def __ne__(self, other: object) -> bool: + return self.__cmp__(other) != 0 + + def is_identical(self, other: Message) -> bool: + """Checks whether messages are identical, taking into account all + properties. + """ + assert isinstance(other, Message) + return self.__dict__ == other.__dict__ + + def clone(self) -> Message: + return Message(*map(copy, (self.id, self.string, self.locations, + self.flags, self.auto_comments, + self.user_comments, self.previous_id, + self.lineno, self.context))) + + def check(self, catalog: Catalog | None = None) -> list[TranslationError]: + """Run various validation checks on the message. Some validations + are only performed if the catalog is provided. This method returns + a sequence of `TranslationError` objects. + + :rtype: ``iterator`` + :param catalog: A catalog instance that is passed to the checkers + :see: `Catalog.check` for a way to perform checks for all messages + in a catalog. + """ + from babel.messages.checkers import checkers + errors: list[TranslationError] = [] + for checker in checkers: + try: + checker(catalog, self) + except TranslationError as e: + errors.append(e) + return errors + + @property + def fuzzy(self) -> bool: + """Whether the translation is fuzzy. + + >>> Message('foo').fuzzy + False + >>> msg = Message('foo', 'foo', flags=['fuzzy']) + >>> msg.fuzzy + True + >>> msg + + + :type: `bool`""" + return 'fuzzy' in self.flags + + @property + def pluralizable(self) -> bool: + """Whether the message is plurizable. + + >>> Message('foo').pluralizable + False + >>> Message(('foo', 'bar')).pluralizable + True + + :type: `bool`""" + return isinstance(self.id, (list, tuple)) + + @property + def python_format(self) -> bool: + """Whether the message contains Python-style parameters. + + >>> Message('foo %(name)s bar').python_format + True + >>> Message(('foo %(name)s', 'foo %(name)s')).python_format + True + + :type: `bool`""" + ids = self.id + if not isinstance(ids, (list, tuple)): + ids = [ids] + return any(PYTHON_FORMAT.search(id) for id in ids) + + @property + def python_brace_format(self) -> bool: + """Whether the message contains Python f-string parameters. + + >>> Message('Hello, {name}!').python_brace_format + True + >>> Message(('One apple', '{count} apples')).python_brace_format + True + + :type: `bool`""" + ids = self.id + if not isinstance(ids, (list, tuple)): + ids = [ids] + return any(_has_python_brace_format(id) for id in ids) + + +class TranslationError(Exception): + """Exception thrown by translation checkers when invalid message + translations are encountered.""" + + +DEFAULT_HEADER = """\ +# Translations template for PROJECT. +# Copyright (C) YEAR ORGANIZATION +# This file is distributed under the same license as the PROJECT project. +# FIRST AUTHOR , YEAR. +#""" + + +def parse_separated_header(value: str) -> dict[str, str]: + # Adapted from https://peps.python.org/pep-0594/#cgi + from email.message import Message + m = Message() + m['content-type'] = value + return dict(m.get_params()) + + +def _force_text(s: str | bytes, encoding: str = 'utf-8', errors: str = 'strict') -> str: + if isinstance(s, str): + return s + if isinstance(s, bytes): + return s.decode(encoding, errors) + return str(s) + + +class Catalog: + """Representation of a message catalog.""" + + def __init__( + self, + locale: Locale | str | None = None, + domain: str | None = None, + header_comment: str | None = DEFAULT_HEADER, + project: str | None = None, + version: str | None = None, + copyright_holder: str | None = None, + msgid_bugs_address: str | None = None, + creation_date: datetime.datetime | str | None = None, + revision_date: datetime.datetime | datetime.time | float | str | None = None, + last_translator: str | None = None, + language_team: str | None = None, + charset: str | None = None, + fuzzy: bool = True, + ) -> None: + """Initialize the catalog object. + + :param locale: the locale identifier or `Locale` object, or `None` + if the catalog is not bound to a locale (which basically + means it's a template) + :param domain: the message domain + :param header_comment: the header comment as string, or `None` for the + default header + :param project: the project's name + :param version: the project's version + :param copyright_holder: the copyright holder of the catalog + :param msgid_bugs_address: the email address or URL to submit bug + reports to + :param creation_date: the date the catalog was created + :param revision_date: the date the catalog was revised + :param last_translator: the name and email of the last translator + :param language_team: the name and email of the language team + :param charset: the encoding to use in the output (defaults to utf-8) + :param fuzzy: the fuzzy bit on the catalog header + """ + self.domain = domain + self.locale = locale + self._header_comment = header_comment + self._messages: dict[str | tuple[str, str], Message] = {} + + self.project = project or 'PROJECT' + self.version = version or 'VERSION' + self.copyright_holder = copyright_holder or 'ORGANIZATION' + self.msgid_bugs_address = msgid_bugs_address or 'EMAIL@ADDRESS' + + self.last_translator = last_translator or 'FULL NAME ' + """Name and email address of the last translator.""" + self.language_team = language_team or 'LANGUAGE ' + """Name and email address of the language team.""" + + self.charset = charset or 'utf-8' + + if creation_date is None: + creation_date = datetime.datetime.now(LOCALTZ) + elif isinstance(creation_date, datetime.datetime) and not creation_date.tzinfo: + creation_date = creation_date.replace(tzinfo=LOCALTZ) + self.creation_date = creation_date + if revision_date is None: + revision_date = 'YEAR-MO-DA HO:MI+ZONE' + elif isinstance(revision_date, datetime.datetime) and not revision_date.tzinfo: + revision_date = revision_date.replace(tzinfo=LOCALTZ) + self.revision_date = revision_date + self.fuzzy = fuzzy + + # Dictionary of obsolete messages + self.obsolete: dict[str | tuple[str, str], Message] = {} + self._num_plurals = None + self._plural_expr = None + + def _set_locale(self, locale: Locale | str | None) -> None: + if locale is None: + self._locale_identifier = None + self._locale = None + return + + if isinstance(locale, Locale): + self._locale_identifier = str(locale) + self._locale = locale + return + + if isinstance(locale, str): + self._locale_identifier = str(locale) + try: + self._locale = Locale.parse(locale) + except UnknownLocaleError: + self._locale = None + return + + raise TypeError(f"`locale` must be a Locale, a locale identifier string, or None; got {locale!r}") + + def _get_locale(self) -> Locale | None: + return self._locale + + def _get_locale_identifier(self) -> str | None: + return self._locale_identifier + + locale = property(_get_locale, _set_locale) + locale_identifier = property(_get_locale_identifier) + + def _get_header_comment(self) -> str: + comment = self._header_comment + year = datetime.datetime.now(LOCALTZ).strftime('%Y') + if hasattr(self.revision_date, 'strftime'): + year = self.revision_date.strftime('%Y') + comment = comment.replace('PROJECT', self.project) \ + .replace('VERSION', self.version) \ + .replace('YEAR', year) \ + .replace('ORGANIZATION', self.copyright_holder) + locale_name = (self.locale.english_name if self.locale else self.locale_identifier) + if locale_name: + comment = comment.replace("Translations template", f"{locale_name} translations") + return comment + + def _set_header_comment(self, string: str | None) -> None: + self._header_comment = string + + header_comment = property(_get_header_comment, _set_header_comment, doc="""\ + The header comment for the catalog. + + >>> catalog = Catalog(project='Foobar', version='1.0', + ... copyright_holder='Foo Company') + >>> print(catalog.header_comment) #doctest: +ELLIPSIS + # Translations template for Foobar. + # Copyright (C) ... Foo Company + # This file is distributed under the same license as the Foobar project. + # FIRST AUTHOR , .... + # + + The header can also be set from a string. Any known upper-case variables + will be replaced when the header is retrieved again: + + >>> catalog = Catalog(project='Foobar', version='1.0', + ... copyright_holder='Foo Company') + >>> catalog.header_comment = '''\\ + ... # The POT for my really cool PROJECT project. + ... # Copyright (C) 1990-2003 ORGANIZATION + ... # This file is distributed under the same license as the PROJECT + ... # project. + ... #''' + >>> print(catalog.header_comment) + # The POT for my really cool Foobar project. + # Copyright (C) 1990-2003 Foo Company + # This file is distributed under the same license as the Foobar + # project. + # + + :type: `unicode` + """) + + def _get_mime_headers(self) -> list[tuple[str, str]]: + if isinstance(self.revision_date, (datetime.datetime, datetime.time, int, float)): + revision_date = format_datetime(self.revision_date, 'yyyy-MM-dd HH:mmZ', locale='en') + else: + revision_date = self.revision_date + + language_team = self.language_team + if self.locale_identifier and 'LANGUAGE' in language_team: + language_team = language_team.replace('LANGUAGE', str(self.locale_identifier)) + + headers: list[tuple[str, str]] = [ + ("Project-Id-Version", f"{self.project} {self.version}"), + ('Report-Msgid-Bugs-To', self.msgid_bugs_address), + ('POT-Creation-Date', format_datetime(self.creation_date, 'yyyy-MM-dd HH:mmZ', locale='en')), + ('PO-Revision-Date', revision_date), + ('Last-Translator', self.last_translator), + ] + if self.locale_identifier: + headers.append(('Language', str(self.locale_identifier))) + headers.append(('Language-Team', language_team)) + if self.locale is not None: + headers.append(('Plural-Forms', self.plural_forms)) + headers += [ + ('MIME-Version', '1.0'), + ("Content-Type", f"text/plain; charset={self.charset}"), + ('Content-Transfer-Encoding', '8bit'), + ("Generated-By", f"Babel {VERSION}\n"), + ] + return headers + + def _set_mime_headers(self, headers: Iterable[tuple[str, str]]) -> None: + for name, value in headers: + name = _force_text(name.lower(), encoding=self.charset) + value = _force_text(value, encoding=self.charset) + if name == 'project-id-version': + parts = value.split(' ') + self.project = ' '.join(parts[:-1]) + self.version = parts[-1] + elif name == 'report-msgid-bugs-to': + self.msgid_bugs_address = value + elif name == 'last-translator': + self.last_translator = value + elif name == 'language': + value = value.replace('-', '_') + # The `or None` makes sure that the locale is set to None + # if the header's value is an empty string, which is what + # some tools generate (instead of eliding the empty Language + # header altogether). + self._set_locale(value or None) + elif name == 'language-team': + self.language_team = value + elif name == 'content-type': + params = parse_separated_header(value) + if 'charset' in params: + self.charset = params['charset'].lower() + elif name == 'plural-forms': + params = parse_separated_header(f" ;{value}") + self._num_plurals = int(params.get('nplurals', 2)) + self._plural_expr = params.get('plural', '(n != 1)') + elif name == 'pot-creation-date': + self.creation_date = _parse_datetime_header(value) + elif name == 'po-revision-date': + # Keep the value if it's not the default one + if 'YEAR' not in value: + self.revision_date = _parse_datetime_header(value) + + mime_headers = property(_get_mime_headers, _set_mime_headers, doc="""\ + The MIME headers of the catalog, used for the special ``msgid ""`` entry. + + The behavior of this property changes slightly depending on whether a locale + is set or not, the latter indicating that the catalog is actually a template + for actual translations. + + Here's an example of the output for such a catalog template: + + >>> from babel.dates import UTC + >>> from datetime import datetime + >>> created = datetime(1990, 4, 1, 15, 30, tzinfo=UTC) + >>> catalog = Catalog(project='Foobar', version='1.0', + ... creation_date=created) + >>> for name, value in catalog.mime_headers: + ... print('%s: %s' % (name, value)) + Project-Id-Version: Foobar 1.0 + Report-Msgid-Bugs-To: EMAIL@ADDRESS + POT-Creation-Date: 1990-04-01 15:30+0000 + PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE + Last-Translator: FULL NAME + Language-Team: LANGUAGE + MIME-Version: 1.0 + Content-Type: text/plain; charset=utf-8 + Content-Transfer-Encoding: 8bit + Generated-By: Babel ... + + And here's an example of the output when the locale is set: + + >>> revised = datetime(1990, 8, 3, 12, 0, tzinfo=UTC) + >>> catalog = Catalog(locale='de_DE', project='Foobar', version='1.0', + ... creation_date=created, revision_date=revised, + ... last_translator='John Doe ', + ... language_team='de_DE ') + >>> for name, value in catalog.mime_headers: + ... print('%s: %s' % (name, value)) + Project-Id-Version: Foobar 1.0 + Report-Msgid-Bugs-To: EMAIL@ADDRESS + POT-Creation-Date: 1990-04-01 15:30+0000 + PO-Revision-Date: 1990-08-03 12:00+0000 + Last-Translator: John Doe + Language: de_DE + Language-Team: de_DE + Plural-Forms: nplurals=2; plural=(n != 1); + MIME-Version: 1.0 + Content-Type: text/plain; charset=utf-8 + Content-Transfer-Encoding: 8bit + Generated-By: Babel ... + + :type: `list` + """) + + @property + def num_plurals(self) -> int: + """The number of plurals used by the catalog or locale. + + >>> Catalog(locale='en').num_plurals + 2 + >>> Catalog(locale='ga').num_plurals + 5 + + :type: `int`""" + if self._num_plurals is None: + num = 2 + if self.locale: + num = get_plural(self.locale)[0] + self._num_plurals = num + return self._num_plurals + + @property + def plural_expr(self) -> str: + """The plural expression used by the catalog or locale. + + >>> Catalog(locale='en').plural_expr + '(n != 1)' + >>> Catalog(locale='ga').plural_expr + '(n==1 ? 0 : n==2 ? 1 : n>=3 && n<=6 ? 2 : n>=7 && n<=10 ? 3 : 4)' + >>> Catalog(locale='ding').plural_expr # unknown locale + '(n != 1)' + + :type: `str`""" + if self._plural_expr is None: + expr = '(n != 1)' + if self.locale: + expr = get_plural(self.locale)[1] + self._plural_expr = expr + return self._plural_expr + + @property + def plural_forms(self) -> str: + """Return the plural forms declaration for the locale. + + >>> Catalog(locale='en').plural_forms + 'nplurals=2; plural=(n != 1);' + >>> Catalog(locale='pt_BR').plural_forms + 'nplurals=2; plural=(n > 1);' + + :type: `str`""" + return f"nplurals={self.num_plurals}; plural={self.plural_expr};" + + def __contains__(self, id: _MessageID) -> bool: + """Return whether the catalog has a message with the specified ID.""" + return self._key_for(id) in self._messages + + def __len__(self) -> int: + """The number of messages in the catalog. + + This does not include the special ``msgid ""`` entry.""" + return len(self._messages) + + def __iter__(self) -> Iterator[Message]: + """Iterates through all the entries in the catalog, in the order they + were added, yielding a `Message` object for every entry. + + :rtype: ``iterator``""" + buf = [] + for name, value in self.mime_headers: + buf.append(f"{name}: {value}") + flags = set() + if self.fuzzy: + flags |= {'fuzzy'} + yield Message('', '\n'.join(buf), flags=flags) + for key in self._messages: + yield self._messages[key] + + def __repr__(self) -> str: + locale = '' + if self.locale: + locale = f" {self.locale}" + return f"<{type(self).__name__} {self.domain!r}{locale}>" + + def __delitem__(self, id: _MessageID) -> None: + """Delete the message with the specified ID.""" + self.delete(id) + + def __getitem__(self, id: _MessageID) -> Message: + """Return the message with the specified ID. + + :param id: the message ID + """ + return self.get(id) + + def __setitem__(self, id: _MessageID, message: Message) -> None: + """Add or update the message with the specified ID. + + >>> catalog = Catalog() + >>> catalog[u'foo'] = Message(u'foo') + >>> catalog[u'foo'] + + + If a message with that ID is already in the catalog, it is updated + to include the locations and flags of the new message. + + >>> catalog = Catalog() + >>> catalog[u'foo'] = Message(u'foo', locations=[('main.py', 1)]) + >>> catalog[u'foo'].locations + [('main.py', 1)] + >>> catalog[u'foo'] = Message(u'foo', locations=[('utils.py', 5)]) + >>> catalog[u'foo'].locations + [('main.py', 1), ('utils.py', 5)] + + :param id: the message ID + :param message: the `Message` object + """ + assert isinstance(message, Message), 'expected a Message object' + key = self._key_for(id, message.context) + current = self._messages.get(key) + if current: + if message.pluralizable and not current.pluralizable: + # The new message adds pluralization + current.id = message.id + current.string = message.string + current.locations = list(distinct(current.locations + + message.locations)) + current.auto_comments = list(distinct(current.auto_comments + + message.auto_comments)) + current.user_comments = list(distinct(current.user_comments + + message.user_comments)) + current.flags |= message.flags + elif id == '': + # special treatment for the header message + self.mime_headers = message_from_string(message.string).items() + self.header_comment = "\n".join([f"# {c}".rstrip() for c in message.user_comments]) + self.fuzzy = message.fuzzy + else: + if isinstance(id, (list, tuple)): + assert isinstance(message.string, (list, tuple)), \ + f"Expected sequence but got {type(message.string)}" + self._messages[key] = message + + def add( + self, + id: _MessageID, + string: _MessageID | None = None, + locations: Iterable[tuple[str, int]] = (), + flags: Iterable[str] = (), + auto_comments: Iterable[str] = (), + user_comments: Iterable[str] = (), + previous_id: _MessageID = (), + lineno: int | None = None, + context: str | None = None, + ) -> Message: + """Add or update the message with the specified ID. + + >>> catalog = Catalog() + >>> catalog.add(u'foo') + + >>> catalog[u'foo'] + + + This method simply constructs a `Message` object with the given + arguments and invokes `__setitem__` with that object. + + :param id: the message ID, or a ``(singular, plural)`` tuple for + pluralizable messages + :param string: the translated message string, or a + ``(singular, plural)`` tuple for pluralizable messages + :param locations: a sequence of ``(filename, lineno)`` tuples + :param flags: a set or sequence of flags + :param auto_comments: a sequence of automatic comments + :param user_comments: a sequence of user comments + :param previous_id: the previous message ID, or a ``(singular, plural)`` + tuple for pluralizable messages + :param lineno: the line number on which the msgid line was found in the + PO file, if any + :param context: the message context + """ + message = Message(id, string, list(locations), flags, auto_comments, + user_comments, previous_id, lineno=lineno, + context=context) + self[id] = message + return message + + def check(self) -> Iterable[tuple[Message, list[TranslationError]]]: + """Run various validation checks on the translations in the catalog. + + For every message which fails validation, this method yield a + ``(message, errors)`` tuple, where ``message`` is the `Message` object + and ``errors`` is a sequence of `TranslationError` objects. + + :rtype: ``generator`` of ``(message, errors)`` + """ + for message in self._messages.values(): + errors = message.check(catalog=self) + if errors: + yield message, errors + + def get(self, id: _MessageID, context: str | None = None) -> Message | None: + """Return the message with the specified ID and context. + + :param id: the message ID + :param context: the message context, or ``None`` for no context + """ + return self._messages.get(self._key_for(id, context)) + + def delete(self, id: _MessageID, context: str | None = None) -> None: + """Delete the message with the specified ID and context. + + :param id: the message ID + :param context: the message context, or ``None`` for no context + """ + key = self._key_for(id, context) + if key in self._messages: + del self._messages[key] + + def update( + self, + template: Catalog, + no_fuzzy_matching: bool = False, + update_header_comment: bool = False, + keep_user_comments: bool = True, + update_creation_date: bool = True, + ) -> None: + """Update the catalog based on the given template catalog. + + >>> from babel.messages import Catalog + >>> template = Catalog() + >>> template.add('green', locations=[('main.py', 99)]) + + >>> template.add('blue', locations=[('main.py', 100)]) + + >>> template.add(('salad', 'salads'), locations=[('util.py', 42)]) + + >>> catalog = Catalog(locale='de_DE') + >>> catalog.add('blue', u'blau', locations=[('main.py', 98)]) + + >>> catalog.add('head', u'Kopf', locations=[('util.py', 33)]) + + >>> catalog.add(('salad', 'salads'), (u'Salat', u'Salate'), + ... locations=[('util.py', 38)]) + + + >>> catalog.update(template) + >>> len(catalog) + 3 + + >>> msg1 = catalog['green'] + >>> msg1.string + >>> msg1.locations + [('main.py', 99)] + + >>> msg2 = catalog['blue'] + >>> msg2.string + u'blau' + >>> msg2.locations + [('main.py', 100)] + + >>> msg3 = catalog['salad'] + >>> msg3.string + (u'Salat', u'Salate') + >>> msg3.locations + [('util.py', 42)] + + Messages that are in the catalog but not in the template are removed + from the main collection, but can still be accessed via the `obsolete` + member: + + >>> 'head' in catalog + False + >>> list(catalog.obsolete.values()) + [] + + :param template: the reference catalog, usually read from a POT file + :param no_fuzzy_matching: whether to use fuzzy matching of message IDs + :param update_header_comment: whether to copy the header comment from the template + :param keep_user_comments: whether to keep user comments from the old catalog + :param update_creation_date: whether to copy the creation date from the template + """ + messages = self._messages + remaining = messages.copy() + self._messages = {} + + # Prepare for fuzzy matching + fuzzy_candidates = {} + if not no_fuzzy_matching: + for msgid in messages: + if msgid and messages[msgid].string: + key = self._key_for(msgid) + ctxt = messages[msgid].context + fuzzy_candidates[self._to_fuzzy_match_key(key)] = (key, ctxt) + fuzzy_matches = set() + + def _merge(message: Message, oldkey: tuple[str, str] | str, newkey: tuple[str, str] | str) -> None: + message = message.clone() + fuzzy = False + if oldkey != newkey: + fuzzy = True + fuzzy_matches.add(oldkey) + oldmsg = messages.get(oldkey) + assert oldmsg is not None + if isinstance(oldmsg.id, str): + message.previous_id = [oldmsg.id] + else: + message.previous_id = list(oldmsg.id) + else: + oldmsg = remaining.pop(oldkey, None) + assert oldmsg is not None + message.string = oldmsg.string + + if keep_user_comments: + message.user_comments = list(distinct(oldmsg.user_comments)) + + if isinstance(message.id, (list, tuple)): + if not isinstance(message.string, (list, tuple)): + fuzzy = True + message.string = tuple( + [message.string] + ([''] * (len(message.id) - 1)), + ) + elif len(message.string) != self.num_plurals: + fuzzy = True + message.string = tuple(message.string[:len(oldmsg.string)]) + elif isinstance(message.string, (list, tuple)): + fuzzy = True + message.string = message.string[0] + message.flags |= oldmsg.flags + if fuzzy: + message.flags |= {'fuzzy'} + self[message.id] = message + + for message in template: + if message.id: + key = self._key_for(message.id, message.context) + if key in messages: + _merge(message, key, key) + else: + if not no_fuzzy_matching: + # do some fuzzy matching with difflib + matches = get_close_matches( + self._to_fuzzy_match_key(key), + fuzzy_candidates.keys(), + 1, + ) + if matches: + modified_key = matches[0] + newkey, newctxt = fuzzy_candidates[modified_key] + if newctxt is not None: + newkey = newkey, newctxt + _merge(message, newkey, key) + continue + + self[message.id] = message + + for msgid in remaining: + if no_fuzzy_matching or msgid not in fuzzy_matches: + self.obsolete[msgid] = remaining[msgid] + + if update_header_comment: + # Allow the updated catalog's header to be rewritten based on the + # template's header + self.header_comment = template.header_comment + + # Make updated catalog's POT-Creation-Date equal to the template + # used to update the catalog + if update_creation_date: + self.creation_date = template.creation_date + + def _to_fuzzy_match_key(self, key: tuple[str, str] | str) -> str: + """Converts a message key to a string suitable for fuzzy matching.""" + if isinstance(key, tuple): + matchkey = key[0] # just the msgid, no context + else: + matchkey = key + return matchkey.lower().strip() + + def _key_for(self, id: _MessageID, context: str | None = None) -> tuple[str, str] | str: + """The key for a message is just the singular ID even for pluralizable + messages, but is a ``(msgid, msgctxt)`` tuple for context-specific + messages. + """ + key = id + if isinstance(key, (list, tuple)): + key = id[0] + if context is not None: + key = (key, context) + return key + + def is_identical(self, other: Catalog) -> bool: + """Checks if catalogs are identical, taking into account messages and + headers. + """ + assert isinstance(other, Catalog) + for key in self._messages.keys() | other._messages.keys(): + message_1 = self.get(key) + message_2 = other.get(key) + if ( + message_1 is None + or message_2 is None + or not message_1.is_identical(message_2) + ): + return False + return dict(self.mime_headers) == dict(other.mime_headers) diff --git a/venv/Lib/site-packages/babel/messages/checkers.py b/venv/Lib/site-packages/babel/messages/checkers.py new file mode 100644 index 0000000000000000000000000000000000000000..df7c3ca73bcbdf160c7e7aeb186dcc28e43eb154 --- /dev/null +++ b/venv/Lib/site-packages/babel/messages/checkers.py @@ -0,0 +1,168 @@ +""" + babel.messages.checkers + ~~~~~~~~~~~~~~~~~~~~~~~ + + Various routines that help with validation of translations. + + :since: version 0.9 + + :copyright: (c) 2013-2025 by the Babel Team. + :license: BSD, see LICENSE for more details. +""" +from __future__ import annotations + +from collections.abc import Callable + +from babel.messages.catalog import PYTHON_FORMAT, Catalog, Message, TranslationError + +#: list of format chars that are compatible to each other +_string_format_compatibilities = [ + {'i', 'd', 'u'}, + {'x', 'X'}, + {'f', 'F', 'g', 'G'}, +] + + +def num_plurals(catalog: Catalog | None, message: Message) -> None: + """Verify the number of plurals in the translation.""" + if not message.pluralizable: + if not isinstance(message.string, str): + raise TranslationError("Found plural forms for non-pluralizable " + "message") + return + + # skip further tests if no catalog is provided. + elif catalog is None: + return + + msgstrs = message.string + if not isinstance(msgstrs, (list, tuple)): + msgstrs = (msgstrs,) + if len(msgstrs) != catalog.num_plurals: + raise TranslationError("Wrong number of plural forms (expected %d)" % + catalog.num_plurals) + + +def python_format(catalog: Catalog | None, message: Message) -> None: + """Verify the format string placeholders in the translation.""" + if 'python-format' not in message.flags: + return + msgids = message.id + if not isinstance(msgids, (list, tuple)): + msgids = (msgids,) + msgstrs = message.string + if not isinstance(msgstrs, (list, tuple)): + msgstrs = (msgstrs,) + + for msgid, msgstr in zip(msgids, msgstrs): + if msgstr: + _validate_format(msgid, msgstr) + + +def _validate_format(format: str, alternative: str) -> None: + """Test format string `alternative` against `format`. `format` can be the + msgid of a message and `alternative` one of the `msgstr`\\s. The two + arguments are not interchangeable as `alternative` may contain less + placeholders if `format` uses named placeholders. + + If the string formatting of `alternative` is compatible to `format` the + function returns `None`, otherwise a `TranslationError` is raised. + + Examples for compatible format strings: + + >>> _validate_format('Hello %s!', 'Hallo %s!') + >>> _validate_format('Hello %i!', 'Hallo %d!') + + Example for an incompatible format strings: + + >>> _validate_format('Hello %(name)s!', 'Hallo %s!') + Traceback (most recent call last): + ... + TranslationError: the format strings are of different kinds + + This function is used by the `python_format` checker. + + :param format: The original format string + :param alternative: The alternative format string that should be checked + against format + :raises TranslationError: on formatting errors + """ + + def _parse(string: str) -> list[tuple[str, str]]: + result: list[tuple[str, str]] = [] + for match in PYTHON_FORMAT.finditer(string): + name, format, typechar = match.groups() + if typechar == '%' and name is None: + continue + result.append((name, str(typechar))) + return result + + def _compatible(a: str, b: str) -> bool: + if a == b: + return True + for set in _string_format_compatibilities: + if a in set and b in set: + return True + return False + + def _check_positional(results: list[tuple[str, str]]) -> bool: + positional = None + for name, _char in results: + if positional is None: + positional = name is None + else: + if (name is None) != positional: + raise TranslationError('format string mixes positional ' + 'and named placeholders') + return bool(positional) + + a, b = map(_parse, (format, alternative)) + + if not a: + return + + # now check if both strings are positional or named + a_positional, b_positional = map(_check_positional, (a, b)) + if a_positional and not b_positional and not b: + raise TranslationError('placeholders are incompatible') + elif a_positional != b_positional: + raise TranslationError('the format strings are of different kinds') + + # if we are operating on positional strings both must have the + # same number of format chars and those must be compatible + if a_positional: + if len(a) != len(b): + raise TranslationError('positional format placeholders are ' + 'unbalanced') + for idx, ((_, first), (_, second)) in enumerate(zip(a, b)): + if not _compatible(first, second): + raise TranslationError('incompatible format for placeholder ' + '%d: %r and %r are not compatible' % + (idx + 1, first, second)) + + # otherwise the second string must not have names the first one + # doesn't have and the types of those included must be compatible + else: + type_map = dict(a) + for name, typechar in b: + if name not in type_map: + raise TranslationError(f'unknown named placeholder {name!r}') + elif not _compatible(typechar, type_map[name]): + raise TranslationError( + f'incompatible format for placeholder {name!r}: ' + f'{typechar!r} and {type_map[name]!r} are not compatible', + ) + + +def _find_checkers() -> list[Callable[[Catalog | None, Message], object]]: + from babel.messages._compat import find_entrypoints + checkers: list[Callable[[Catalog | None, Message], object]] = [] + checkers.extend(load() for (name, load) in find_entrypoints('babel.checkers')) + if len(checkers) == 0: + # if entrypoints are not available or no usable egg-info was found + # (see #230), just resort to hard-coded checkers + return [num_plurals, python_format] + return checkers + + +checkers: list[Callable[[Catalog | None, Message], object]] = _find_checkers() diff --git a/venv/Lib/site-packages/babel/messages/extract.py b/venv/Lib/site-packages/babel/messages/extract.py new file mode 100644 index 0000000000000000000000000000000000000000..7f4230f617b7951e8efc11291b85e7ef7be143b4 --- /dev/null +++ b/venv/Lib/site-packages/babel/messages/extract.py @@ -0,0 +1,852 @@ +""" + babel.messages.extract + ~~~~~~~~~~~~~~~~~~~~~~ + + Basic infrastructure for extracting localizable messages from source files. + + This module defines an extensible system for collecting localizable message + strings from a variety of sources. A native extractor for Python source + files is builtin, extractors for other sources can be added using very + simple plugins. + + The main entry points into the extraction functionality are the functions + `extract_from_dir` and `extract_from_file`. + + :copyright: (c) 2013-2025 by the Babel Team. + :license: BSD, see LICENSE for more details. +""" +from __future__ import annotations + +import ast +import io +import os +import sys +import tokenize +from collections.abc import ( + Callable, + Collection, + Generator, + Iterable, + Mapping, + MutableSequence, +) +from functools import lru_cache +from os.path import relpath +from textwrap import dedent +from tokenize import COMMENT, NAME, NL, OP, STRING, generate_tokens +from typing import TYPE_CHECKING, Any, TypedDict + +from babel.messages._compat import find_entrypoints +from babel.util import parse_encoding, parse_future_flags, pathmatch + +if TYPE_CHECKING: + from typing import IO, Final, Protocol + + from _typeshed import SupportsItems, SupportsRead, SupportsReadline + from typing_extensions import TypeAlias + + class _PyOptions(TypedDict, total=False): + encoding: str + + class _JSOptions(TypedDict, total=False): + encoding: str + jsx: bool + template_string: bool + parse_template_string: bool + + class _FileObj(SupportsRead[bytes], SupportsReadline[bytes], Protocol): + def seek(self, __offset: int, __whence: int = ...) -> int: ... + def tell(self) -> int: ... + + _SimpleKeyword: TypeAlias = tuple[int | tuple[int, int] | tuple[int, str], ...] | None + _Keyword: TypeAlias = dict[int | None, _SimpleKeyword] | _SimpleKeyword + + # 5-tuple of (filename, lineno, messages, comments, context) + _FileExtractionResult: TypeAlias = tuple[str, int, str | tuple[str, ...], list[str], str | None] + + # 4-tuple of (lineno, message, comments, context) + _ExtractionResult: TypeAlias = tuple[int, str | tuple[str, ...], list[str], str | None] + + # Required arguments: fileobj, keywords, comment_tags, options + # Return value: Iterable of (lineno, message, comments, context) + _CallableExtractionMethod: TypeAlias = Callable[ + [_FileObj | IO[bytes], Mapping[str, _Keyword], Collection[str], Mapping[str, Any]], + Iterable[_ExtractionResult], + ] + + _ExtractionMethod: TypeAlias = _CallableExtractionMethod | str + +GROUP_NAME: Final[str] = 'babel.extractors' + +DEFAULT_KEYWORDS: dict[str, _Keyword] = { + '_': None, + 'gettext': None, + 'ngettext': (1, 2), + 'ugettext': None, + 'ungettext': (1, 2), + 'dgettext': (2,), + 'dngettext': (2, 3), + 'N_': None, + 'pgettext': ((1, 'c'), 2), + 'npgettext': ((1, 'c'), 2, 3), +} + +DEFAULT_MAPPING: list[tuple[str, str]] = [('**.py', 'python')] + +# New tokens in Python 3.12, or None on older versions +FSTRING_START = getattr(tokenize, "FSTRING_START", None) +FSTRING_MIDDLE = getattr(tokenize, "FSTRING_MIDDLE", None) +FSTRING_END = getattr(tokenize, "FSTRING_END", None) + + +def _strip_comment_tags(comments: MutableSequence[str], tags: Iterable[str]): + """Helper function for `extract` that strips comment tags from strings + in a list of comment lines. This functions operates in-place. + """ + def _strip(line: str): + for tag in tags: + if line.startswith(tag): + return line[len(tag):].strip() + return line + comments[:] = map(_strip, comments) + + +def default_directory_filter(dirpath: str | os.PathLike[str]) -> bool: + subdir = os.path.basename(dirpath) + # Legacy default behavior: ignore dot and underscore directories + return not (subdir.startswith('.') or subdir.startswith('_')) + + +def extract_from_dir( + dirname: str | os.PathLike[str] | None = None, + method_map: Iterable[tuple[str, str]] = DEFAULT_MAPPING, + options_map: SupportsItems[str, dict[str, Any]] | None = None, + keywords: Mapping[str, _Keyword] = DEFAULT_KEYWORDS, + comment_tags: Collection[str] = (), + callback: Callable[[str, str, dict[str, Any]], object] | None = None, + strip_comment_tags: bool = False, + directory_filter: Callable[[str], bool] | None = None, +) -> Generator[_FileExtractionResult, None, None]: + """Extract messages from any source files found in the given directory. + + This function generates tuples of the form ``(filename, lineno, message, + comments, context)``. + + Which extraction method is used per file is determined by the `method_map` + parameter, which maps extended glob patterns to extraction method names. + For example, the following is the default mapping: + + >>> method_map = [ + ... ('**.py', 'python') + ... ] + + This basically says that files with the filename extension ".py" at any + level inside the directory should be processed by the "python" extraction + method. Files that don't match any of the mapping patterns are ignored. See + the documentation of the `pathmatch` function for details on the pattern + syntax. + + The following extended mapping would also use the "genshi" extraction + method on any file in "templates" subdirectory: + + >>> method_map = [ + ... ('**/templates/**.*', 'genshi'), + ... ('**.py', 'python') + ... ] + + The dictionary provided by the optional `options_map` parameter augments + these mappings. It uses extended glob patterns as keys, and the values are + dictionaries mapping options names to option values (both strings). + + The glob patterns of the `options_map` do not necessarily need to be the + same as those used in the method mapping. For example, while all files in + the ``templates`` folders in an application may be Genshi applications, the + options for those files may differ based on extension: + + >>> options_map = { + ... '**/templates/**.txt': { + ... 'template_class': 'genshi.template:TextTemplate', + ... 'encoding': 'latin-1' + ... }, + ... '**/templates/**.html': { + ... 'include_attrs': '' + ... } + ... } + + :param dirname: the path to the directory to extract messages from. If + not given the current working directory is used. + :param method_map: a list of ``(pattern, method)`` tuples that maps of + extraction method names to extended glob patterns + :param options_map: a dictionary of additional options (optional) + :param keywords: a dictionary mapping keywords (i.e. names of functions + that should be recognized as translation functions) to + tuples that specify which of their arguments contain + localizable strings + :param comment_tags: a list of tags of translator comments to search for + and include in the results + :param callback: a function that is called for every file that message are + extracted from, just before the extraction itself is + performed; the function is passed the filename, the name + of the extraction method and and the options dictionary as + positional arguments, in that order + :param strip_comment_tags: a flag that if set to `True` causes all comment + tags to be removed from the collected comments. + :param directory_filter: a callback to determine whether a directory should + be recursed into. Receives the full directory path; + should return True if the directory is valid. + :see: `pathmatch` + """ + if dirname is None: + dirname = os.getcwd() + if options_map is None: + options_map = {} + if directory_filter is None: + directory_filter = default_directory_filter + + absname = os.path.abspath(dirname) + for root, dirnames, filenames in os.walk(absname): + dirnames[:] = [ + subdir for subdir in dirnames + if directory_filter(os.path.join(root, subdir)) + ] + dirnames.sort() + filenames.sort() + for filename in filenames: + filepath = os.path.join(root, filename).replace(os.sep, '/') + + yield from check_and_call_extract_file( + filepath, + method_map, + options_map, + callback, + keywords, + comment_tags, + strip_comment_tags, + dirpath=absname, + ) + + +def check_and_call_extract_file( + filepath: str | os.PathLike[str], + method_map: Iterable[tuple[str, str]], + options_map: SupportsItems[str, dict[str, Any]], + callback: Callable[[str, str, dict[str, Any]], object] | None, + keywords: Mapping[str, _Keyword], + comment_tags: Collection[str], + strip_comment_tags: bool, + dirpath: str | os.PathLike[str] | None = None, +) -> Generator[_FileExtractionResult, None, None]: + """Checks if the given file matches an extraction method mapping, and if so, calls extract_from_file. + + Note that the extraction method mappings are based relative to dirpath. + So, given an absolute path to a file `filepath`, we want to check using + just the relative path from `dirpath` to `filepath`. + + Yields 5-tuples (filename, lineno, messages, comments, context). + + :param filepath: An absolute path to a file that exists. + :param method_map: a list of ``(pattern, method)`` tuples that maps of + extraction method names to extended glob patterns + :param options_map: a dictionary of additional options (optional) + :param callback: a function that is called for every file that message are + extracted from, just before the extraction itself is + performed; the function is passed the filename, the name + of the extraction method and and the options dictionary as + positional arguments, in that order + :param keywords: a dictionary mapping keywords (i.e. names of functions + that should be recognized as translation functions) to + tuples that specify which of their arguments contain + localizable strings + :param comment_tags: a list of tags of translator comments to search for + and include in the results + :param strip_comment_tags: a flag that if set to `True` causes all comment + tags to be removed from the collected comments. + :param dirpath: the path to the directory to extract messages from. + :return: iterable of 5-tuples (filename, lineno, messages, comments, context) + :rtype: Iterable[tuple[str, int, str|tuple[str], list[str], str|None] + """ + # filename is the relative path from dirpath to the actual file + filename = relpath(filepath, dirpath) + + for pattern, method in method_map: + if not pathmatch(pattern, filename): + continue + + options = {} + for opattern, odict in options_map.items(): + if pathmatch(opattern, filename): + options = odict + break + if callback: + callback(filename, method, options) + for message_tuple in extract_from_file( + method, filepath, + keywords=keywords, + comment_tags=comment_tags, + options=options, + strip_comment_tags=strip_comment_tags, + ): + yield (filename, *message_tuple) + + break + + +def extract_from_file( + method: _ExtractionMethod, + filename: str | os.PathLike[str], + keywords: Mapping[str, _Keyword] = DEFAULT_KEYWORDS, + comment_tags: Collection[str] = (), + options: Mapping[str, Any] | None = None, + strip_comment_tags: bool = False, +) -> list[_ExtractionResult]: + """Extract messages from a specific file. + + This function returns a list of tuples of the form ``(lineno, message, comments, context)``. + + :param filename: the path to the file to extract messages from + :param method: a string specifying the extraction method (.e.g. "python") + :param keywords: a dictionary mapping keywords (i.e. names of functions + that should be recognized as translation functions) to + tuples that specify which of their arguments contain + localizable strings + :param comment_tags: a list of translator tags to search for and include + in the results + :param strip_comment_tags: a flag that if set to `True` causes all comment + tags to be removed from the collected comments. + :param options: a dictionary of additional options (optional) + :returns: list of tuples of the form ``(lineno, message, comments, context)`` + :rtype: list[tuple[int, str|tuple[str], list[str], str|None] + """ + if method == 'ignore': + return [] + + with open(filename, 'rb') as fileobj: + return list(extract(method, fileobj, keywords, comment_tags, + options, strip_comment_tags)) + + +def _match_messages_against_spec( + lineno: int, + messages: list[str | None], + comments: list[str], + fileobj: _FileObj, + spec: tuple[int | tuple[int, str], ...], +): + translatable = [] + context = None + + # last_index is 1 based like the keyword spec + last_index = len(messages) + for index in spec: + if isinstance(index, tuple): # (n, 'c') + context = messages[index[0] - 1] + continue + if last_index < index: + # Not enough arguments + return + message = messages[index - 1] + if message is None: + return + translatable.append(message) + + # keyword spec indexes are 1 based, therefore '-1' + if isinstance(spec[0], tuple): + # context-aware *gettext method + first_msg_index = spec[1] - 1 + else: + first_msg_index = spec[0] - 1 + # An empty string msgid isn't valid, emit a warning + if not messages[first_msg_index]: + filename = (getattr(fileobj, "name", None) or "(unknown)") + sys.stderr.write( + f"{filename}:{lineno}: warning: Empty msgid. It is reserved by GNU gettext: gettext(\"\") " + f"returns the header entry with meta information, not the empty string.\n", + ) + return + + translatable = tuple(translatable) + if len(translatable) == 1: + translatable = translatable[0] + + return lineno, translatable, comments, context + + +@lru_cache(maxsize=None) +def _find_extractor(name: str): + for ep_name, load in find_entrypoints(GROUP_NAME): + if ep_name == name: + return load() + return None + + +def extract( + method: _ExtractionMethod, + fileobj: _FileObj, + keywords: Mapping[str, _Keyword] = DEFAULT_KEYWORDS, + comment_tags: Collection[str] = (), + options: Mapping[str, Any] | None = None, + strip_comment_tags: bool = False, +) -> Generator[_ExtractionResult, None, None]: + """Extract messages from the given file-like object using the specified + extraction method. + + This function returns tuples of the form ``(lineno, message, comments, context)``. + + The implementation dispatches the actual extraction to plugins, based on the + value of the ``method`` parameter. + + >>> source = b'''# foo module + ... def run(argv): + ... print(_('Hello, world!')) + ... ''' + + >>> from io import BytesIO + >>> for message in extract('python', BytesIO(source)): + ... print(message) + (3, u'Hello, world!', [], None) + + :param method: an extraction method (a callable), or + a string specifying the extraction method (.e.g. "python"); + if this is a simple name, the extraction function will be + looked up by entry point; if it is an explicit reference + to a function (of the form ``package.module:funcname`` or + ``package.module.funcname``), the corresponding function + will be imported and used + :param fileobj: the file-like object the messages should be extracted from + :param keywords: a dictionary mapping keywords (i.e. names of functions + that should be recognized as translation functions) to + tuples that specify which of their arguments contain + localizable strings + :param comment_tags: a list of translator tags to search for and include + in the results + :param options: a dictionary of additional options (optional) + :param strip_comment_tags: a flag that if set to `True` causes all comment + tags to be removed from the collected comments. + :raise ValueError: if the extraction method is not registered + :returns: iterable of tuples of the form ``(lineno, message, comments, context)`` + :rtype: Iterable[tuple[int, str|tuple[str], list[str], str|None] + """ + if callable(method): + func = method + elif ':' in method or '.' in method: + if ':' not in method: + lastdot = method.rfind('.') + module, attrname = method[:lastdot], method[lastdot + 1:] + else: + module, attrname = method.split(':', 1) + func = getattr(__import__(module, {}, {}, [attrname]), attrname) + else: + func = _find_extractor(method) + if func is None: + # if no named entry point was found, + # we resort to looking up a builtin extractor + func = _BUILTIN_EXTRACTORS.get(method) + + if func is None: + raise ValueError(f"Unknown extraction method {method!r}") + + results = func(fileobj, keywords.keys(), comment_tags, + options=options or {}) + + for lineno, funcname, messages, comments in results: + if not isinstance(messages, (list, tuple)): + messages = [messages] + if not messages: + continue + + specs = keywords[funcname] or None if funcname else None + # {None: x} may be collapsed into x for backwards compatibility. + if not isinstance(specs, dict): + specs = {None: specs} + + if strip_comment_tags: + _strip_comment_tags(comments, comment_tags) + + # None matches all arities. + for arity in (None, len(messages)): + try: + spec = specs[arity] + except KeyError: + continue + if spec is None: + spec = (1,) + result = _match_messages_against_spec(lineno, messages, comments, fileobj, spec) + if result is not None: + yield result + + +def extract_nothing( + fileobj: _FileObj, + keywords: Mapping[str, _Keyword], + comment_tags: Collection[str], + options: Mapping[str, Any], +) -> list[_ExtractionResult]: + """Pseudo extractor that does not actually extract anything, but simply + returns an empty list. + """ + return [] + + +def extract_python( + fileobj: IO[bytes], + keywords: Mapping[str, _Keyword], + comment_tags: Collection[str], + options: _PyOptions, +) -> Generator[_ExtractionResult, None, None]: + """Extract messages from Python source code. + + It returns an iterator yielding tuples in the following form ``(lineno, + funcname, message, comments)``. + + :param fileobj: the seekable, file-like object the messages should be + extracted from + :param keywords: a list of keywords (i.e. function names) that should be + recognized as translation functions + :param comment_tags: a list of translator tags to search for and include + in the results + :param options: a dictionary of additional options (optional) + :rtype: ``iterator`` + """ + funcname = lineno = message_lineno = None + call_stack = -1 + buf = [] + messages = [] + translator_comments = [] + in_def = in_translator_comments = False + comment_tag = None + + encoding = parse_encoding(fileobj) or options.get('encoding', 'UTF-8') + future_flags = parse_future_flags(fileobj, encoding) + next_line = lambda: fileobj.readline().decode(encoding) + + tokens = generate_tokens(next_line) + + # Current prefix of a Python 3.12 (PEP 701) f-string, or None if we're not + # currently parsing one. + current_fstring_start = None + + for tok, value, (lineno, _), _, _ in tokens: + if call_stack == -1 and tok == NAME and value in ('def', 'class'): + in_def = True + elif tok == OP and value == '(': + if in_def: + # Avoid false positives for declarations such as: + # def gettext(arg='message'): + in_def = False + continue + if funcname: + call_stack += 1 + elif in_def and tok == OP and value == ':': + # End of a class definition without parens + in_def = False + continue + elif call_stack == -1 and tok == COMMENT: + # Strip the comment token from the line + value = value[1:].strip() + if in_translator_comments and \ + translator_comments[-1][0] == lineno - 1: + # We're already inside a translator comment, continue appending + translator_comments.append((lineno, value)) + continue + # If execution reaches this point, let's see if comment line + # starts with one of the comment tags + for comment_tag in comment_tags: + if value.startswith(comment_tag): + in_translator_comments = True + translator_comments.append((lineno, value)) + break + elif funcname and call_stack == 0: + nested = (tok == NAME and value in keywords) + if (tok == OP and value == ')') or nested: + if buf: + messages.append(''.join(buf)) + del buf[:] + else: + messages.append(None) + + messages = tuple(messages) if len(messages) > 1 else messages[0] + # Comments don't apply unless they immediately + # precede the message + if translator_comments and \ + translator_comments[-1][0] < message_lineno - 1: + translator_comments = [] + + yield (message_lineno, funcname, messages, + [comment[1] for comment in translator_comments]) + + funcname = lineno = message_lineno = None + call_stack = -1 + messages = [] + translator_comments = [] + in_translator_comments = False + if nested: + funcname = value + elif tok == STRING: + val = _parse_python_string(value, encoding, future_flags) + if val is not None: + if not message_lineno: + message_lineno = lineno + buf.append(val) + + # Python 3.12+, see https://peps.python.org/pep-0701/#new-tokens + elif tok == FSTRING_START: + current_fstring_start = value + if not message_lineno: + message_lineno = lineno + elif tok == FSTRING_MIDDLE: + if current_fstring_start is not None: + current_fstring_start += value + elif tok == FSTRING_END: + if current_fstring_start is not None: + fstring = current_fstring_start + value + val = _parse_python_string(fstring, encoding, future_flags) + if val is not None: + buf.append(val) + + elif tok == OP and value == ',': + if buf: + messages.append(''.join(buf)) + del buf[:] + else: + messages.append(None) + if translator_comments: + # We have translator comments, and since we're on a + # comma(,) user is allowed to break into a new line + # Let's increase the last comment's lineno in order + # for the comment to still be a valid one + old_lineno, old_comment = translator_comments.pop() + translator_comments.append((old_lineno + 1, old_comment)) + + elif tok != NL and not message_lineno: + message_lineno = lineno + elif call_stack > 0 and tok == OP and value == ')': + call_stack -= 1 + elif funcname and call_stack == -1: + funcname = None + elif tok == NAME and value in keywords: + funcname = value + + if current_fstring_start is not None and tok not in {FSTRING_START, FSTRING_MIDDLE}: + # In Python 3.12, tokens other than FSTRING_* mean the + # f-string is dynamic, so we don't wan't to extract it. + # And if it's FSTRING_END, we've already handled it above. + # Let's forget that we're in an f-string. + current_fstring_start = None + + +def _parse_python_string(value: str, encoding: str, future_flags: int) -> str | None: + # Unwrap quotes in a safe manner, maintaining the string's encoding + # https://sourceforge.net/tracker/?func=detail&atid=355470&aid=617979&group_id=5470 + code = compile( + f'# coding={str(encoding)}\n{value}', + '', + 'eval', + ast.PyCF_ONLY_AST | future_flags, + ) + if isinstance(code, ast.Expression): + body = code.body + if isinstance(body, ast.Constant): + return body.value + if isinstance(body, ast.JoinedStr): # f-string + if all(isinstance(node, ast.Constant) for node in body.values): + return ''.join(node.value for node in body.values) + # TODO: we could raise an error or warning when not all nodes are constants + return None + + +def extract_javascript( + fileobj: _FileObj, + keywords: Mapping[str, _Keyword], + comment_tags: Collection[str], + options: _JSOptions, + lineno: int = 1, +) -> Generator[_ExtractionResult, None, None]: + """Extract messages from JavaScript source code. + + :param fileobj: the seekable, file-like object the messages should be + extracted from + :param keywords: a list of keywords (i.e. function names) that should be + recognized as translation functions + :param comment_tags: a list of translator tags to search for and include + in the results + :param options: a dictionary of additional options (optional) + Supported options are: + * `jsx` -- set to false to disable JSX/E4X support. + * `template_string` -- if `True`, supports gettext(`key`) + * `parse_template_string` -- if `True` will parse the + contents of javascript + template strings. + :param lineno: line number offset (for parsing embedded fragments) + """ + from babel.messages.jslexer import Token, tokenize, unquote_string + funcname = message_lineno = None + messages = [] + last_argument = None + translator_comments = [] + concatenate_next = False + encoding = options.get('encoding', 'utf-8') + last_token = None + call_stack = -1 + dotted = any('.' in kw for kw in keywords) + for token in tokenize( + fileobj.read().decode(encoding), + jsx=options.get("jsx", True), + template_string=options.get("template_string", True), + dotted=dotted, + lineno=lineno, + ): + if ( # Turn keyword`foo` expressions into keyword("foo") calls: + funcname and # have a keyword... + (last_token and last_token.type == 'name') and # we've seen nothing after the keyword... + token.type == 'template_string' # this is a template string + ): + message_lineno = token.lineno + messages = [unquote_string(token.value)] + call_stack = 0 + token = Token('operator', ')', token.lineno) + + if options.get('parse_template_string') and not funcname and token.type == 'template_string': + yield from parse_template_string(token.value, keywords, comment_tags, options, token.lineno) + + elif token.type == 'operator' and token.value == '(': + if funcname: + message_lineno = token.lineno + call_stack += 1 + + elif call_stack == -1 and token.type == 'linecomment': + value = token.value[2:].strip() + if translator_comments and \ + translator_comments[-1][0] == token.lineno - 1: + translator_comments.append((token.lineno, value)) + continue + + for comment_tag in comment_tags: + if value.startswith(comment_tag): + translator_comments.append((token.lineno, value.strip())) + break + + elif token.type == 'multilinecomment': + # only one multi-line comment may precede a translation + translator_comments = [] + value = token.value[2:-2].strip() + for comment_tag in comment_tags: + if value.startswith(comment_tag): + lines = value.splitlines() + if lines: + lines[0] = lines[0].strip() + lines[1:] = dedent('\n'.join(lines[1:])).splitlines() + for offset, line in enumerate(lines): + translator_comments.append((token.lineno + offset, + line)) + break + + elif funcname and call_stack == 0: + if token.type == 'operator' and token.value == ')': + if last_argument is not None: + messages.append(last_argument) + if len(messages) > 1: + messages = tuple(messages) + elif messages: + messages = messages[0] + else: + messages = None + + # Comments don't apply unless they immediately precede the + # message + if translator_comments and \ + translator_comments[-1][0] < message_lineno - 1: + translator_comments = [] + + if messages is not None: + yield (message_lineno, funcname, messages, + [comment[1] for comment in translator_comments]) + + funcname = message_lineno = last_argument = None + concatenate_next = False + translator_comments = [] + messages = [] + call_stack = -1 + + elif token.type in ('string', 'template_string'): + new_value = unquote_string(token.value) + if concatenate_next: + last_argument = (last_argument or '') + new_value + concatenate_next = False + else: + last_argument = new_value + + elif token.type == 'operator': + if token.value == ',': + if last_argument is not None: + messages.append(last_argument) + last_argument = None + else: + messages.append(None) + concatenate_next = False + elif token.value == '+': + concatenate_next = True + + elif call_stack > 0 and token.type == 'operator' \ + and token.value == ')': + call_stack -= 1 + + elif funcname and call_stack == -1: + funcname = None + + elif call_stack == -1 and token.type == 'name' and \ + token.value in keywords and \ + (last_token is None or last_token.type != 'name' or + last_token.value != 'function'): + funcname = token.value + + last_token = token + + +def parse_template_string( + template_string: str, + keywords: Mapping[str, _Keyword], + comment_tags: Collection[str], + options: _JSOptions, + lineno: int = 1, +) -> Generator[_ExtractionResult, None, None]: + """Parse JavaScript template string. + + :param template_string: the template string to be parsed + :param keywords: a list of keywords (i.e. function names) that should be + recognized as translation functions + :param comment_tags: a list of translator tags to search for and include + in the results + :param options: a dictionary of additional options (optional) + :param lineno: starting line number (optional) + """ + from babel.messages.jslexer import line_re + prev_character = None + level = 0 + inside_str = False + expression_contents = '' + for character in template_string[1:-1]: + if not inside_str and character in ('"', "'", '`'): + inside_str = character + elif inside_str == character and prev_character != r'\\': + inside_str = False + if level: + expression_contents += character + if not inside_str: + if character == '{' and prev_character == '$': + level += 1 + elif level and character == '}': + level -= 1 + if level == 0 and expression_contents: + expression_contents = expression_contents[0:-1] + fake_file_obj = io.BytesIO(expression_contents.encode()) + yield from extract_javascript(fake_file_obj, keywords, comment_tags, options, lineno) + lineno += len(line_re.findall(expression_contents)) + expression_contents = '' + prev_character = character + + +_BUILTIN_EXTRACTORS = { + 'ignore': extract_nothing, + 'python': extract_python, + 'javascript': extract_javascript, +} diff --git a/venv/Lib/site-packages/babel/messages/frontend.py b/venv/Lib/site-packages/babel/messages/frontend.py new file mode 100644 index 0000000000000000000000000000000000000000..29e5a2aa24a7358bbbed61f04230b7804841470a --- /dev/null +++ b/venv/Lib/site-packages/babel/messages/frontend.py @@ -0,0 +1,1202 @@ +""" + babel.messages.frontend + ~~~~~~~~~~~~~~~~~~~~~~~ + + Frontends for the message extraction functionality. + + :copyright: (c) 2013-2025 by the Babel Team. + :license: BSD, see LICENSE for more details. +""" + +from __future__ import annotations + +import datetime +import fnmatch +import logging +import optparse +import os +import re +import shutil +import sys +import tempfile +import warnings +from configparser import RawConfigParser +from io import StringIO +from typing import BinaryIO, Iterable, Literal + +from babel import Locale, localedata +from babel import __version__ as VERSION +from babel.core import UnknownLocaleError +from babel.messages.catalog import DEFAULT_HEADER, Catalog +from babel.messages.extract import ( + DEFAULT_KEYWORDS, + DEFAULT_MAPPING, + check_and_call_extract_file, + extract_from_dir, +) +from babel.messages.mofile import write_mo +from babel.messages.pofile import read_po, write_po +from babel.util import LOCALTZ + +log = logging.getLogger('babel') + + +class BaseError(Exception): + pass + + +class OptionError(BaseError): + pass + + +class SetupError(BaseError): + pass + + +class ConfigurationError(BaseError): + """ + Raised for errors in configuration files. + """ + + +def listify_value(arg, split=None): + """ + Make a list out of an argument. + + Values from `distutils` argument parsing are always single strings; + values from `optparse` parsing may be lists of strings that may need + to be further split. + + No matter the input, this function returns a flat list of whitespace-trimmed + strings, with `None` values filtered out. + + >>> listify_value("foo bar") + ['foo', 'bar'] + >>> listify_value(["foo bar"]) + ['foo', 'bar'] + >>> listify_value([["foo"], "bar"]) + ['foo', 'bar'] + >>> listify_value([["foo"], ["bar", None, "foo"]]) + ['foo', 'bar', 'foo'] + >>> listify_value("foo, bar, quux", ",") + ['foo', 'bar', 'quux'] + + :param arg: A string or a list of strings + :param split: The argument to pass to `str.split()`. + :return: + """ + out = [] + + if not isinstance(arg, (list, tuple)): + arg = [arg] + + for val in arg: + if val is None: + continue + if isinstance(val, (list, tuple)): + out.extend(listify_value(val, split=split)) + continue + out.extend(s.strip() for s in str(val).split(split)) + assert all(isinstance(val, str) for val in out) + return out + + +class CommandMixin: + # This class is a small shim between Distutils commands and + # optparse option parsing in the frontend command line. + + #: Option name to be input as `args` on the script command line. + as_args = None + + #: Options which allow multiple values. + #: This is used by the `optparse` transmogrification code. + multiple_value_options = () + + #: Options which are booleans. + #: This is used by the `optparse` transmogrification code. + # (This is actually used by distutils code too, but is never + # declared in the base class.) + boolean_options = () + + #: Option aliases, to retain standalone command compatibility. + #: Distutils does not support option aliases, but optparse does. + #: This maps the distutils argument name to an iterable of aliases + #: that are usable with optparse. + option_aliases = {} + + #: Choices for options that needed to be restricted to specific + #: list of choices. + option_choices = {} + + #: Log object. To allow replacement in the script command line runner. + log = log + + def __init__(self, dist=None): + # A less strict version of distutils' `__init__`. + self.distribution = dist + self.initialize_options() + self._dry_run = None + self.verbose = False + self.force = None + self.help = 0 + self.finalized = 0 + + def initialize_options(self): + pass + + def ensure_finalized(self): + if not self.finalized: + self.finalize_options() + self.finalized = 1 + + def finalize_options(self): + raise RuntimeError( + f"abstract method -- subclass {self.__class__} must override", + ) + + +class CompileCatalog(CommandMixin): + description = 'compile message catalogs to binary MO files' + user_options = [ + ('domain=', 'D', + "domains of PO files (space separated list, default 'messages')"), + ('directory=', 'd', + 'path to base directory containing the catalogs'), + ('input-file=', 'i', + 'name of the input file'), + ('output-file=', 'o', + "name of the output file (default " + "'//LC_MESSAGES/.mo')"), + ('locale=', 'l', + 'locale of the catalog to compile'), + ('use-fuzzy', 'f', + 'also include fuzzy translations'), + ('statistics', None, + 'print statistics about translations'), + ] + boolean_options = ['use-fuzzy', 'statistics'] + + def initialize_options(self): + self.domain = 'messages' + self.directory = None + self.input_file = None + self.output_file = None + self.locale = None + self.use_fuzzy = False + self.statistics = False + + def finalize_options(self): + self.domain = listify_value(self.domain) + if not self.input_file and not self.directory: + raise OptionError('you must specify either the input file or the base directory') + if not self.output_file and not self.directory: + raise OptionError('you must specify either the output file or the base directory') + + def run(self): + n_errors = 0 + for domain in self.domain: + for errors in self._run_domain(domain).values(): + n_errors += len(errors) + if n_errors: + self.log.error('%d errors encountered.', n_errors) + return (1 if n_errors else 0) + + def _run_domain(self, domain): + po_files = [] + mo_files = [] + + if not self.input_file: + if self.locale: + po_files.append((self.locale, + os.path.join(self.directory, self.locale, + 'LC_MESSAGES', + f"{domain}.po"))) + mo_files.append(os.path.join(self.directory, self.locale, + 'LC_MESSAGES', + f"{domain}.mo")) + else: + for locale in os.listdir(self.directory): + po_file = os.path.join(self.directory, locale, + 'LC_MESSAGES', f"{domain}.po") + if os.path.exists(po_file): + po_files.append((locale, po_file)) + mo_files.append(os.path.join(self.directory, locale, + 'LC_MESSAGES', + f"{domain}.mo")) + else: + po_files.append((self.locale, self.input_file)) + if self.output_file: + mo_files.append(self.output_file) + else: + mo_files.append(os.path.join(self.directory, self.locale, + 'LC_MESSAGES', + f"{domain}.mo")) + + if not po_files: + raise OptionError('no message catalogs found') + + catalogs_and_errors = {} + + for idx, (locale, po_file) in enumerate(po_files): + mo_file = mo_files[idx] + with open(po_file, 'rb') as infile: + catalog = read_po(infile, locale) + + if self.statistics: + translated = 0 + for message in list(catalog)[1:]: + if message.string: + translated += 1 + percentage = 0 + if len(catalog): + percentage = translated * 100 // len(catalog) + self.log.info( + '%d of %d messages (%d%%) translated in %s', + translated, len(catalog), percentage, po_file, + ) + + if catalog.fuzzy and not self.use_fuzzy: + self.log.info('catalog %s is marked as fuzzy, skipping', po_file) + continue + + catalogs_and_errors[catalog] = catalog_errors = list(catalog.check()) + for message, errors in catalog_errors: + for error in errors: + self.log.error( + 'error: %s:%d: %s', po_file, message.lineno, error, + ) + + self.log.info('compiling catalog %s to %s', po_file, mo_file) + + with open(mo_file, 'wb') as outfile: + write_mo(outfile, catalog, use_fuzzy=self.use_fuzzy) + + return catalogs_and_errors + + +def _make_directory_filter(ignore_patterns): + """ + Build a directory_filter function based on a list of ignore patterns. + """ + + def cli_directory_filter(dirname): + basename = os.path.basename(dirname) + return not any( + fnmatch.fnmatch(basename, ignore_pattern) + for ignore_pattern + in ignore_patterns + ) + + return cli_directory_filter + + +class ExtractMessages(CommandMixin): + description = 'extract localizable strings from the project code' + user_options = [ + ('charset=', None, + 'charset to use in the output file (default "utf-8")'), + ('keywords=', 'k', + 'space-separated list of keywords to look for in addition to the ' + 'defaults (may be repeated multiple times)'), + ('no-default-keywords', None, + 'do not include the default keywords'), + ('mapping-file=', 'F', + 'path to the mapping configuration file'), + ('no-location', None, + 'do not include location comments with filename and line number'), + ('add-location=', None, + 'location lines format. If it is not given or "full", it generates ' + 'the lines with both file name and line number. If it is "file", ' + 'the line number part is omitted. If it is "never", it completely ' + 'suppresses the lines (same as --no-location).'), + ('omit-header', None, + 'do not include msgid "" entry in header'), + ('output-file=', 'o', + 'name of the output file'), + ('width=', 'w', + 'set output line width (default 76)'), + ('no-wrap', None, + 'do not break long message lines, longer than the output line width, ' + 'into several lines'), + ('sort-output', None, + 'generate sorted output (default False)'), + ('sort-by-file', None, + 'sort output by file location (default False)'), + ('msgid-bugs-address=', None, + 'set report address for msgid'), + ('copyright-holder=', None, + 'set copyright holder in output'), + ('project=', None, + 'set project name in output'), + ('version=', None, + 'set project version in output'), + ('add-comments=', 'c', + 'place comment block with TAG (or those preceding keyword lines) in ' + 'output file. Separate multiple TAGs with commas(,)'), # TODO: Support repetition of this argument + ('strip-comments', 's', + 'strip the comment TAGs from the comments.'), + ('input-paths=', None, + 'files or directories that should be scanned for messages. Separate multiple ' + 'files or directories with commas(,)'), # TODO: Support repetition of this argument + ('input-dirs=', None, # TODO (3.x): Remove me. + 'alias for input-paths (does allow files as well as directories).'), + ('ignore-dirs=', None, + 'Patterns for directories to ignore when scanning for messages. ' + 'Separate multiple patterns with spaces (default ".* ._")'), + ('header-comment=', None, + 'header comment for the catalog'), + ('last-translator=', None, + 'set the name and email of the last translator in output'), + ] + boolean_options = [ + 'no-default-keywords', 'no-location', 'omit-header', 'no-wrap', + 'sort-output', 'sort-by-file', 'strip-comments', + ] + as_args = 'input-paths' + multiple_value_options = ( + 'add-comments', + 'keywords', + 'ignore-dirs', + ) + option_aliases = { + 'keywords': ('--keyword',), + 'mapping-file': ('--mapping',), + 'output-file': ('--output',), + 'strip-comments': ('--strip-comment-tags',), + 'last-translator': ('--last-translator',), + } + option_choices = { + 'add-location': ('full', 'file', 'never'), + } + + def initialize_options(self): + self.charset = 'utf-8' + self.keywords = None + self.no_default_keywords = False + self.mapping_file = None + self.no_location = False + self.add_location = None + self.omit_header = False + self.output_file = None + self.input_dirs = None + self.input_paths = None + self.width = None + self.no_wrap = False + self.sort_output = False + self.sort_by_file = False + self.msgid_bugs_address = None + self.copyright_holder = None + self.project = None + self.version = None + self.add_comments = None + self.strip_comments = False + self.include_lineno = True + self.ignore_dirs = None + self.header_comment = None + self.last_translator = None + + def finalize_options(self): + if self.input_dirs: + if not self.input_paths: + self.input_paths = self.input_dirs + else: + raise OptionError( + 'input-dirs and input-paths are mutually exclusive', + ) + + keywords = {} if self.no_default_keywords else DEFAULT_KEYWORDS.copy() + + keywords.update(parse_keywords(listify_value(self.keywords))) + + self.keywords = keywords + + if not self.keywords: + raise OptionError( + 'you must specify new keywords if you disable the default ones', + ) + + if not self.output_file: + raise OptionError('no output file specified') + if self.no_wrap and self.width: + raise OptionError( + "'--no-wrap' and '--width' are mutually exclusive", + ) + if not self.no_wrap and not self.width: + self.width = 76 + elif self.width is not None: + self.width = int(self.width) + + if self.sort_output and self.sort_by_file: + raise OptionError( + "'--sort-output' and '--sort-by-file' are mutually exclusive", + ) + + if self.input_paths: + if isinstance(self.input_paths, str): + self.input_paths = re.split(r',\s*', self.input_paths) + elif self.distribution is not None: + self.input_paths = dict.fromkeys([ + k.split('.', 1)[0] + for k in (self.distribution.packages or ()) + ]).keys() + else: + self.input_paths = [] + + if not self.input_paths: + raise OptionError("no input files or directories specified") + + for path in self.input_paths: + if not os.path.exists(path): + raise OptionError(f"Input path: {path} does not exist") + + self.add_comments = listify_value(self.add_comments or (), ",") + + if self.distribution: + if not self.project: + self.project = self.distribution.get_name() + if not self.version: + self.version = self.distribution.get_version() + + if self.add_location == 'never': + self.no_location = True + elif self.add_location == 'file': + self.include_lineno = False + + ignore_dirs = listify_value(self.ignore_dirs) + if ignore_dirs: + self.directory_filter = _make_directory_filter(ignore_dirs) + else: + self.directory_filter = None + + def _build_callback(self, path: str): + def callback(filename: str, method: str, options: dict): + if method == 'ignore': + return + + # If we explicitly provide a full filepath, just use that. + # Otherwise, path will be the directory path and filename + # is the relative path from that dir to the file. + # So we can join those to get the full filepath. + if os.path.isfile(path): + filepath = path + else: + filepath = os.path.normpath(os.path.join(path, filename)) + + optstr = '' + if options: + opt_values = ", ".join(f'{k}="{v}"' for k, v in options.items()) + optstr = f" ({opt_values})" + self.log.info('extracting messages from %s%s', filepath, optstr) + + return callback + + def run(self): + mappings = self._get_mappings() + with open(self.output_file, 'wb') as outfile: + catalog = Catalog(project=self.project, + version=self.version, + msgid_bugs_address=self.msgid_bugs_address, + copyright_holder=self.copyright_holder, + charset=self.charset, + header_comment=(self.header_comment or DEFAULT_HEADER), + last_translator=self.last_translator) + + for path, method_map, options_map in mappings: + callback = self._build_callback(path) + if os.path.isfile(path): + current_dir = os.getcwd() + extracted = check_and_call_extract_file( + path, method_map, options_map, + callback, self.keywords, self.add_comments, + self.strip_comments, current_dir, + ) + else: + extracted = extract_from_dir( + path, method_map, options_map, + keywords=self.keywords, + comment_tags=self.add_comments, + callback=callback, + strip_comment_tags=self.strip_comments, + directory_filter=self.directory_filter, + ) + for filename, lineno, message, comments, context in extracted: + if os.path.isfile(path): + filepath = filename # already normalized + else: + filepath = os.path.normpath(os.path.join(path, filename)) + + catalog.add(message, None, [(filepath, lineno)], + auto_comments=comments, context=context) + + self.log.info('writing PO template file to %s', self.output_file) + write_po(outfile, catalog, width=self.width, + no_location=self.no_location, + omit_header=self.omit_header, + sort_output=self.sort_output, + sort_by_file=self.sort_by_file, + include_lineno=self.include_lineno) + + def _get_mappings(self): + mappings = [] + + if self.mapping_file: + if self.mapping_file.endswith(".toml"): + with open(self.mapping_file, "rb") as fileobj: + file_style = ( + "pyproject.toml" + if os.path.basename(self.mapping_file) == "pyproject.toml" + else "standalone" + ) + method_map, options_map = _parse_mapping_toml( + fileobj, + filename=self.mapping_file, + style=file_style, + ) + else: + with open(self.mapping_file) as fileobj: + method_map, options_map = parse_mapping_cfg(fileobj, filename=self.mapping_file) + for path in self.input_paths: + mappings.append((path, method_map, options_map)) + + elif getattr(self.distribution, 'message_extractors', None): + message_extractors = self.distribution.message_extractors + for path, mapping in message_extractors.items(): + if isinstance(mapping, str): + method_map, options_map = parse_mapping_cfg(StringIO(mapping)) + else: + method_map, options_map = [], {} + for pattern, method, options in mapping: + method_map.append((pattern, method)) + options_map[pattern] = options or {} + mappings.append((path, method_map, options_map)) + + else: + for path in self.input_paths: + mappings.append((path, DEFAULT_MAPPING, {})) + + return mappings + + +class InitCatalog(CommandMixin): + description = 'create a new catalog based on a POT file' + user_options = [ + ('domain=', 'D', + "domain of PO file (default 'messages')"), + ('input-file=', 'i', + 'name of the input file'), + ('output-dir=', 'd', + 'path to output directory'), + ('output-file=', 'o', + "name of the output file (default " + "'//LC_MESSAGES/.po')"), + ('locale=', 'l', + 'locale for the new localized catalog'), + ('width=', 'w', + 'set output line width (default 76)'), + ('no-wrap', None, + 'do not break long message lines, longer than the output line width, ' + 'into several lines'), + ] + boolean_options = ['no-wrap'] + + def initialize_options(self): + self.output_dir = None + self.output_file = None + self.input_file = None + self.locale = None + self.domain = 'messages' + self.no_wrap = False + self.width = None + + def finalize_options(self): + if not self.input_file: + raise OptionError('you must specify the input file') + + if not self.locale: + raise OptionError('you must provide a locale for the new catalog') + try: + self._locale = Locale.parse(self.locale) + except UnknownLocaleError as e: + raise OptionError(e) from e + + if not self.output_file and not self.output_dir: + raise OptionError('you must specify the output directory') + if not self.output_file: + self.output_file = os.path.join(self.output_dir, self.locale, + 'LC_MESSAGES', f"{self.domain}.po") + + if not os.path.exists(os.path.dirname(self.output_file)): + os.makedirs(os.path.dirname(self.output_file)) + if self.no_wrap and self.width: + raise OptionError("'--no-wrap' and '--width' are mutually exclusive") + if not self.no_wrap and not self.width: + self.width = 76 + elif self.width is not None: + self.width = int(self.width) + + def run(self): + self.log.info( + 'creating catalog %s based on %s', self.output_file, self.input_file, + ) + + with open(self.input_file, 'rb') as infile: + # Although reading from the catalog template, read_po must be fed + # the locale in order to correctly calculate plurals + catalog = read_po(infile, locale=self.locale) + + catalog.locale = self._locale + catalog.revision_date = datetime.datetime.now(LOCALTZ) + catalog.fuzzy = False + + with open(self.output_file, 'wb') as outfile: + write_po(outfile, catalog, width=self.width) + + +class UpdateCatalog(CommandMixin): + description = 'update message catalogs from a POT file' + user_options = [ + ('domain=', 'D', + "domain of PO file (default 'messages')"), + ('input-file=', 'i', + 'name of the input file'), + ('output-dir=', 'd', + 'path to base directory containing the catalogs'), + ('output-file=', 'o', + "name of the output file (default " + "'//LC_MESSAGES/.po')"), + ('omit-header', None, + "do not include msgid "" entry in header"), + ('locale=', 'l', + 'locale of the catalog to compile'), + ('width=', 'w', + 'set output line width (default 76)'), + ('no-wrap', None, + 'do not break long message lines, longer than the output line width, ' + 'into several lines'), + ('ignore-obsolete=', None, + 'whether to omit obsolete messages from the output'), + ('init-missing=', None, + 'if any output files are missing, initialize them first'), + ('no-fuzzy-matching', 'N', + 'do not use fuzzy matching'), + ('update-header-comment', None, + 'update target header comment'), + ('previous', None, + 'keep previous msgids of translated messages'), + ('check=', None, + 'don\'t update the catalog, just return the status. Return code 0 ' + 'means nothing would change. Return code 1 means that the catalog ' + 'would be updated'), + ('ignore-pot-creation-date=', None, + 'ignore changes to POT-Creation-Date when updating or checking'), + ] + boolean_options = [ + 'omit-header', 'no-wrap', 'ignore-obsolete', 'init-missing', + 'no-fuzzy-matching', 'previous', 'update-header-comment', + 'check', 'ignore-pot-creation-date', + ] + + def initialize_options(self): + self.domain = 'messages' + self.input_file = None + self.output_dir = None + self.output_file = None + self.omit_header = False + self.locale = None + self.width = None + self.no_wrap = False + self.ignore_obsolete = False + self.init_missing = False + self.no_fuzzy_matching = False + self.update_header_comment = False + self.previous = False + self.check = False + self.ignore_pot_creation_date = False + + def finalize_options(self): + if not self.input_file: + raise OptionError('you must specify the input file') + if not self.output_file and not self.output_dir: + raise OptionError('you must specify the output file or directory') + if self.output_file and not self.locale: + raise OptionError('you must specify the locale') + + if self.init_missing: + if not self.locale: + raise OptionError( + 'you must specify the locale for ' + 'the init-missing option to work', + ) + + try: + self._locale = Locale.parse(self.locale) + except UnknownLocaleError as e: + raise OptionError(e) from e + else: + self._locale = None + + if self.no_wrap and self.width: + raise OptionError("'--no-wrap' and '--width' are mutually exclusive") + if not self.no_wrap and not self.width: + self.width = 76 + elif self.width is not None: + self.width = int(self.width) + if self.no_fuzzy_matching and self.previous: + self.previous = False + + def run(self): + check_status = {} + po_files = [] + if not self.output_file: + if self.locale: + po_files.append((self.locale, + os.path.join(self.output_dir, self.locale, + 'LC_MESSAGES', + f"{self.domain}.po"))) + else: + for locale in os.listdir(self.output_dir): + po_file = os.path.join(self.output_dir, locale, + 'LC_MESSAGES', + f"{self.domain}.po") + if os.path.exists(po_file): + po_files.append((locale, po_file)) + else: + po_files.append((self.locale, self.output_file)) + + if not po_files: + raise OptionError('no message catalogs found') + + domain = self.domain + if not domain: + domain = os.path.splitext(os.path.basename(self.input_file))[0] + + with open(self.input_file, 'rb') as infile: + template = read_po(infile) + + for locale, filename in po_files: + if self.init_missing and not os.path.exists(filename): + if self.check: + check_status[filename] = False + continue + self.log.info( + 'creating catalog %s based on %s', filename, self.input_file, + ) + + with open(self.input_file, 'rb') as infile: + # Although reading from the catalog template, read_po must + # be fed the locale in order to correctly calculate plurals + catalog = read_po(infile, locale=self.locale) + + catalog.locale = self._locale + catalog.revision_date = datetime.datetime.now(LOCALTZ) + catalog.fuzzy = False + + with open(filename, 'wb') as outfile: + write_po(outfile, catalog) + + self.log.info('updating catalog %s based on %s', filename, self.input_file) + with open(filename, 'rb') as infile: + catalog = read_po(infile, locale=locale, domain=domain) + + catalog.update( + template, self.no_fuzzy_matching, + update_header_comment=self.update_header_comment, + update_creation_date=not self.ignore_pot_creation_date, + ) + + tmpname = os.path.join(os.path.dirname(filename), + tempfile.gettempprefix() + + os.path.basename(filename)) + try: + with open(tmpname, 'wb') as tmpfile: + write_po(tmpfile, catalog, + omit_header=self.omit_header, + ignore_obsolete=self.ignore_obsolete, + include_previous=self.previous, width=self.width) + except Exception: + os.remove(tmpname) + raise + + if self.check: + with open(filename, "rb") as origfile: + original_catalog = read_po(origfile) + with open(tmpname, "rb") as newfile: + updated_catalog = read_po(newfile) + updated_catalog.revision_date = original_catalog.revision_date + check_status[filename] = updated_catalog.is_identical(original_catalog) + os.remove(tmpname) + continue + + try: + os.rename(tmpname, filename) + except OSError: + # We're probably on Windows, which doesn't support atomic + # renames, at least not through Python + # If the error is in fact due to a permissions problem, that + # same error is going to be raised from one of the following + # operations + os.remove(filename) + shutil.copy(tmpname, filename) + os.remove(tmpname) + + if self.check: + for filename, up_to_date in check_status.items(): + if up_to_date: + self.log.info('Catalog %s is up to date.', filename) + else: + self.log.warning('Catalog %s is out of date.', filename) + if not all(check_status.values()): + raise BaseError("Some catalogs are out of date.") + else: + self.log.info("All the catalogs are up-to-date.") + return + + +class CommandLineInterface: + """Command-line interface. + + This class provides a simple command-line interface to the message + extraction and PO file generation functionality. + """ + + usage = '%%prog %s [options] %s' + version = f'%prog {VERSION}' + commands = { + 'compile': 'compile message catalogs to MO files', + 'extract': 'extract messages from source files and generate a POT file', + 'init': 'create new message catalogs from a POT file', + 'update': 'update existing message catalogs from a POT file', + } + + command_classes = { + 'compile': CompileCatalog, + 'extract': ExtractMessages, + 'init': InitCatalog, + 'update': UpdateCatalog, + } + + log = None # Replaced on instance level + + def run(self, argv=None): + """Main entry point of the command-line interface. + + :param argv: list of arguments passed on the command-line + """ + + if argv is None: + argv = sys.argv + + self.parser = optparse.OptionParser(usage=self.usage % ('command', '[args]'), + version=self.version) + self.parser.disable_interspersed_args() + self.parser.print_help = self._help + self.parser.add_option('--list-locales', dest='list_locales', + action='store_true', + help="print all known locales and exit") + self.parser.add_option('-v', '--verbose', action='store_const', + dest='loglevel', const=logging.DEBUG, + help='print as much as possible') + self.parser.add_option('-q', '--quiet', action='store_const', + dest='loglevel', const=logging.ERROR, + help='print as little as possible') + self.parser.set_defaults(list_locales=False, loglevel=logging.INFO) + + options, args = self.parser.parse_args(argv[1:]) + + self._configure_logging(options.loglevel) + if options.list_locales: + identifiers = localedata.locale_identifiers() + id_width = max(len(identifier) for identifier in identifiers) + 1 + for identifier in sorted(identifiers): + locale = Locale.parse(identifier) + print(f"{identifier:<{id_width}} {locale.english_name}") + return 0 + + if not args: + self.parser.error('no valid command or option passed. ' + 'Try the -h/--help option for more information.') + + cmdname = args[0] + if cmdname not in self.commands: + self.parser.error(f'unknown command "{cmdname}"') + + cmdinst = self._configure_command(cmdname, args[1:]) + return cmdinst.run() + + def _configure_logging(self, loglevel): + self.log = log + self.log.setLevel(loglevel) + # Don't add a new handler for every instance initialization (#227), this + # would cause duplicated output when the CommandLineInterface as an + # normal Python class. + if self.log.handlers: + handler = self.log.handlers[0] + else: + handler = logging.StreamHandler() + self.log.addHandler(handler) + handler.setLevel(loglevel) + formatter = logging.Formatter('%(message)s') + handler.setFormatter(formatter) + + def _help(self): + print(self.parser.format_help()) + print("commands:") + cmd_width = max(8, max(len(command) for command in self.commands) + 1) + for name, description in sorted(self.commands.items()): + print(f" {name:<{cmd_width}} {description}") + + def _configure_command(self, cmdname, argv): + """ + :type cmdname: str + :type argv: list[str] + """ + cmdclass = self.command_classes[cmdname] + cmdinst = cmdclass() + if self.log: + cmdinst.log = self.log # Use our logger, not distutils'. + assert isinstance(cmdinst, CommandMixin) + cmdinst.initialize_options() + + parser = optparse.OptionParser( + usage=self.usage % (cmdname, ''), + description=self.commands[cmdname], + ) + as_args: str | None = getattr(cmdclass, "as_args", None) + for long, short, help in cmdclass.user_options: + name = long.strip("=") + default = getattr(cmdinst, name.replace("-", "_")) + strs = [f"--{name}"] + if short: + strs.append(f"-{short}") + strs.extend(cmdclass.option_aliases.get(name, ())) + choices = cmdclass.option_choices.get(name, None) + if name == as_args: + parser.usage += f"<{name}>" + elif name in cmdclass.boolean_options: + parser.add_option(*strs, action="store_true", help=help) + elif name in cmdclass.multiple_value_options: + parser.add_option(*strs, action="append", help=help, choices=choices) + else: + parser.add_option(*strs, help=help, default=default, choices=choices) + options, args = parser.parse_args(argv) + + if as_args: + setattr(options, as_args.replace('-', '_'), args) + + for key, value in vars(options).items(): + setattr(cmdinst, key, value) + + try: + cmdinst.ensure_finalized() + except OptionError as err: + parser.error(str(err)) + + return cmdinst + + +def main(): + return CommandLineInterface().run(sys.argv) + + +def parse_mapping(fileobj, filename=None): + warnings.warn( + "parse_mapping is deprecated, use parse_mapping_cfg instead", + DeprecationWarning, + stacklevel=2, + ) + return parse_mapping_cfg(fileobj, filename) + + +def parse_mapping_cfg(fileobj, filename=None): + """Parse an extraction method mapping from a file-like object. + + :param fileobj: a readable file-like object containing the configuration + text to parse + :param filename: the name of the file being parsed, for error messages + """ + extractors = {} + method_map = [] + options_map = {} + + parser = RawConfigParser() + parser.read_file(fileobj, filename) + + for section in parser.sections(): + if section == 'extractors': + extractors = dict(parser.items(section)) + else: + method, pattern = (part.strip() for part in section.split(':', 1)) + method_map.append((pattern, method)) + options_map[pattern] = dict(parser.items(section)) + + if extractors: + for idx, (pattern, method) in enumerate(method_map): + if method in extractors: + method = extractors[method] + method_map[idx] = (pattern, method) + + return method_map, options_map + + +def _parse_config_object(config: dict, *, filename="(unknown)"): + extractors = {} + method_map = [] + options_map = {} + + extractors_read = config.get("extractors", {}) + if not isinstance(extractors_read, dict): + raise ConfigurationError(f"{filename}: extractors: Expected a dictionary, got {type(extractors_read)!r}") + for method, callable_spec in extractors_read.items(): + if not isinstance(method, str): + # Impossible via TOML, but could happen with a custom object. + raise ConfigurationError(f"{filename}: extractors: Extraction method must be a string, got {method!r}") + if not isinstance(callable_spec, str): + raise ConfigurationError(f"{filename}: extractors: Callable specification must be a string, got {callable_spec!r}") + extractors[method] = callable_spec + + if "mapping" in config: + raise ConfigurationError(f"{filename}: 'mapping' is not a valid key, did you mean 'mappings'?") + + mappings_read = config.get("mappings", []) + if not isinstance(mappings_read, list): + raise ConfigurationError(f"{filename}: mappings: Expected a list, got {type(mappings_read)!r}") + for idx, entry in enumerate(mappings_read): + if not isinstance(entry, dict): + raise ConfigurationError(f"{filename}: mappings[{idx}]: Expected a dictionary, got {type(entry)!r}") + entry = entry.copy() + + method = entry.pop("method", None) + if not isinstance(method, str): + raise ConfigurationError(f"{filename}: mappings[{idx}]: 'method' must be a string, got {method!r}") + method = extractors.get(method, method) # Map the extractor name to the callable now + + pattern = entry.pop("pattern", None) + if not isinstance(pattern, (list, str)): + raise ConfigurationError(f"{filename}: mappings[{idx}]: 'pattern' must be a list or a string, got {pattern!r}") + if not isinstance(pattern, list): + pattern = [pattern] + + for pat in pattern: + if not isinstance(pat, str): + raise ConfigurationError(f"{filename}: mappings[{idx}]: 'pattern' elements must be strings, got {pat!r}") + method_map.append((pat, method)) + options_map[pat] = entry + + return method_map, options_map + + +def _parse_mapping_toml( + fileobj: BinaryIO, + filename: str = "(unknown)", + style: Literal["standalone", "pyproject.toml"] = "standalone", +): + """Parse an extraction method mapping from a binary file-like object. + + .. warning: As of this version of Babel, this is a private API subject to changes. + + :param fileobj: a readable binary file-like object containing the configuration TOML to parse + :param filename: the name of the file being parsed, for error messages + :param style: whether the file is in the style of a `pyproject.toml` file, i.e. whether to look for `tool.babel`. + """ + try: + import tomllib + except ImportError: + try: + import tomli as tomllib + except ImportError as ie: # pragma: no cover + raise ImportError("tomli or tomllib is required to parse TOML files") from ie + + try: + parsed_data = tomllib.load(fileobj) + except tomllib.TOMLDecodeError as e: + raise ConfigurationError(f"{filename}: Error parsing TOML file: {e}") from e + + if style == "pyproject.toml": + try: + babel_data = parsed_data["tool"]["babel"] + except (TypeError, KeyError) as e: + raise ConfigurationError(f"{filename}: No 'tool.babel' section found in file") from e + elif style == "standalone": + babel_data = parsed_data + if "babel" in babel_data: + raise ConfigurationError(f"{filename}: 'babel' should not be present in a stand-alone configuration file") + else: # pragma: no cover + raise ValueError(f"Unknown TOML style {style!r}") + + return _parse_config_object(babel_data, filename=filename) + + +def _parse_spec(s: str) -> tuple[int | None, tuple[int | tuple[int, str], ...]]: + inds = [] + number = None + for x in s.split(','): + if x[-1] == 't': + number = int(x[:-1]) + elif x[-1] == 'c': + inds.append((int(x[:-1]), 'c')) + else: + inds.append(int(x)) + return number, tuple(inds) + + +def parse_keywords(strings: Iterable[str] = ()): + """Parse keywords specifications from the given list of strings. + + >>> import pprint + >>> keywords = ['_', 'dgettext:2', 'dngettext:2,3', 'pgettext:1c,2', + ... 'polymorphic:1', 'polymorphic:2,2t', 'polymorphic:3c,3t'] + >>> pprint.pprint(parse_keywords(keywords)) + {'_': None, + 'dgettext': (2,), + 'dngettext': (2, 3), + 'pgettext': ((1, 'c'), 2), + 'polymorphic': {None: (1,), 2: (2,), 3: ((3, 'c'),)}} + + The input keywords are in GNU Gettext style; see :doc:`cmdline` for details. + + The output is a dictionary mapping keyword names to a dictionary of specifications. + Keys in this dictionary are numbers of arguments, where ``None`` means that all numbers + of arguments are matched, and a number means only calls with that number of arguments + are matched (which happens when using the "t" specifier). However, as a special + case for backwards compatibility, if the dictionary of specifications would + be ``{None: x}``, i.e., there is only one specification and it matches all argument + counts, then it is collapsed into just ``x``. + + A specification is either a tuple or None. If a tuple, each element can be either a number + ``n``, meaning that the nth argument should be extracted as a message, or the tuple + ``(n, 'c')``, meaning that the nth argument should be extracted as context for the + messages. A ``None`` specification is equivalent to ``(1,)``, extracting the first + argument. + """ + keywords = {} + for string in strings: + if ':' in string: + funcname, spec_str = string.split(':') + number, spec = _parse_spec(spec_str) + else: + funcname = string + number = None + spec = None + keywords.setdefault(funcname, {})[number] = spec + + # For best backwards compatibility, collapse {None: x} into x. + for k, v in keywords.items(): + if set(v) == {None}: + keywords[k] = v[None] + + return keywords + + +def __getattr__(name: str): + # Re-exports for backwards compatibility; + # `setuptools_frontend` is the canonical import location. + if name in {'check_message_extractors', 'compile_catalog', 'extract_messages', 'init_catalog', 'update_catalog'}: + from babel.messages import setuptools_frontend + + return getattr(setuptools_frontend, name) + + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") + + +if __name__ == '__main__': + main() diff --git a/venv/Lib/site-packages/babel/messages/jslexer.py b/venv/Lib/site-packages/babel/messages/jslexer.py new file mode 100644 index 0000000000000000000000000000000000000000..5fc4956fd8c9219f3c5e9dafd377d69c63d749c6 --- /dev/null +++ b/venv/Lib/site-packages/babel/messages/jslexer.py @@ -0,0 +1,204 @@ +""" + babel.messages.jslexer + ~~~~~~~~~~~~~~~~~~~~~~ + + A simple JavaScript 1.5 lexer which is used for the JavaScript + extractor. + + :copyright: (c) 2013-2025 by the Babel Team. + :license: BSD, see LICENSE for more details. +""" +from __future__ import annotations + +import re +from collections.abc import Generator +from typing import NamedTuple + +operators: list[str] = sorted([ + '+', '-', '*', '%', '!=', '==', '<', '>', '<=', '>=', '=', + '+=', '-=', '*=', '%=', '<<', '>>', '>>>', '<<=', '>>=', + '>>>=', '&', '&=', '|', '|=', '&&', '||', '^', '^=', '(', ')', + '[', ']', '{', '}', '!', '--', '++', '~', ',', ';', '.', ':', +], key=len, reverse=True) + +escapes: dict[str, str] = {'b': '\b', 'f': '\f', 'n': '\n', 'r': '\r', 't': '\t'} + +name_re = re.compile(r'[\w$_][\w\d$_]*', re.UNICODE) +dotted_name_re = re.compile(r'[\w$_][\w\d$_.]*[\w\d$_.]', re.UNICODE) +division_re = re.compile(r'/=?') +regex_re = re.compile(r'/(?:[^/\\]*(?:\\.[^/\\]*)*)/[a-zA-Z]*', re.DOTALL) +line_re = re.compile(r'(\r\n|\n|\r)') +line_join_re = re.compile(r'\\' + line_re.pattern) +uni_escape_re = re.compile(r'[a-fA-F0-9]{1,4}') +hex_escape_re = re.compile(r'[a-fA-F0-9]{1,2}') + + +class Token(NamedTuple): + type: str + value: str + lineno: int + + +_rules: list[tuple[str | None, re.Pattern[str]]] = [ + (None, re.compile(r'\s+', re.UNICODE)), + (None, re.compile(r' [key, prev, next] + dict.clear(self) + + def __setitem__(self, key, value): + if key not in self: + end = self.__end + curr = end[1] + curr[2] = end[1] = self.__map[key] = [key, curr, end] + dict.__setitem__(self, key, value) + + def __delitem__(self, key): + dict.__delitem__(self, key) + key, prev, next = self.__map.pop(key) + prev[2] = next + next[1] = prev + + def __iter__(self): + end = self.__end + curr = end[2] + while curr is not end: + yield curr[0] + curr = curr[2] + + def __reversed__(self): + end = self.__end + curr = end[1] + while curr is not end: + yield curr[0] + curr = curr[1] + + def popitem(self, last=True): + if not self: + raise KeyError('dictionary is empty') + if last: + key = reversed(self).next() + else: + key = iter(self).next() + value = self.pop(key) + return key, value + + def __reduce__(self): + items = [[k, self[k]] for k in self] + tmp = self.__map, self.__end + del self.__map, self.__end + inst_dict = vars(self).copy() + self.__map, self.__end = tmp + if inst_dict: + return (self.__class__, (items,), inst_dict) + return self.__class__, (items,) + + def keys(self): + return list(self) + + setdefault = DictMixin.setdefault + update = DictMixin.update + pop = DictMixin.pop + values = DictMixin.values + items = DictMixin.items + iterkeys = DictMixin.iterkeys + itervalues = DictMixin.itervalues + iteritems = DictMixin.iteritems + + def __repr__(self): + if not self: + return '%s()' % (self.__class__.__name__,) + return '%s(%r)' % (self.__class__.__name__, self.items()) + + def copy(self): + return self.__class__(self) + + @classmethod + def fromkeys(cls, iterable, value=None): + d = cls() + for key in iterable: + d[key] = value + return d + + def __eq__(self, other): + if isinstance(other, OrderedDict): + return len(self)==len(other) and self.items() == other.items() + return dict.__eq__(self, other) + + def __ne__(self, other): + return not self == other + diff --git a/venv/Lib/site-packages/bn/relimport_test.py b/venv/Lib/site-packages/bn/relimport_test.py new file mode 100644 index 0000000000000000000000000000000000000000..ab8bc4a99c167ed8a1c7812b545298ae7fd8b3e9 --- /dev/null +++ b/venv/Lib/site-packages/bn/relimport_test.py @@ -0,0 +1,9 @@ +from bn import relimport + +absimport = relimport( + '.', + __file__, + '.', + 'absimport', +) + diff --git a/venv/Lib/site-packages/click-8.2.1.dist-info/INSTALLER b/venv/Lib/site-packages/click-8.2.1.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/venv/Lib/site-packages/click-8.2.1.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/venv/Lib/site-packages/click-8.2.1.dist-info/METADATA b/venv/Lib/site-packages/click-8.2.1.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..e6c05af4a78cabdf5689f3f6f7fd57304d8a0eb1 --- /dev/null +++ b/venv/Lib/site-packages/click-8.2.1.dist-info/METADATA @@ -0,0 +1,82 @@ +Metadata-Version: 2.4 +Name: click +Version: 8.2.1 +Summary: Composable command line interface toolkit +Maintainer-email: Pallets +Requires-Python: >=3.10 +Description-Content-Type: text/markdown +License-Expression: BSD-3-Clause +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Typing :: Typed +License-File: LICENSE.txt +Requires-Dist: colorama; platform_system == 'Windows' +Project-URL: Changes, https://click.palletsprojects.com/page/changes/ +Project-URL: Chat, https://discord.gg/pallets +Project-URL: Documentation, https://click.palletsprojects.com/ +Project-URL: Donate, https://palletsprojects.com/donate +Project-URL: Source, https://github.com/pallets/click/ + +# $ click_ + +Click is a Python package for creating beautiful command line interfaces +in a composable way with as little code as necessary. It's the "Command +Line Interface Creation Kit". It's highly configurable but comes with +sensible defaults out of the box. + +It aims to make the process of writing command line tools quick and fun +while also preventing any frustration caused by the inability to +implement an intended CLI API. + +Click in three points: + +- Arbitrary nesting of commands +- Automatic help page generation +- Supports lazy loading of subcommands at runtime + + +## A Simple Example + +```python +import click + +@click.command() +@click.option("--count", default=1, help="Number of greetings.") +@click.option("--name", prompt="Your name", help="The person to greet.") +def hello(count, name): + """Simple program that greets NAME for a total of COUNT times.""" + for _ in range(count): + click.echo(f"Hello, {name}!") + +if __name__ == '__main__': + hello() +``` + +``` +$ python hello.py --count=3 +Your name: Click +Hello, Click! +Hello, Click! +Hello, Click! +``` + + +## Donate + +The Pallets organization develops and supports Click and other popular +packages. In order to grow the community of contributors and users, and +allow the maintainers to devote more time to the projects, [please +donate today][]. + +[please donate today]: https://palletsprojects.com/donate + +## Contributing + +See our [detailed contributing documentation][contrib] for many ways to +contribute, including reporting issues, requesting features, asking or answering +questions, and making PRs. + +[contrib]: https://palletsprojects.com/contributing/ + diff --git a/venv/Lib/site-packages/click-8.2.1.dist-info/RECORD b/venv/Lib/site-packages/click-8.2.1.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..6c757c45249b84d7d3115e20f706b37f8487a014 --- /dev/null +++ b/venv/Lib/site-packages/click-8.2.1.dist-info/RECORD @@ -0,0 +1,38 @@ +click-8.2.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +click-8.2.1.dist-info/METADATA,sha256=dI1MbhHTLoKD2tNCCGnx9rK2gok23HDNylFeLKdLSik,2471 +click-8.2.1.dist-info/RECORD,, +click-8.2.1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82 +click-8.2.1.dist-info/licenses/LICENSE.txt,sha256=morRBqOU6FO_4h9C9OctWSgZoigF2ZG18ydQKSkrZY0,1475 +click/__init__.py,sha256=6YyS1aeyknZ0LYweWozNZy0A9nZ_11wmYIhv3cbQrYo,4473 +click/__pycache__/__init__.cpython-313.pyc,, +click/__pycache__/_compat.cpython-313.pyc,, +click/__pycache__/_termui_impl.cpython-313.pyc,, +click/__pycache__/_textwrap.cpython-313.pyc,, +click/__pycache__/_winconsole.cpython-313.pyc,, +click/__pycache__/core.cpython-313.pyc,, +click/__pycache__/decorators.cpython-313.pyc,, +click/__pycache__/exceptions.cpython-313.pyc,, +click/__pycache__/formatting.cpython-313.pyc,, +click/__pycache__/globals.cpython-313.pyc,, +click/__pycache__/parser.cpython-313.pyc,, +click/__pycache__/shell_completion.cpython-313.pyc,, +click/__pycache__/termui.cpython-313.pyc,, +click/__pycache__/testing.cpython-313.pyc,, +click/__pycache__/types.cpython-313.pyc,, +click/__pycache__/utils.cpython-313.pyc,, +click/_compat.py,sha256=v3xBZkFbvA1BXPRkFfBJc6-pIwPI7345m-kQEnpVAs4,18693 +click/_termui_impl.py,sha256=ASXhLi9IQIc0Js9KQSS-3-SLZcPet3VqysBf9WgbbpI,26712 +click/_textwrap.py,sha256=BOae0RQ6vg3FkNgSJyOoGzG1meGMxJ_ukWVZKx_v-0o,1400 +click/_winconsole.py,sha256=_vxUuUaxwBhoR0vUWCNuHY8VUefiMdCIyU2SXPqoF-A,8465 +click/core.py,sha256=gUhpNS9cFBGdEXXdisGVG-eRvGf49RTyFagxulqwdFw,117343 +click/decorators.py,sha256=5P7abhJtAQYp_KHgjUvhMv464ERwOzrv2enNknlwHyQ,18461 +click/exceptions.py,sha256=1rdtXgHJ1b3OjGkN-UpXB9t_HCBihJvh_DtpmLmwn9s,9891 +click/formatting.py,sha256=Bhqx4QXdKQ9W4WKknIwj5KPKFmtduGOuGq1yw_THLZ8,9726 +click/globals.py,sha256=gM-Nh6A4M0HB_SgkaF5M4ncGGMDHc_flHXu9_oh4GEU,1923 +click/parser.py,sha256=nU1Ah2p11q29ul1vNdU9swPo_PUuKrxU6YXToi71q1c,18979 +click/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +click/shell_completion.py,sha256=CQSGdjgun4ORbOZrXP0CVhEtPx4knsufOkRsDiK64cM,19857 +click/termui.py,sha256=vAYrKC2a7f_NfEIhAThEVYfa__ib5XQbTSCGtJlABRA,30847 +click/testing.py,sha256=2eLdAaCJCGToP5Tw-XN8JjrDb3wbJIfARxg3d0crW5M,18702 +click/types.py,sha256=KBTRxN28cR1VZ5mb9iJX98MQSw_p9SGzljqfEI8z5Tw,38389 +click/utils.py,sha256=b1Mm-usEDBHtEwcPltPIn3zSK4nw2KTp5GC7_oSTlLo,20245 diff --git a/venv/Lib/site-packages/click-8.2.1.dist-info/WHEEL b/venv/Lib/site-packages/click-8.2.1.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..d8b9936dad9ab2513fa6979f411560d3b6b57e37 --- /dev/null +++ b/venv/Lib/site-packages/click-8.2.1.dist-info/WHEEL @@ -0,0 +1,4 @@ +Wheel-Version: 1.0 +Generator: flit 3.12.0 +Root-Is-Purelib: true +Tag: py3-none-any diff --git a/venv/Lib/site-packages/click-8.2.1.dist-info/licenses/LICENSE.txt b/venv/Lib/site-packages/click-8.2.1.dist-info/licenses/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..d12a849186982399c537c5b9a8fd77bf2edd5eab --- /dev/null +++ b/venv/Lib/site-packages/click-8.2.1.dist-info/licenses/LICENSE.txt @@ -0,0 +1,28 @@ +Copyright 2014 Pallets + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/venv/Lib/site-packages/click/__init__.py b/venv/Lib/site-packages/click/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1aa547c57af68954b3bcd6012873881030e53d91 --- /dev/null +++ b/venv/Lib/site-packages/click/__init__.py @@ -0,0 +1,123 @@ +""" +Click is a simple Python module inspired by the stdlib optparse to make +writing command line scripts fun. Unlike other modules, it's based +around a simple API that does not come with too much magic and is +composable. +""" + +from __future__ import annotations + +from .core import Argument as Argument +from .core import Command as Command +from .core import CommandCollection as CommandCollection +from .core import Context as Context +from .core import Group as Group +from .core import Option as Option +from .core import Parameter as Parameter +from .decorators import argument as argument +from .decorators import command as command +from .decorators import confirmation_option as confirmation_option +from .decorators import group as group +from .decorators import help_option as help_option +from .decorators import make_pass_decorator as make_pass_decorator +from .decorators import option as option +from .decorators import pass_context as pass_context +from .decorators import pass_obj as pass_obj +from .decorators import password_option as password_option +from .decorators import version_option as version_option +from .exceptions import Abort as Abort +from .exceptions import BadArgumentUsage as BadArgumentUsage +from .exceptions import BadOptionUsage as BadOptionUsage +from .exceptions import BadParameter as BadParameter +from .exceptions import ClickException as ClickException +from .exceptions import FileError as FileError +from .exceptions import MissingParameter as MissingParameter +from .exceptions import NoSuchOption as NoSuchOption +from .exceptions import UsageError as UsageError +from .formatting import HelpFormatter as HelpFormatter +from .formatting import wrap_text as wrap_text +from .globals import get_current_context as get_current_context +from .termui import clear as clear +from .termui import confirm as confirm +from .termui import echo_via_pager as echo_via_pager +from .termui import edit as edit +from .termui import getchar as getchar +from .termui import launch as launch +from .termui import pause as pause +from .termui import progressbar as progressbar +from .termui import prompt as prompt +from .termui import secho as secho +from .termui import style as style +from .termui import unstyle as unstyle +from .types import BOOL as BOOL +from .types import Choice as Choice +from .types import DateTime as DateTime +from .types import File as File +from .types import FLOAT as FLOAT +from .types import FloatRange as FloatRange +from .types import INT as INT +from .types import IntRange as IntRange +from .types import ParamType as ParamType +from .types import Path as Path +from .types import STRING as STRING +from .types import Tuple as Tuple +from .types import UNPROCESSED as UNPROCESSED +from .types import UUID as UUID +from .utils import echo as echo +from .utils import format_filename as format_filename +from .utils import get_app_dir as get_app_dir +from .utils import get_binary_stream as get_binary_stream +from .utils import get_text_stream as get_text_stream +from .utils import open_file as open_file + + +def __getattr__(name: str) -> object: + import warnings + + if name == "BaseCommand": + from .core import _BaseCommand + + warnings.warn( + "'BaseCommand' is deprecated and will be removed in Click 9.0. Use" + " 'Command' instead.", + DeprecationWarning, + stacklevel=2, + ) + return _BaseCommand + + if name == "MultiCommand": + from .core import _MultiCommand + + warnings.warn( + "'MultiCommand' is deprecated and will be removed in Click 9.0. Use" + " 'Group' instead.", + DeprecationWarning, + stacklevel=2, + ) + return _MultiCommand + + if name == "OptionParser": + from .parser import _OptionParser + + warnings.warn( + "'OptionParser' is deprecated and will be removed in Click 9.0. The" + " old parser is available in 'optparse'.", + DeprecationWarning, + stacklevel=2, + ) + return _OptionParser + + if name == "__version__": + import importlib.metadata + import warnings + + warnings.warn( + "The '__version__' attribute is deprecated and will be removed in" + " Click 9.1. Use feature detection or" + " 'importlib.metadata.version(\"click\")' instead.", + DeprecationWarning, + stacklevel=2, + ) + return importlib.metadata.version("click") + + raise AttributeError(name) diff --git a/venv/Lib/site-packages/click/__pycache__/__init__.cpython-313.pyc b/venv/Lib/site-packages/click/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..104e918ba99bed8ba8fc9902f8d1e16421ebc08d Binary files /dev/null and b/venv/Lib/site-packages/click/__pycache__/__init__.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/click/__pycache__/_compat.cpython-313.pyc b/venv/Lib/site-packages/click/__pycache__/_compat.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c6453c448dabc233ba01119a3749aca93fb59baf Binary files /dev/null and b/venv/Lib/site-packages/click/__pycache__/_compat.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/click/__pycache__/_termui_impl.cpython-313.pyc b/venv/Lib/site-packages/click/__pycache__/_termui_impl.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a9b837d79abdb4160f70a2e99392de23b9ae20ec Binary files /dev/null and b/venv/Lib/site-packages/click/__pycache__/_termui_impl.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/click/__pycache__/_textwrap.cpython-313.pyc b/venv/Lib/site-packages/click/__pycache__/_textwrap.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..494489ac078e00ffb1a8037dc150a90c2c096899 Binary files /dev/null and b/venv/Lib/site-packages/click/__pycache__/_textwrap.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/click/__pycache__/_winconsole.cpython-313.pyc b/venv/Lib/site-packages/click/__pycache__/_winconsole.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cb05e912a4249d9436a22c3d825cecab9d91b581 Binary files /dev/null and b/venv/Lib/site-packages/click/__pycache__/_winconsole.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/click/__pycache__/core.cpython-313.pyc b/venv/Lib/site-packages/click/__pycache__/core.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..002253fce20831b9a2f553ceff35551693b8322c --- /dev/null +++ b/venv/Lib/site-packages/click/__pycache__/core.cpython-313.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0cf08356425d921359d035cfbfa956599d7ab2fdf0517f8965ce61915b3fcf00 +size 126395 diff --git a/venv/Lib/site-packages/click/__pycache__/decorators.cpython-313.pyc b/venv/Lib/site-packages/click/__pycache__/decorators.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..19fead3d0a5fb719e8b403b51bf5b21cd6db33b4 Binary files /dev/null and b/venv/Lib/site-packages/click/__pycache__/decorators.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/click/__pycache__/exceptions.cpython-313.pyc b/venv/Lib/site-packages/click/__pycache__/exceptions.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8cd8ceac6d2e555cc2297f600fa7403557ca0917 Binary files /dev/null and b/venv/Lib/site-packages/click/__pycache__/exceptions.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/click/__pycache__/formatting.cpython-313.pyc b/venv/Lib/site-packages/click/__pycache__/formatting.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..200f6de2de6b026870eae0bb5b07c09d53230fd5 Binary files /dev/null and b/venv/Lib/site-packages/click/__pycache__/formatting.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/click/__pycache__/globals.cpython-313.pyc b/venv/Lib/site-packages/click/__pycache__/globals.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..21ceee4f012b22b6dbc8a3820e6d83e3873af219 Binary files /dev/null and b/venv/Lib/site-packages/click/__pycache__/globals.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/click/__pycache__/parser.cpython-313.pyc b/venv/Lib/site-packages/click/__pycache__/parser.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4ef6baa14bc71615e9df3c10d1b623eba1a66b86 Binary files /dev/null and b/venv/Lib/site-packages/click/__pycache__/parser.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/click/__pycache__/shell_completion.cpython-313.pyc b/venv/Lib/site-packages/click/__pycache__/shell_completion.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4f82913a1445380e6136e681c24470625177c213 Binary files /dev/null and b/venv/Lib/site-packages/click/__pycache__/shell_completion.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/click/__pycache__/termui.cpython-313.pyc b/venv/Lib/site-packages/click/__pycache__/termui.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..49c12f21a237a36874aa00f44b9feb8cce2b8a73 Binary files /dev/null and b/venv/Lib/site-packages/click/__pycache__/termui.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/click/__pycache__/testing.cpython-313.pyc b/venv/Lib/site-packages/click/__pycache__/testing.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3a546d759a85934c2b9dcc554a774f10779cc179 Binary files /dev/null and b/venv/Lib/site-packages/click/__pycache__/testing.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/click/__pycache__/types.cpython-313.pyc b/venv/Lib/site-packages/click/__pycache__/types.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..328255e0dfdd25028a576c16c444cf13a5a84705 Binary files /dev/null and b/venv/Lib/site-packages/click/__pycache__/types.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/click/__pycache__/utils.cpython-313.pyc b/venv/Lib/site-packages/click/__pycache__/utils.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dbeef38301dd0efec14c784e61f90f99eb396e50 Binary files /dev/null and b/venv/Lib/site-packages/click/__pycache__/utils.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/click/_compat.py b/venv/Lib/site-packages/click/_compat.py new file mode 100644 index 0000000000000000000000000000000000000000..f2726b93afe2ed69ba20d8e709c9cbd22b9d2339 --- /dev/null +++ b/venv/Lib/site-packages/click/_compat.py @@ -0,0 +1,622 @@ +from __future__ import annotations + +import codecs +import collections.abc as cabc +import io +import os +import re +import sys +import typing as t +from types import TracebackType +from weakref import WeakKeyDictionary + +CYGWIN = sys.platform.startswith("cygwin") +WIN = sys.platform.startswith("win") +auto_wrap_for_ansi: t.Callable[[t.TextIO], t.TextIO] | None = None +_ansi_re = re.compile(r"\033\[[;?0-9]*[a-zA-Z]") + + +def _make_text_stream( + stream: t.BinaryIO, + encoding: str | None, + errors: str | None, + force_readable: bool = False, + force_writable: bool = False, +) -> t.TextIO: + if encoding is None: + encoding = get_best_encoding(stream) + if errors is None: + errors = "replace" + return _NonClosingTextIOWrapper( + stream, + encoding, + errors, + line_buffering=True, + force_readable=force_readable, + force_writable=force_writable, + ) + + +def is_ascii_encoding(encoding: str) -> bool: + """Checks if a given encoding is ascii.""" + try: + return codecs.lookup(encoding).name == "ascii" + except LookupError: + return False + + +def get_best_encoding(stream: t.IO[t.Any]) -> str: + """Returns the default stream encoding if not found.""" + rv = getattr(stream, "encoding", None) or sys.getdefaultencoding() + if is_ascii_encoding(rv): + return "utf-8" + return rv + + +class _NonClosingTextIOWrapper(io.TextIOWrapper): + def __init__( + self, + stream: t.BinaryIO, + encoding: str | None, + errors: str | None, + force_readable: bool = False, + force_writable: bool = False, + **extra: t.Any, + ) -> None: + self._stream = stream = t.cast( + t.BinaryIO, _FixupStream(stream, force_readable, force_writable) + ) + super().__init__(stream, encoding, errors, **extra) + + def __del__(self) -> None: + try: + self.detach() + except Exception: + pass + + def isatty(self) -> bool: + # https://bitbucket.org/pypy/pypy/issue/1803 + return self._stream.isatty() + + +class _FixupStream: + """The new io interface needs more from streams than streams + traditionally implement. As such, this fix-up code is necessary in + some circumstances. + + The forcing of readable and writable flags are there because some tools + put badly patched objects on sys (one such offender are certain version + of jupyter notebook). + """ + + def __init__( + self, + stream: t.BinaryIO, + force_readable: bool = False, + force_writable: bool = False, + ): + self._stream = stream + self._force_readable = force_readable + self._force_writable = force_writable + + def __getattr__(self, name: str) -> t.Any: + return getattr(self._stream, name) + + def read1(self, size: int) -> bytes: + f = getattr(self._stream, "read1", None) + + if f is not None: + return t.cast(bytes, f(size)) + + return self._stream.read(size) + + def readable(self) -> bool: + if self._force_readable: + return True + x = getattr(self._stream, "readable", None) + if x is not None: + return t.cast(bool, x()) + try: + self._stream.read(0) + except Exception: + return False + return True + + def writable(self) -> bool: + if self._force_writable: + return True + x = getattr(self._stream, "writable", None) + if x is not None: + return t.cast(bool, x()) + try: + self._stream.write(b"") + except Exception: + try: + self._stream.write(b"") + except Exception: + return False + return True + + def seekable(self) -> bool: + x = getattr(self._stream, "seekable", None) + if x is not None: + return t.cast(bool, x()) + try: + self._stream.seek(self._stream.tell()) + except Exception: + return False + return True + + +def _is_binary_reader(stream: t.IO[t.Any], default: bool = False) -> bool: + try: + return isinstance(stream.read(0), bytes) + except Exception: + return default + # This happens in some cases where the stream was already + # closed. In this case, we assume the default. + + +def _is_binary_writer(stream: t.IO[t.Any], default: bool = False) -> bool: + try: + stream.write(b"") + except Exception: + try: + stream.write("") + return False + except Exception: + pass + return default + return True + + +def _find_binary_reader(stream: t.IO[t.Any]) -> t.BinaryIO | None: + # We need to figure out if the given stream is already binary. + # This can happen because the official docs recommend detaching + # the streams to get binary streams. Some code might do this, so + # we need to deal with this case explicitly. + if _is_binary_reader(stream, False): + return t.cast(t.BinaryIO, stream) + + buf = getattr(stream, "buffer", None) + + # Same situation here; this time we assume that the buffer is + # actually binary in case it's closed. + if buf is not None and _is_binary_reader(buf, True): + return t.cast(t.BinaryIO, buf) + + return None + + +def _find_binary_writer(stream: t.IO[t.Any]) -> t.BinaryIO | None: + # We need to figure out if the given stream is already binary. + # This can happen because the official docs recommend detaching + # the streams to get binary streams. Some code might do this, so + # we need to deal with this case explicitly. + if _is_binary_writer(stream, False): + return t.cast(t.BinaryIO, stream) + + buf = getattr(stream, "buffer", None) + + # Same situation here; this time we assume that the buffer is + # actually binary in case it's closed. + if buf is not None and _is_binary_writer(buf, True): + return t.cast(t.BinaryIO, buf) + + return None + + +def _stream_is_misconfigured(stream: t.TextIO) -> bool: + """A stream is misconfigured if its encoding is ASCII.""" + # If the stream does not have an encoding set, we assume it's set + # to ASCII. This appears to happen in certain unittest + # environments. It's not quite clear what the correct behavior is + # but this at least will force Click to recover somehow. + return is_ascii_encoding(getattr(stream, "encoding", None) or "ascii") + + +def _is_compat_stream_attr(stream: t.TextIO, attr: str, value: str | None) -> bool: + """A stream attribute is compatible if it is equal to the + desired value or the desired value is unset and the attribute + has a value. + """ + stream_value = getattr(stream, attr, None) + return stream_value == value or (value is None and stream_value is not None) + + +def _is_compatible_text_stream( + stream: t.TextIO, encoding: str | None, errors: str | None +) -> bool: + """Check if a stream's encoding and errors attributes are + compatible with the desired values. + """ + return _is_compat_stream_attr( + stream, "encoding", encoding + ) and _is_compat_stream_attr(stream, "errors", errors) + + +def _force_correct_text_stream( + text_stream: t.IO[t.Any], + encoding: str | None, + errors: str | None, + is_binary: t.Callable[[t.IO[t.Any], bool], bool], + find_binary: t.Callable[[t.IO[t.Any]], t.BinaryIO | None], + force_readable: bool = False, + force_writable: bool = False, +) -> t.TextIO: + if is_binary(text_stream, False): + binary_reader = t.cast(t.BinaryIO, text_stream) + else: + text_stream = t.cast(t.TextIO, text_stream) + # If the stream looks compatible, and won't default to a + # misconfigured ascii encoding, return it as-is. + if _is_compatible_text_stream(text_stream, encoding, errors) and not ( + encoding is None and _stream_is_misconfigured(text_stream) + ): + return text_stream + + # Otherwise, get the underlying binary reader. + possible_binary_reader = find_binary(text_stream) + + # If that's not possible, silently use the original reader + # and get mojibake instead of exceptions. + if possible_binary_reader is None: + return text_stream + + binary_reader = possible_binary_reader + + # Default errors to replace instead of strict in order to get + # something that works. + if errors is None: + errors = "replace" + + # Wrap the binary stream in a text stream with the correct + # encoding parameters. + return _make_text_stream( + binary_reader, + encoding, + errors, + force_readable=force_readable, + force_writable=force_writable, + ) + + +def _force_correct_text_reader( + text_reader: t.IO[t.Any], + encoding: str | None, + errors: str | None, + force_readable: bool = False, +) -> t.TextIO: + return _force_correct_text_stream( + text_reader, + encoding, + errors, + _is_binary_reader, + _find_binary_reader, + force_readable=force_readable, + ) + + +def _force_correct_text_writer( + text_writer: t.IO[t.Any], + encoding: str | None, + errors: str | None, + force_writable: bool = False, +) -> t.TextIO: + return _force_correct_text_stream( + text_writer, + encoding, + errors, + _is_binary_writer, + _find_binary_writer, + force_writable=force_writable, + ) + + +def get_binary_stdin() -> t.BinaryIO: + reader = _find_binary_reader(sys.stdin) + if reader is None: + raise RuntimeError("Was not able to determine binary stream for sys.stdin.") + return reader + + +def get_binary_stdout() -> t.BinaryIO: + writer = _find_binary_writer(sys.stdout) + if writer is None: + raise RuntimeError("Was not able to determine binary stream for sys.stdout.") + return writer + + +def get_binary_stderr() -> t.BinaryIO: + writer = _find_binary_writer(sys.stderr) + if writer is None: + raise RuntimeError("Was not able to determine binary stream for sys.stderr.") + return writer + + +def get_text_stdin(encoding: str | None = None, errors: str | None = None) -> t.TextIO: + rv = _get_windows_console_stream(sys.stdin, encoding, errors) + if rv is not None: + return rv + return _force_correct_text_reader(sys.stdin, encoding, errors, force_readable=True) + + +def get_text_stdout(encoding: str | None = None, errors: str | None = None) -> t.TextIO: + rv = _get_windows_console_stream(sys.stdout, encoding, errors) + if rv is not None: + return rv + return _force_correct_text_writer(sys.stdout, encoding, errors, force_writable=True) + + +def get_text_stderr(encoding: str | None = None, errors: str | None = None) -> t.TextIO: + rv = _get_windows_console_stream(sys.stderr, encoding, errors) + if rv is not None: + return rv + return _force_correct_text_writer(sys.stderr, encoding, errors, force_writable=True) + + +def _wrap_io_open( + file: str | os.PathLike[str] | int, + mode: str, + encoding: str | None, + errors: str | None, +) -> t.IO[t.Any]: + """Handles not passing ``encoding`` and ``errors`` in binary mode.""" + if "b" in mode: + return open(file, mode) + + return open(file, mode, encoding=encoding, errors=errors) + + +def open_stream( + filename: str | os.PathLike[str], + mode: str = "r", + encoding: str | None = None, + errors: str | None = "strict", + atomic: bool = False, +) -> tuple[t.IO[t.Any], bool]: + binary = "b" in mode + filename = os.fspath(filename) + + # Standard streams first. These are simple because they ignore the + # atomic flag. Use fsdecode to handle Path("-"). + if os.fsdecode(filename) == "-": + if any(m in mode for m in ["w", "a", "x"]): + if binary: + return get_binary_stdout(), False + return get_text_stdout(encoding=encoding, errors=errors), False + if binary: + return get_binary_stdin(), False + return get_text_stdin(encoding=encoding, errors=errors), False + + # Non-atomic writes directly go out through the regular open functions. + if not atomic: + return _wrap_io_open(filename, mode, encoding, errors), True + + # Some usability stuff for atomic writes + if "a" in mode: + raise ValueError( + "Appending to an existing file is not supported, because that" + " would involve an expensive `copy`-operation to a temporary" + " file. Open the file in normal `w`-mode and copy explicitly" + " if that's what you're after." + ) + if "x" in mode: + raise ValueError("Use the `overwrite`-parameter instead.") + if "w" not in mode: + raise ValueError("Atomic writes only make sense with `w`-mode.") + + # Atomic writes are more complicated. They work by opening a file + # as a proxy in the same folder and then using the fdopen + # functionality to wrap it in a Python file. Then we wrap it in an + # atomic file that moves the file over on close. + import errno + import random + + try: + perm: int | None = os.stat(filename).st_mode + except OSError: + perm = None + + flags = os.O_RDWR | os.O_CREAT | os.O_EXCL + + if binary: + flags |= getattr(os, "O_BINARY", 0) + + while True: + tmp_filename = os.path.join( + os.path.dirname(filename), + f".__atomic-write{random.randrange(1 << 32):08x}", + ) + try: + fd = os.open(tmp_filename, flags, 0o666 if perm is None else perm) + break + except OSError as e: + if e.errno == errno.EEXIST or ( + os.name == "nt" + and e.errno == errno.EACCES + and os.path.isdir(e.filename) + and os.access(e.filename, os.W_OK) + ): + continue + raise + + if perm is not None: + os.chmod(tmp_filename, perm) # in case perm includes bits in umask + + f = _wrap_io_open(fd, mode, encoding, errors) + af = _AtomicFile(f, tmp_filename, os.path.realpath(filename)) + return t.cast(t.IO[t.Any], af), True + + +class _AtomicFile: + def __init__(self, f: t.IO[t.Any], tmp_filename: str, real_filename: str) -> None: + self._f = f + self._tmp_filename = tmp_filename + self._real_filename = real_filename + self.closed = False + + @property + def name(self) -> str: + return self._real_filename + + def close(self, delete: bool = False) -> None: + if self.closed: + return + self._f.close() + os.replace(self._tmp_filename, self._real_filename) + self.closed = True + + def __getattr__(self, name: str) -> t.Any: + return getattr(self._f, name) + + def __enter__(self) -> _AtomicFile: + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_value: BaseException | None, + tb: TracebackType | None, + ) -> None: + self.close(delete=exc_type is not None) + + def __repr__(self) -> str: + return repr(self._f) + + +def strip_ansi(value: str) -> str: + return _ansi_re.sub("", value) + + +def _is_jupyter_kernel_output(stream: t.IO[t.Any]) -> bool: + while isinstance(stream, (_FixupStream, _NonClosingTextIOWrapper)): + stream = stream._stream + + return stream.__class__.__module__.startswith("ipykernel.") + + +def should_strip_ansi( + stream: t.IO[t.Any] | None = None, color: bool | None = None +) -> bool: + if color is None: + if stream is None: + stream = sys.stdin + return not isatty(stream) and not _is_jupyter_kernel_output(stream) + return not color + + +# On Windows, wrap the output streams with colorama to support ANSI +# color codes. +# NOTE: double check is needed so mypy does not analyze this on Linux +if sys.platform.startswith("win") and WIN: + from ._winconsole import _get_windows_console_stream + + def _get_argv_encoding() -> str: + import locale + + return locale.getpreferredencoding() + + _ansi_stream_wrappers: cabc.MutableMapping[t.TextIO, t.TextIO] = WeakKeyDictionary() + + def auto_wrap_for_ansi(stream: t.TextIO, color: bool | None = None) -> t.TextIO: + """Support ANSI color and style codes on Windows by wrapping a + stream with colorama. + """ + try: + cached = _ansi_stream_wrappers.get(stream) + except Exception: + cached = None + + if cached is not None: + return cached + + import colorama + + strip = should_strip_ansi(stream, color) + ansi_wrapper = colorama.AnsiToWin32(stream, strip=strip) + rv = t.cast(t.TextIO, ansi_wrapper.stream) + _write = rv.write + + def _safe_write(s: str) -> int: + try: + return _write(s) + except BaseException: + ansi_wrapper.reset_all() + raise + + rv.write = _safe_write # type: ignore[method-assign] + + try: + _ansi_stream_wrappers[stream] = rv + except Exception: + pass + + return rv + +else: + + def _get_argv_encoding() -> str: + return getattr(sys.stdin, "encoding", None) or sys.getfilesystemencoding() + + def _get_windows_console_stream( + f: t.TextIO, encoding: str | None, errors: str | None + ) -> t.TextIO | None: + return None + + +def term_len(x: str) -> int: + return len(strip_ansi(x)) + + +def isatty(stream: t.IO[t.Any]) -> bool: + try: + return stream.isatty() + except Exception: + return False + + +def _make_cached_stream_func( + src_func: t.Callable[[], t.TextIO | None], + wrapper_func: t.Callable[[], t.TextIO], +) -> t.Callable[[], t.TextIO | None]: + cache: cabc.MutableMapping[t.TextIO, t.TextIO] = WeakKeyDictionary() + + def func() -> t.TextIO | None: + stream = src_func() + + if stream is None: + return None + + try: + rv = cache.get(stream) + except Exception: + rv = None + if rv is not None: + return rv + rv = wrapper_func() + try: + cache[stream] = rv + except Exception: + pass + return rv + + return func + + +_default_text_stdin = _make_cached_stream_func(lambda: sys.stdin, get_text_stdin) +_default_text_stdout = _make_cached_stream_func(lambda: sys.stdout, get_text_stdout) +_default_text_stderr = _make_cached_stream_func(lambda: sys.stderr, get_text_stderr) + + +binary_streams: cabc.Mapping[str, t.Callable[[], t.BinaryIO]] = { + "stdin": get_binary_stdin, + "stdout": get_binary_stdout, + "stderr": get_binary_stderr, +} + +text_streams: cabc.Mapping[str, t.Callable[[str | None, str | None], t.TextIO]] = { + "stdin": get_text_stdin, + "stdout": get_text_stdout, + "stderr": get_text_stderr, +} diff --git a/venv/Lib/site-packages/click/_termui_impl.py b/venv/Lib/site-packages/click/_termui_impl.py new file mode 100644 index 0000000000000000000000000000000000000000..51fd9bf358f0ee8dedceb88efa8c6a60dc40d4a8 --- /dev/null +++ b/venv/Lib/site-packages/click/_termui_impl.py @@ -0,0 +1,839 @@ +""" +This module contains implementations for the termui module. To keep the +import time of Click down, some infrequently used functionality is +placed in this module and only imported as needed. +""" + +from __future__ import annotations + +import collections.abc as cabc +import contextlib +import math +import os +import shlex +import sys +import time +import typing as t +from gettext import gettext as _ +from io import StringIO +from pathlib import Path +from shutil import which +from types import TracebackType + +from ._compat import _default_text_stdout +from ._compat import CYGWIN +from ._compat import get_best_encoding +from ._compat import isatty +from ._compat import open_stream +from ._compat import strip_ansi +from ._compat import term_len +from ._compat import WIN +from .exceptions import ClickException +from .utils import echo + +V = t.TypeVar("V") + +if os.name == "nt": + BEFORE_BAR = "\r" + AFTER_BAR = "\n" +else: + BEFORE_BAR = "\r\033[?25l" + AFTER_BAR = "\033[?25h\n" + + +class ProgressBar(t.Generic[V]): + def __init__( + self, + iterable: cabc.Iterable[V] | None, + length: int | None = None, + fill_char: str = "#", + empty_char: str = " ", + bar_template: str = "%(bar)s", + info_sep: str = " ", + hidden: bool = False, + show_eta: bool = True, + show_percent: bool | None = None, + show_pos: bool = False, + item_show_func: t.Callable[[V | None], str | None] | None = None, + label: str | None = None, + file: t.TextIO | None = None, + color: bool | None = None, + update_min_steps: int = 1, + width: int = 30, + ) -> None: + self.fill_char = fill_char + self.empty_char = empty_char + self.bar_template = bar_template + self.info_sep = info_sep + self.hidden = hidden + self.show_eta = show_eta + self.show_percent = show_percent + self.show_pos = show_pos + self.item_show_func = item_show_func + self.label: str = label or "" + + if file is None: + file = _default_text_stdout() + + # There are no standard streams attached to write to. For example, + # pythonw on Windows. + if file is None: + file = StringIO() + + self.file = file + self.color = color + self.update_min_steps = update_min_steps + self._completed_intervals = 0 + self.width: int = width + self.autowidth: bool = width == 0 + + if length is None: + from operator import length_hint + + length = length_hint(iterable, -1) + + if length == -1: + length = None + if iterable is None: + if length is None: + raise TypeError("iterable or length is required") + iterable = t.cast("cabc.Iterable[V]", range(length)) + self.iter: cabc.Iterable[V] = iter(iterable) + self.length = length + self.pos: int = 0 + self.avg: list[float] = [] + self.last_eta: float + self.start: float + self.start = self.last_eta = time.time() + self.eta_known: bool = False + self.finished: bool = False + self.max_width: int | None = None + self.entered: bool = False + self.current_item: V | None = None + self._is_atty = isatty(self.file) + self._last_line: str | None = None + + def __enter__(self) -> ProgressBar[V]: + self.entered = True + self.render_progress() + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_value: BaseException | None, + tb: TracebackType | None, + ) -> None: + self.render_finish() + + def __iter__(self) -> cabc.Iterator[V]: + if not self.entered: + raise RuntimeError("You need to use progress bars in a with block.") + self.render_progress() + return self.generator() + + def __next__(self) -> V: + # Iteration is defined in terms of a generator function, + # returned by iter(self); use that to define next(). This works + # because `self.iter` is an iterable consumed by that generator, + # so it is re-entry safe. Calling `next(self.generator())` + # twice works and does "what you want". + return next(iter(self)) + + def render_finish(self) -> None: + if self.hidden or not self._is_atty: + return + self.file.write(AFTER_BAR) + self.file.flush() + + @property + def pct(self) -> float: + if self.finished: + return 1.0 + return min(self.pos / (float(self.length or 1) or 1), 1.0) + + @property + def time_per_iteration(self) -> float: + if not self.avg: + return 0.0 + return sum(self.avg) / float(len(self.avg)) + + @property + def eta(self) -> float: + if self.length is not None and not self.finished: + return self.time_per_iteration * (self.length - self.pos) + return 0.0 + + def format_eta(self) -> str: + if self.eta_known: + t = int(self.eta) + seconds = t % 60 + t //= 60 + minutes = t % 60 + t //= 60 + hours = t % 24 + t //= 24 + if t > 0: + return f"{t}d {hours:02}:{minutes:02}:{seconds:02}" + else: + return f"{hours:02}:{minutes:02}:{seconds:02}" + return "" + + def format_pos(self) -> str: + pos = str(self.pos) + if self.length is not None: + pos += f"/{self.length}" + return pos + + def format_pct(self) -> str: + return f"{int(self.pct * 100): 4}%"[1:] + + def format_bar(self) -> str: + if self.length is not None: + bar_length = int(self.pct * self.width) + bar = self.fill_char * bar_length + bar += self.empty_char * (self.width - bar_length) + elif self.finished: + bar = self.fill_char * self.width + else: + chars = list(self.empty_char * (self.width or 1)) + if self.time_per_iteration != 0: + chars[ + int( + (math.cos(self.pos * self.time_per_iteration) / 2.0 + 0.5) + * self.width + ) + ] = self.fill_char + bar = "".join(chars) + return bar + + def format_progress_line(self) -> str: + show_percent = self.show_percent + + info_bits = [] + if self.length is not None and show_percent is None: + show_percent = not self.show_pos + + if self.show_pos: + info_bits.append(self.format_pos()) + if show_percent: + info_bits.append(self.format_pct()) + if self.show_eta and self.eta_known and not self.finished: + info_bits.append(self.format_eta()) + if self.item_show_func is not None: + item_info = self.item_show_func(self.current_item) + if item_info is not None: + info_bits.append(item_info) + + return ( + self.bar_template + % { + "label": self.label, + "bar": self.format_bar(), + "info": self.info_sep.join(info_bits), + } + ).rstrip() + + def render_progress(self) -> None: + import shutil + + if self.hidden: + return + + if not self._is_atty: + # Only output the label once if the output is not a TTY. + if self._last_line != self.label: + self._last_line = self.label + echo(self.label, file=self.file, color=self.color) + return + + buf = [] + # Update width in case the terminal has been resized + if self.autowidth: + old_width = self.width + self.width = 0 + clutter_length = term_len(self.format_progress_line()) + new_width = max(0, shutil.get_terminal_size().columns - clutter_length) + if new_width < old_width and self.max_width is not None: + buf.append(BEFORE_BAR) + buf.append(" " * self.max_width) + self.max_width = new_width + self.width = new_width + + clear_width = self.width + if self.max_width is not None: + clear_width = self.max_width + + buf.append(BEFORE_BAR) + line = self.format_progress_line() + line_len = term_len(line) + if self.max_width is None or self.max_width < line_len: + self.max_width = line_len + + buf.append(line) + buf.append(" " * (clear_width - line_len)) + line = "".join(buf) + # Render the line only if it changed. + + if line != self._last_line: + self._last_line = line + echo(line, file=self.file, color=self.color, nl=False) + self.file.flush() + + def make_step(self, n_steps: int) -> None: + self.pos += n_steps + if self.length is not None and self.pos >= self.length: + self.finished = True + + if (time.time() - self.last_eta) < 1.0: + return + + self.last_eta = time.time() + + # self.avg is a rolling list of length <= 7 of steps where steps are + # defined as time elapsed divided by the total progress through + # self.length. + if self.pos: + step = (time.time() - self.start) / self.pos + else: + step = time.time() - self.start + + self.avg = self.avg[-6:] + [step] + + self.eta_known = self.length is not None + + def update(self, n_steps: int, current_item: V | None = None) -> None: + """Update the progress bar by advancing a specified number of + steps, and optionally set the ``current_item`` for this new + position. + + :param n_steps: Number of steps to advance. + :param current_item: Optional item to set as ``current_item`` + for the updated position. + + .. versionchanged:: 8.0 + Added the ``current_item`` optional parameter. + + .. versionchanged:: 8.0 + Only render when the number of steps meets the + ``update_min_steps`` threshold. + """ + if current_item is not None: + self.current_item = current_item + + self._completed_intervals += n_steps + + if self._completed_intervals >= self.update_min_steps: + self.make_step(self._completed_intervals) + self.render_progress() + self._completed_intervals = 0 + + def finish(self) -> None: + self.eta_known = False + self.current_item = None + self.finished = True + + def generator(self) -> cabc.Iterator[V]: + """Return a generator which yields the items added to the bar + during construction, and updates the progress bar *after* the + yielded block returns. + """ + # WARNING: the iterator interface for `ProgressBar` relies on + # this and only works because this is a simple generator which + # doesn't create or manage additional state. If this function + # changes, the impact should be evaluated both against + # `iter(bar)` and `next(bar)`. `next()` in particular may call + # `self.generator()` repeatedly, and this must remain safe in + # order for that interface to work. + if not self.entered: + raise RuntimeError("You need to use progress bars in a with block.") + + if not self._is_atty: + yield from self.iter + else: + for rv in self.iter: + self.current_item = rv + + # This allows show_item_func to be updated before the + # item is processed. Only trigger at the beginning of + # the update interval. + if self._completed_intervals == 0: + self.render_progress() + + yield rv + self.update(1) + + self.finish() + self.render_progress() + + +def pager(generator: cabc.Iterable[str], color: bool | None = None) -> None: + """Decide what method to use for paging through text.""" + stdout = _default_text_stdout() + + # There are no standard streams attached to write to. For example, + # pythonw on Windows. + if stdout is None: + stdout = StringIO() + + if not isatty(sys.stdin) or not isatty(stdout): + return _nullpager(stdout, generator, color) + + # Split and normalize the pager command into parts. + pager_cmd_parts = shlex.split(os.environ.get("PAGER", ""), posix=False) + if pager_cmd_parts: + if WIN: + if _tempfilepager(generator, pager_cmd_parts, color): + return + elif _pipepager(generator, pager_cmd_parts, color): + return + + if os.environ.get("TERM") in ("dumb", "emacs"): + return _nullpager(stdout, generator, color) + if (WIN or sys.platform.startswith("os2")) and _tempfilepager( + generator, ["more"], color + ): + return + if _pipepager(generator, ["less"], color): + return + + import tempfile + + fd, filename = tempfile.mkstemp() + os.close(fd) + try: + if _pipepager(generator, ["more"], color): + return + return _nullpager(stdout, generator, color) + finally: + os.unlink(filename) + + +def _pipepager( + generator: cabc.Iterable[str], cmd_parts: list[str], color: bool | None +) -> bool: + """Page through text by feeding it to another program. Invoking a + pager through this might support colors. + + Returns `True` if the command was found, `False` otherwise and thus another + pager should be attempted. + """ + # Split the command into the invoked CLI and its parameters. + if not cmd_parts: + return False + cmd = cmd_parts[0] + cmd_params = cmd_parts[1:] + + cmd_filepath = which(cmd) + if not cmd_filepath: + return False + # Resolves symlinks and produces a normalized absolute path string. + cmd_path = Path(cmd_filepath).resolve() + cmd_name = cmd_path.name + + import subprocess + + # Make a local copy of the environment to not affect the global one. + env = dict(os.environ) + + # If we're piping to less and the user hasn't decided on colors, we enable + # them by default we find the -R flag in the command line arguments. + if color is None and cmd_name == "less": + less_flags = f"{os.environ.get('LESS', '')}{' '.join(cmd_params)}" + if not less_flags: + env["LESS"] = "-R" + color = True + elif "r" in less_flags or "R" in less_flags: + color = True + + c = subprocess.Popen( + [str(cmd_path)] + cmd_params, + shell=True, + stdin=subprocess.PIPE, + env=env, + errors="replace", + text=True, + ) + assert c.stdin is not None + try: + for text in generator: + if not color: + text = strip_ansi(text) + + c.stdin.write(text) + except BrokenPipeError: + # In case the pager exited unexpectedly, ignore the broken pipe error. + pass + except Exception as e: + # In case there is an exception we want to close the pager immediately + # and let the caller handle it. + # Otherwise the pager will keep running, and the user may not notice + # the error message, or worse yet it may leave the terminal in a broken state. + c.terminate() + raise e + finally: + # We must close stdin and wait for the pager to exit before we continue + try: + c.stdin.close() + # Close implies flush, so it might throw a BrokenPipeError if the pager + # process exited already. + except BrokenPipeError: + pass + + # Less doesn't respect ^C, but catches it for its own UI purposes (aborting + # search or other commands inside less). + # + # That means when the user hits ^C, the parent process (click) terminates, + # but less is still alive, paging the output and messing up the terminal. + # + # If the user wants to make the pager exit on ^C, they should set + # `LESS='-K'`. It's not our decision to make. + while True: + try: + c.wait() + except KeyboardInterrupt: + pass + else: + break + + return True + + +def _tempfilepager( + generator: cabc.Iterable[str], cmd_parts: list[str], color: bool | None +) -> bool: + """Page through text by invoking a program on a temporary file. + + Returns `True` if the command was found, `False` otherwise and thus another + pager should be attempted. + """ + # Split the command into the invoked CLI and its parameters. + if not cmd_parts: + return False + cmd = cmd_parts[0] + + cmd_filepath = which(cmd) + if not cmd_filepath: + return False + # Resolves symlinks and produces a normalized absolute path string. + cmd_path = Path(cmd_filepath).resolve() + + import subprocess + import tempfile + + fd, filename = tempfile.mkstemp() + # TODO: This never terminates if the passed generator never terminates. + text = "".join(generator) + if not color: + text = strip_ansi(text) + encoding = get_best_encoding(sys.stdout) + with open_stream(filename, "wb")[0] as f: + f.write(text.encode(encoding)) + try: + subprocess.call([str(cmd_path), filename]) + except OSError: + # Command not found + pass + finally: + os.close(fd) + os.unlink(filename) + + return True + + +def _nullpager( + stream: t.TextIO, generator: cabc.Iterable[str], color: bool | None +) -> None: + """Simply print unformatted text. This is the ultimate fallback.""" + for text in generator: + if not color: + text = strip_ansi(text) + stream.write(text) + + +class Editor: + def __init__( + self, + editor: str | None = None, + env: cabc.Mapping[str, str] | None = None, + require_save: bool = True, + extension: str = ".txt", + ) -> None: + self.editor = editor + self.env = env + self.require_save = require_save + self.extension = extension + + def get_editor(self) -> str: + if self.editor is not None: + return self.editor + for key in "VISUAL", "EDITOR": + rv = os.environ.get(key) + if rv: + return rv + if WIN: + return "notepad" + for editor in "sensible-editor", "vim", "nano": + if which(editor) is not None: + return editor + return "vi" + + def edit_files(self, filenames: cabc.Iterable[str]) -> None: + import subprocess + + editor = self.get_editor() + environ: dict[str, str] | None = None + + if self.env: + environ = os.environ.copy() + environ.update(self.env) + + exc_filename = " ".join(f'"{filename}"' for filename in filenames) + + try: + c = subprocess.Popen( + args=f"{editor} {exc_filename}", env=environ, shell=True + ) + exit_code = c.wait() + if exit_code != 0: + raise ClickException( + _("{editor}: Editing failed").format(editor=editor) + ) + except OSError as e: + raise ClickException( + _("{editor}: Editing failed: {e}").format(editor=editor, e=e) + ) from e + + @t.overload + def edit(self, text: bytes | bytearray) -> bytes | None: ... + + # We cannot know whether or not the type expected is str or bytes when None + # is passed, so str is returned as that was what was done before. + @t.overload + def edit(self, text: str | None) -> str | None: ... + + def edit(self, text: str | bytes | bytearray | None) -> str | bytes | None: + import tempfile + + if text is None: + data = b"" + elif isinstance(text, (bytes, bytearray)): + data = text + else: + if text and not text.endswith("\n"): + text += "\n" + + if WIN: + data = text.replace("\n", "\r\n").encode("utf-8-sig") + else: + data = text.encode("utf-8") + + fd, name = tempfile.mkstemp(prefix="editor-", suffix=self.extension) + f: t.BinaryIO + + try: + with os.fdopen(fd, "wb") as f: + f.write(data) + + # If the filesystem resolution is 1 second, like Mac OS + # 10.12 Extended, or 2 seconds, like FAT32, and the editor + # closes very fast, require_save can fail. Set the modified + # time to be 2 seconds in the past to work around this. + os.utime(name, (os.path.getatime(name), os.path.getmtime(name) - 2)) + # Depending on the resolution, the exact value might not be + # recorded, so get the new recorded value. + timestamp = os.path.getmtime(name) + + self.edit_files((name,)) + + if self.require_save and os.path.getmtime(name) == timestamp: + return None + + with open(name, "rb") as f: + rv = f.read() + + if isinstance(text, (bytes, bytearray)): + return rv + + return rv.decode("utf-8-sig").replace("\r\n", "\n") + finally: + os.unlink(name) + + +def open_url(url: str, wait: bool = False, locate: bool = False) -> int: + import subprocess + + def _unquote_file(url: str) -> str: + from urllib.parse import unquote + + if url.startswith("file://"): + url = unquote(url[7:]) + + return url + + if sys.platform == "darwin": + args = ["open"] + if wait: + args.append("-W") + if locate: + args.append("-R") + args.append(_unquote_file(url)) + null = open("/dev/null", "w") + try: + return subprocess.Popen(args, stderr=null).wait() + finally: + null.close() + elif WIN: + if locate: + url = _unquote_file(url) + args = ["explorer", f"/select,{url}"] + else: + args = ["start"] + if wait: + args.append("/WAIT") + args.append("") + args.append(url) + try: + return subprocess.call(args) + except OSError: + # Command not found + return 127 + elif CYGWIN: + if locate: + url = _unquote_file(url) + args = ["cygstart", os.path.dirname(url)] + else: + args = ["cygstart"] + if wait: + args.append("-w") + args.append(url) + try: + return subprocess.call(args) + except OSError: + # Command not found + return 127 + + try: + if locate: + url = os.path.dirname(_unquote_file(url)) or "." + else: + url = _unquote_file(url) + c = subprocess.Popen(["xdg-open", url]) + if wait: + return c.wait() + return 0 + except OSError: + if url.startswith(("http://", "https://")) and not locate and not wait: + import webbrowser + + webbrowser.open(url) + return 0 + return 1 + + +def _translate_ch_to_exc(ch: str) -> None: + if ch == "\x03": + raise KeyboardInterrupt() + + if ch == "\x04" and not WIN: # Unix-like, Ctrl+D + raise EOFError() + + if ch == "\x1a" and WIN: # Windows, Ctrl+Z + raise EOFError() + + return None + + +if sys.platform == "win32": + import msvcrt + + @contextlib.contextmanager + def raw_terminal() -> cabc.Iterator[int]: + yield -1 + + def getchar(echo: bool) -> str: + # The function `getch` will return a bytes object corresponding to + # the pressed character. Since Windows 10 build 1803, it will also + # return \x00 when called a second time after pressing a regular key. + # + # `getwch` does not share this probably-bugged behavior. Moreover, it + # returns a Unicode object by default, which is what we want. + # + # Either of these functions will return \x00 or \xe0 to indicate + # a special key, and you need to call the same function again to get + # the "rest" of the code. The fun part is that \u00e0 is + # "latin small letter a with grave", so if you type that on a French + # keyboard, you _also_ get a \xe0. + # E.g., consider the Up arrow. This returns \xe0 and then \x48. The + # resulting Unicode string reads as "a with grave" + "capital H". + # This is indistinguishable from when the user actually types + # "a with grave" and then "capital H". + # + # When \xe0 is returned, we assume it's part of a special-key sequence + # and call `getwch` again, but that means that when the user types + # the \u00e0 character, `getchar` doesn't return until a second + # character is typed. + # The alternative is returning immediately, but that would mess up + # cross-platform handling of arrow keys and others that start with + # \xe0. Another option is using `getch`, but then we can't reliably + # read non-ASCII characters, because return values of `getch` are + # limited to the current 8-bit codepage. + # + # Anyway, Click doesn't claim to do this Right(tm), and using `getwch` + # is doing the right thing in more situations than with `getch`. + + if echo: + func = t.cast(t.Callable[[], str], msvcrt.getwche) + else: + func = t.cast(t.Callable[[], str], msvcrt.getwch) + + rv = func() + + if rv in ("\x00", "\xe0"): + # \x00 and \xe0 are control characters that indicate special key, + # see above. + rv += func() + + _translate_ch_to_exc(rv) + return rv + +else: + import termios + import tty + + @contextlib.contextmanager + def raw_terminal() -> cabc.Iterator[int]: + f: t.TextIO | None + fd: int + + if not isatty(sys.stdin): + f = open("/dev/tty") + fd = f.fileno() + else: + fd = sys.stdin.fileno() + f = None + + try: + old_settings = termios.tcgetattr(fd) + + try: + tty.setraw(fd) + yield fd + finally: + termios.tcsetattr(fd, termios.TCSADRAIN, old_settings) + sys.stdout.flush() + + if f is not None: + f.close() + except termios.error: + pass + + def getchar(echo: bool) -> str: + with raw_terminal() as fd: + ch = os.read(fd, 32).decode(get_best_encoding(sys.stdin), "replace") + + if echo and isatty(sys.stdout): + sys.stdout.write(ch) + + _translate_ch_to_exc(ch) + return ch diff --git a/venv/Lib/site-packages/click/_textwrap.py b/venv/Lib/site-packages/click/_textwrap.py new file mode 100644 index 0000000000000000000000000000000000000000..97fbee3dc6ce372600e702d38d9139bcf6a40bec --- /dev/null +++ b/venv/Lib/site-packages/click/_textwrap.py @@ -0,0 +1,51 @@ +from __future__ import annotations + +import collections.abc as cabc +import textwrap +from contextlib import contextmanager + + +class TextWrapper(textwrap.TextWrapper): + def _handle_long_word( + self, + reversed_chunks: list[str], + cur_line: list[str], + cur_len: int, + width: int, + ) -> None: + space_left = max(width - cur_len, 1) + + if self.break_long_words: + last = reversed_chunks[-1] + cut = last[:space_left] + res = last[space_left:] + cur_line.append(cut) + reversed_chunks[-1] = res + elif not cur_line: + cur_line.append(reversed_chunks.pop()) + + @contextmanager + def extra_indent(self, indent: str) -> cabc.Iterator[None]: + old_initial_indent = self.initial_indent + old_subsequent_indent = self.subsequent_indent + self.initial_indent += indent + self.subsequent_indent += indent + + try: + yield + finally: + self.initial_indent = old_initial_indent + self.subsequent_indent = old_subsequent_indent + + def indent_only(self, text: str) -> str: + rv = [] + + for idx, line in enumerate(text.splitlines()): + indent = self.initial_indent + + if idx > 0: + indent = self.subsequent_indent + + rv.append(f"{indent}{line}") + + return "\n".join(rv) diff --git a/venv/Lib/site-packages/click/_winconsole.py b/venv/Lib/site-packages/click/_winconsole.py new file mode 100644 index 0000000000000000000000000000000000000000..e56c7c6ae7ee7e577db6ace659cd58c0c652074c --- /dev/null +++ b/venv/Lib/site-packages/click/_winconsole.py @@ -0,0 +1,296 @@ +# This module is based on the excellent work by Adam Bartoš who +# provided a lot of what went into the implementation here in +# the discussion to issue1602 in the Python bug tracker. +# +# There are some general differences in regards to how this works +# compared to the original patches as we do not need to patch +# the entire interpreter but just work in our little world of +# echo and prompt. +from __future__ import annotations + +import collections.abc as cabc +import io +import sys +import time +import typing as t +from ctypes import Array +from ctypes import byref +from ctypes import c_char +from ctypes import c_char_p +from ctypes import c_int +from ctypes import c_ssize_t +from ctypes import c_ulong +from ctypes import c_void_p +from ctypes import POINTER +from ctypes import py_object +from ctypes import Structure +from ctypes.wintypes import DWORD +from ctypes.wintypes import HANDLE +from ctypes.wintypes import LPCWSTR +from ctypes.wintypes import LPWSTR + +from ._compat import _NonClosingTextIOWrapper + +assert sys.platform == "win32" +import msvcrt # noqa: E402 +from ctypes import windll # noqa: E402 +from ctypes import WINFUNCTYPE # noqa: E402 + +c_ssize_p = POINTER(c_ssize_t) + +kernel32 = windll.kernel32 +GetStdHandle = kernel32.GetStdHandle +ReadConsoleW = kernel32.ReadConsoleW +WriteConsoleW = kernel32.WriteConsoleW +GetConsoleMode = kernel32.GetConsoleMode +GetLastError = kernel32.GetLastError +GetCommandLineW = WINFUNCTYPE(LPWSTR)(("GetCommandLineW", windll.kernel32)) +CommandLineToArgvW = WINFUNCTYPE(POINTER(LPWSTR), LPCWSTR, POINTER(c_int))( + ("CommandLineToArgvW", windll.shell32) +) +LocalFree = WINFUNCTYPE(c_void_p, c_void_p)(("LocalFree", windll.kernel32)) + +STDIN_HANDLE = GetStdHandle(-10) +STDOUT_HANDLE = GetStdHandle(-11) +STDERR_HANDLE = GetStdHandle(-12) + +PyBUF_SIMPLE = 0 +PyBUF_WRITABLE = 1 + +ERROR_SUCCESS = 0 +ERROR_NOT_ENOUGH_MEMORY = 8 +ERROR_OPERATION_ABORTED = 995 + +STDIN_FILENO = 0 +STDOUT_FILENO = 1 +STDERR_FILENO = 2 + +EOF = b"\x1a" +MAX_BYTES_WRITTEN = 32767 + +if t.TYPE_CHECKING: + try: + # Using `typing_extensions.Buffer` instead of `collections.abc` + # on Windows for some reason does not have `Sized` implemented. + from collections.abc import Buffer # type: ignore + except ImportError: + from typing_extensions import Buffer + +try: + from ctypes import pythonapi +except ImportError: + # On PyPy we cannot get buffers so our ability to operate here is + # severely limited. + get_buffer = None +else: + + class Py_buffer(Structure): + _fields_ = [ # noqa: RUF012 + ("buf", c_void_p), + ("obj", py_object), + ("len", c_ssize_t), + ("itemsize", c_ssize_t), + ("readonly", c_int), + ("ndim", c_int), + ("format", c_char_p), + ("shape", c_ssize_p), + ("strides", c_ssize_p), + ("suboffsets", c_ssize_p), + ("internal", c_void_p), + ] + + PyObject_GetBuffer = pythonapi.PyObject_GetBuffer + PyBuffer_Release = pythonapi.PyBuffer_Release + + def get_buffer(obj: Buffer, writable: bool = False) -> Array[c_char]: + buf = Py_buffer() + flags: int = PyBUF_WRITABLE if writable else PyBUF_SIMPLE + PyObject_GetBuffer(py_object(obj), byref(buf), flags) + + try: + buffer_type = c_char * buf.len + out: Array[c_char] = buffer_type.from_address(buf.buf) + return out + finally: + PyBuffer_Release(byref(buf)) + + +class _WindowsConsoleRawIOBase(io.RawIOBase): + def __init__(self, handle: int | None) -> None: + self.handle = handle + + def isatty(self) -> t.Literal[True]: + super().isatty() + return True + + +class _WindowsConsoleReader(_WindowsConsoleRawIOBase): + def readable(self) -> t.Literal[True]: + return True + + def readinto(self, b: Buffer) -> int: + bytes_to_be_read = len(b) + if not bytes_to_be_read: + return 0 + elif bytes_to_be_read % 2: + raise ValueError( + "cannot read odd number of bytes from UTF-16-LE encoded console" + ) + + buffer = get_buffer(b, writable=True) + code_units_to_be_read = bytes_to_be_read // 2 + code_units_read = c_ulong() + + rv = ReadConsoleW( + HANDLE(self.handle), + buffer, + code_units_to_be_read, + byref(code_units_read), + None, + ) + if GetLastError() == ERROR_OPERATION_ABORTED: + # wait for KeyboardInterrupt + time.sleep(0.1) + if not rv: + raise OSError(f"Windows error: {GetLastError()}") + + if buffer[0] == EOF: + return 0 + return 2 * code_units_read.value + + +class _WindowsConsoleWriter(_WindowsConsoleRawIOBase): + def writable(self) -> t.Literal[True]: + return True + + @staticmethod + def _get_error_message(errno: int) -> str: + if errno == ERROR_SUCCESS: + return "ERROR_SUCCESS" + elif errno == ERROR_NOT_ENOUGH_MEMORY: + return "ERROR_NOT_ENOUGH_MEMORY" + return f"Windows error {errno}" + + def write(self, b: Buffer) -> int: + bytes_to_be_written = len(b) + buf = get_buffer(b) + code_units_to_be_written = min(bytes_to_be_written, MAX_BYTES_WRITTEN) // 2 + code_units_written = c_ulong() + + WriteConsoleW( + HANDLE(self.handle), + buf, + code_units_to_be_written, + byref(code_units_written), + None, + ) + bytes_written = 2 * code_units_written.value + + if bytes_written == 0 and bytes_to_be_written > 0: + raise OSError(self._get_error_message(GetLastError())) + return bytes_written + + +class ConsoleStream: + def __init__(self, text_stream: t.TextIO, byte_stream: t.BinaryIO) -> None: + self._text_stream = text_stream + self.buffer = byte_stream + + @property + def name(self) -> str: + return self.buffer.name + + def write(self, x: t.AnyStr) -> int: + if isinstance(x, str): + return self._text_stream.write(x) + try: + self.flush() + except Exception: + pass + return self.buffer.write(x) + + def writelines(self, lines: cabc.Iterable[t.AnyStr]) -> None: + for line in lines: + self.write(line) + + def __getattr__(self, name: str) -> t.Any: + return getattr(self._text_stream, name) + + def isatty(self) -> bool: + return self.buffer.isatty() + + def __repr__(self) -> str: + return f"" + + +def _get_text_stdin(buffer_stream: t.BinaryIO) -> t.TextIO: + text_stream = _NonClosingTextIOWrapper( + io.BufferedReader(_WindowsConsoleReader(STDIN_HANDLE)), + "utf-16-le", + "strict", + line_buffering=True, + ) + return t.cast(t.TextIO, ConsoleStream(text_stream, buffer_stream)) + + +def _get_text_stdout(buffer_stream: t.BinaryIO) -> t.TextIO: + text_stream = _NonClosingTextIOWrapper( + io.BufferedWriter(_WindowsConsoleWriter(STDOUT_HANDLE)), + "utf-16-le", + "strict", + line_buffering=True, + ) + return t.cast(t.TextIO, ConsoleStream(text_stream, buffer_stream)) + + +def _get_text_stderr(buffer_stream: t.BinaryIO) -> t.TextIO: + text_stream = _NonClosingTextIOWrapper( + io.BufferedWriter(_WindowsConsoleWriter(STDERR_HANDLE)), + "utf-16-le", + "strict", + line_buffering=True, + ) + return t.cast(t.TextIO, ConsoleStream(text_stream, buffer_stream)) + + +_stream_factories: cabc.Mapping[int, t.Callable[[t.BinaryIO], t.TextIO]] = { + 0: _get_text_stdin, + 1: _get_text_stdout, + 2: _get_text_stderr, +} + + +def _is_console(f: t.TextIO) -> bool: + if not hasattr(f, "fileno"): + return False + + try: + fileno = f.fileno() + except (OSError, io.UnsupportedOperation): + return False + + handle = msvcrt.get_osfhandle(fileno) + return bool(GetConsoleMode(handle, byref(DWORD()))) + + +def _get_windows_console_stream( + f: t.TextIO, encoding: str | None, errors: str | None +) -> t.TextIO | None: + if ( + get_buffer is None + or encoding not in {"utf-16-le", None} + or errors not in {"strict", None} + or not _is_console(f) + ): + return None + + func = _stream_factories.get(f.fileno()) + if func is None: + return None + + b = getattr(f, "buffer", None) + + if b is None: + return None + + return func(b) diff --git a/venv/Lib/site-packages/click/core.py b/venv/Lib/site-packages/click/core.py new file mode 100644 index 0000000000000000000000000000000000000000..f57ada62b195fa533387b5d06b366b17edb7d2f4 --- /dev/null +++ b/venv/Lib/site-packages/click/core.py @@ -0,0 +1,3135 @@ +from __future__ import annotations + +import collections.abc as cabc +import enum +import errno +import inspect +import os +import sys +import typing as t +from collections import abc +from collections import Counter +from contextlib import AbstractContextManager +from contextlib import contextmanager +from contextlib import ExitStack +from functools import update_wrapper +from gettext import gettext as _ +from gettext import ngettext +from itertools import repeat +from types import TracebackType + +from . import types +from .exceptions import Abort +from .exceptions import BadParameter +from .exceptions import ClickException +from .exceptions import Exit +from .exceptions import MissingParameter +from .exceptions import NoArgsIsHelpError +from .exceptions import UsageError +from .formatting import HelpFormatter +from .formatting import join_options +from .globals import pop_context +from .globals import push_context +from .parser import _flag_needs_value +from .parser import _OptionParser +from .parser import _split_opt +from .termui import confirm +from .termui import prompt +from .termui import style +from .utils import _detect_program_name +from .utils import _expand_args +from .utils import echo +from .utils import make_default_short_help +from .utils import make_str +from .utils import PacifyFlushWrapper + +if t.TYPE_CHECKING: + from .shell_completion import CompletionItem + +F = t.TypeVar("F", bound="t.Callable[..., t.Any]") +V = t.TypeVar("V") + + +def _complete_visible_commands( + ctx: Context, incomplete: str +) -> cabc.Iterator[tuple[str, Command]]: + """List all the subcommands of a group that start with the + incomplete value and aren't hidden. + + :param ctx: Invocation context for the group. + :param incomplete: Value being completed. May be empty. + """ + multi = t.cast(Group, ctx.command) + + for name in multi.list_commands(ctx): + if name.startswith(incomplete): + command = multi.get_command(ctx, name) + + if command is not None and not command.hidden: + yield name, command + + +def _check_nested_chain( + base_command: Group, cmd_name: str, cmd: Command, register: bool = False +) -> None: + if not base_command.chain or not isinstance(cmd, Group): + return + + if register: + message = ( + f"It is not possible to add the group {cmd_name!r} to another" + f" group {base_command.name!r} that is in chain mode." + ) + else: + message = ( + f"Found the group {cmd_name!r} as subcommand to another group " + f" {base_command.name!r} that is in chain mode. This is not supported." + ) + + raise RuntimeError(message) + + +def batch(iterable: cabc.Iterable[V], batch_size: int) -> list[tuple[V, ...]]: + return list(zip(*repeat(iter(iterable), batch_size), strict=False)) + + +@contextmanager +def augment_usage_errors( + ctx: Context, param: Parameter | None = None +) -> cabc.Iterator[None]: + """Context manager that attaches extra information to exceptions.""" + try: + yield + except BadParameter as e: + if e.ctx is None: + e.ctx = ctx + if param is not None and e.param is None: + e.param = param + raise + except UsageError as e: + if e.ctx is None: + e.ctx = ctx + raise + + +def iter_params_for_processing( + invocation_order: cabc.Sequence[Parameter], + declaration_order: cabc.Sequence[Parameter], +) -> list[Parameter]: + """Returns all declared parameters in the order they should be processed. + + The declared parameters are re-shuffled depending on the order in which + they were invoked, as well as the eagerness of each parameters. + + The invocation order takes precedence over the declaration order. I.e. the + order in which the user provided them to the CLI is respected. + + This behavior and its effect on callback evaluation is detailed at: + https://click.palletsprojects.com/en/stable/advanced/#callback-evaluation-order + """ + + def sort_key(item: Parameter) -> tuple[bool, float]: + try: + idx: float = invocation_order.index(item) + except ValueError: + idx = float("inf") + + return not item.is_eager, idx + + return sorted(declaration_order, key=sort_key) + + +class ParameterSource(enum.Enum): + """This is an :class:`~enum.Enum` that indicates the source of a + parameter's value. + + Use :meth:`click.Context.get_parameter_source` to get the + source for a parameter by name. + + .. versionchanged:: 8.0 + Use :class:`~enum.Enum` and drop the ``validate`` method. + + .. versionchanged:: 8.0 + Added the ``PROMPT`` value. + """ + + COMMANDLINE = enum.auto() + """The value was provided by the command line args.""" + ENVIRONMENT = enum.auto() + """The value was provided with an environment variable.""" + DEFAULT = enum.auto() + """Used the default specified by the parameter.""" + DEFAULT_MAP = enum.auto() + """Used a default provided by :attr:`Context.default_map`.""" + PROMPT = enum.auto() + """Used a prompt to confirm a default or provide a value.""" + + +class Context: + """The context is a special internal object that holds state relevant + for the script execution at every single level. It's normally invisible + to commands unless they opt-in to getting access to it. + + The context is useful as it can pass internal objects around and can + control special execution features such as reading data from + environment variables. + + A context can be used as context manager in which case it will call + :meth:`close` on teardown. + + :param command: the command class for this context. + :param parent: the parent context. + :param info_name: the info name for this invocation. Generally this + is the most descriptive name for the script or + command. For the toplevel script it is usually + the name of the script, for commands below it it's + the name of the script. + :param obj: an arbitrary object of user data. + :param auto_envvar_prefix: the prefix to use for automatic environment + variables. If this is `None` then reading + from environment variables is disabled. This + does not affect manually set environment + variables which are always read. + :param default_map: a dictionary (like object) with default values + for parameters. + :param terminal_width: the width of the terminal. The default is + inherit from parent context. If no context + defines the terminal width then auto + detection will be applied. + :param max_content_width: the maximum width for content rendered by + Click (this currently only affects help + pages). This defaults to 80 characters if + not overridden. In other words: even if the + terminal is larger than that, Click will not + format things wider than 80 characters by + default. In addition to that, formatters might + add some safety mapping on the right. + :param resilient_parsing: if this flag is enabled then Click will + parse without any interactivity or callback + invocation. Default values will also be + ignored. This is useful for implementing + things such as completion support. + :param allow_extra_args: if this is set to `True` then extra arguments + at the end will not raise an error and will be + kept on the context. The default is to inherit + from the command. + :param allow_interspersed_args: if this is set to `False` then options + and arguments cannot be mixed. The + default is to inherit from the command. + :param ignore_unknown_options: instructs click to ignore options it does + not know and keeps them for later + processing. + :param help_option_names: optionally a list of strings that define how + the default help parameter is named. The + default is ``['--help']``. + :param token_normalize_func: an optional function that is used to + normalize tokens (options, choices, + etc.). This for instance can be used to + implement case insensitive behavior. + :param color: controls if the terminal supports ANSI colors or not. The + default is autodetection. This is only needed if ANSI + codes are used in texts that Click prints which is by + default not the case. This for instance would affect + help output. + :param show_default: Show the default value for commands. If this + value is not set, it defaults to the value from the parent + context. ``Command.show_default`` overrides this default for the + specific command. + + .. versionchanged:: 8.2 + The ``protected_args`` attribute is deprecated and will be removed in + Click 9.0. ``args`` will contain remaining unparsed tokens. + + .. versionchanged:: 8.1 + The ``show_default`` parameter is overridden by + ``Command.show_default``, instead of the other way around. + + .. versionchanged:: 8.0 + The ``show_default`` parameter defaults to the value from the + parent context. + + .. versionchanged:: 7.1 + Added the ``show_default`` parameter. + + .. versionchanged:: 4.0 + Added the ``color``, ``ignore_unknown_options``, and + ``max_content_width`` parameters. + + .. versionchanged:: 3.0 + Added the ``allow_extra_args`` and ``allow_interspersed_args`` + parameters. + + .. versionchanged:: 2.0 + Added the ``resilient_parsing``, ``help_option_names``, and + ``token_normalize_func`` parameters. + """ + + #: The formatter class to create with :meth:`make_formatter`. + #: + #: .. versionadded:: 8.0 + formatter_class: type[HelpFormatter] = HelpFormatter + + def __init__( + self, + command: Command, + parent: Context | None = None, + info_name: str | None = None, + obj: t.Any | None = None, + auto_envvar_prefix: str | None = None, + default_map: cabc.MutableMapping[str, t.Any] | None = None, + terminal_width: int | None = None, + max_content_width: int | None = None, + resilient_parsing: bool = False, + allow_extra_args: bool | None = None, + allow_interspersed_args: bool | None = None, + ignore_unknown_options: bool | None = None, + help_option_names: list[str] | None = None, + token_normalize_func: t.Callable[[str], str] | None = None, + color: bool | None = None, + show_default: bool | None = None, + ) -> None: + #: the parent context or `None` if none exists. + self.parent = parent + #: the :class:`Command` for this context. + self.command = command + #: the descriptive information name + self.info_name = info_name + #: Map of parameter names to their parsed values. Parameters + #: with ``expose_value=False`` are not stored. + self.params: dict[str, t.Any] = {} + #: the leftover arguments. + self.args: list[str] = [] + #: protected arguments. These are arguments that are prepended + #: to `args` when certain parsing scenarios are encountered but + #: must be never propagated to another arguments. This is used + #: to implement nested parsing. + self._protected_args: list[str] = [] + #: the collected prefixes of the command's options. + self._opt_prefixes: set[str] = set(parent._opt_prefixes) if parent else set() + + if obj is None and parent is not None: + obj = parent.obj + + #: the user object stored. + self.obj: t.Any = obj + self._meta: dict[str, t.Any] = getattr(parent, "meta", {}) + + #: A dictionary (-like object) with defaults for parameters. + if ( + default_map is None + and info_name is not None + and parent is not None + and parent.default_map is not None + ): + default_map = parent.default_map.get(info_name) + + self.default_map: cabc.MutableMapping[str, t.Any] | None = default_map + + #: This flag indicates if a subcommand is going to be executed. A + #: group callback can use this information to figure out if it's + #: being executed directly or because the execution flow passes + #: onwards to a subcommand. By default it's None, but it can be + #: the name of the subcommand to execute. + #: + #: If chaining is enabled this will be set to ``'*'`` in case + #: any commands are executed. It is however not possible to + #: figure out which ones. If you require this knowledge you + #: should use a :func:`result_callback`. + self.invoked_subcommand: str | None = None + + if terminal_width is None and parent is not None: + terminal_width = parent.terminal_width + + #: The width of the terminal (None is autodetection). + self.terminal_width: int | None = terminal_width + + if max_content_width is None and parent is not None: + max_content_width = parent.max_content_width + + #: The maximum width of formatted content (None implies a sensible + #: default which is 80 for most things). + self.max_content_width: int | None = max_content_width + + if allow_extra_args is None: + allow_extra_args = command.allow_extra_args + + #: Indicates if the context allows extra args or if it should + #: fail on parsing. + #: + #: .. versionadded:: 3.0 + self.allow_extra_args = allow_extra_args + + if allow_interspersed_args is None: + allow_interspersed_args = command.allow_interspersed_args + + #: Indicates if the context allows mixing of arguments and + #: options or not. + #: + #: .. versionadded:: 3.0 + self.allow_interspersed_args: bool = allow_interspersed_args + + if ignore_unknown_options is None: + ignore_unknown_options = command.ignore_unknown_options + + #: Instructs click to ignore options that a command does not + #: understand and will store it on the context for later + #: processing. This is primarily useful for situations where you + #: want to call into external programs. Generally this pattern is + #: strongly discouraged because it's not possibly to losslessly + #: forward all arguments. + #: + #: .. versionadded:: 4.0 + self.ignore_unknown_options: bool = ignore_unknown_options + + if help_option_names is None: + if parent is not None: + help_option_names = parent.help_option_names + else: + help_option_names = ["--help"] + + #: The names for the help options. + self.help_option_names: list[str] = help_option_names + + if token_normalize_func is None and parent is not None: + token_normalize_func = parent.token_normalize_func + + #: An optional normalization function for tokens. This is + #: options, choices, commands etc. + self.token_normalize_func: t.Callable[[str], str] | None = token_normalize_func + + #: Indicates if resilient parsing is enabled. In that case Click + #: will do its best to not cause any failures and default values + #: will be ignored. Useful for completion. + self.resilient_parsing: bool = resilient_parsing + + # If there is no envvar prefix yet, but the parent has one and + # the command on this level has a name, we can expand the envvar + # prefix automatically. + if auto_envvar_prefix is None: + if ( + parent is not None + and parent.auto_envvar_prefix is not None + and self.info_name is not None + ): + auto_envvar_prefix = ( + f"{parent.auto_envvar_prefix}_{self.info_name.upper()}" + ) + else: + auto_envvar_prefix = auto_envvar_prefix.upper() + + if auto_envvar_prefix is not None: + auto_envvar_prefix = auto_envvar_prefix.replace("-", "_") + + self.auto_envvar_prefix: str | None = auto_envvar_prefix + + if color is None and parent is not None: + color = parent.color + + #: Controls if styling output is wanted or not. + self.color: bool | None = color + + if show_default is None and parent is not None: + show_default = parent.show_default + + #: Show option default values when formatting help text. + self.show_default: bool | None = show_default + + self._close_callbacks: list[t.Callable[[], t.Any]] = [] + self._depth = 0 + self._parameter_source: dict[str, ParameterSource] = {} + self._exit_stack = ExitStack() + + @property + def protected_args(self) -> list[str]: + import warnings + + warnings.warn( + "'protected_args' is deprecated and will be removed in Click 9.0." + " 'args' will contain remaining unparsed tokens.", + DeprecationWarning, + stacklevel=2, + ) + return self._protected_args + + def to_info_dict(self) -> dict[str, t.Any]: + """Gather information that could be useful for a tool generating + user-facing documentation. This traverses the entire CLI + structure. + + .. code-block:: python + + with Context(cli) as ctx: + info = ctx.to_info_dict() + + .. versionadded:: 8.0 + """ + return { + "command": self.command.to_info_dict(self), + "info_name": self.info_name, + "allow_extra_args": self.allow_extra_args, + "allow_interspersed_args": self.allow_interspersed_args, + "ignore_unknown_options": self.ignore_unknown_options, + "auto_envvar_prefix": self.auto_envvar_prefix, + } + + def __enter__(self) -> Context: + self._depth += 1 + push_context(self) + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_value: BaseException | None, + tb: TracebackType | None, + ) -> None: + self._depth -= 1 + if self._depth == 0: + self.close() + pop_context() + + @contextmanager + def scope(self, cleanup: bool = True) -> cabc.Iterator[Context]: + """This helper method can be used with the context object to promote + it to the current thread local (see :func:`get_current_context`). + The default behavior of this is to invoke the cleanup functions which + can be disabled by setting `cleanup` to `False`. The cleanup + functions are typically used for things such as closing file handles. + + If the cleanup is intended the context object can also be directly + used as a context manager. + + Example usage:: + + with ctx.scope(): + assert get_current_context() is ctx + + This is equivalent:: + + with ctx: + assert get_current_context() is ctx + + .. versionadded:: 5.0 + + :param cleanup: controls if the cleanup functions should be run or + not. The default is to run these functions. In + some situations the context only wants to be + temporarily pushed in which case this can be disabled. + Nested pushes automatically defer the cleanup. + """ + if not cleanup: + self._depth += 1 + try: + with self as rv: + yield rv + finally: + if not cleanup: + self._depth -= 1 + + @property + def meta(self) -> dict[str, t.Any]: + """This is a dictionary which is shared with all the contexts + that are nested. It exists so that click utilities can store some + state here if they need to. It is however the responsibility of + that code to manage this dictionary well. + + The keys are supposed to be unique dotted strings. For instance + module paths are a good choice for it. What is stored in there is + irrelevant for the operation of click. However what is important is + that code that places data here adheres to the general semantics of + the system. + + Example usage:: + + LANG_KEY = f'{__name__}.lang' + + def set_language(value): + ctx = get_current_context() + ctx.meta[LANG_KEY] = value + + def get_language(): + return get_current_context().meta.get(LANG_KEY, 'en_US') + + .. versionadded:: 5.0 + """ + return self._meta + + def make_formatter(self) -> HelpFormatter: + """Creates the :class:`~click.HelpFormatter` for the help and + usage output. + + To quickly customize the formatter class used without overriding + this method, set the :attr:`formatter_class` attribute. + + .. versionchanged:: 8.0 + Added the :attr:`formatter_class` attribute. + """ + return self.formatter_class( + width=self.terminal_width, max_width=self.max_content_width + ) + + def with_resource(self, context_manager: AbstractContextManager[V]) -> V: + """Register a resource as if it were used in a ``with`` + statement. The resource will be cleaned up when the context is + popped. + + Uses :meth:`contextlib.ExitStack.enter_context`. It calls the + resource's ``__enter__()`` method and returns the result. When + the context is popped, it closes the stack, which calls the + resource's ``__exit__()`` method. + + To register a cleanup function for something that isn't a + context manager, use :meth:`call_on_close`. Or use something + from :mod:`contextlib` to turn it into a context manager first. + + .. code-block:: python + + @click.group() + @click.option("--name") + @click.pass_context + def cli(ctx): + ctx.obj = ctx.with_resource(connect_db(name)) + + :param context_manager: The context manager to enter. + :return: Whatever ``context_manager.__enter__()`` returns. + + .. versionadded:: 8.0 + """ + return self._exit_stack.enter_context(context_manager) + + def call_on_close(self, f: t.Callable[..., t.Any]) -> t.Callable[..., t.Any]: + """Register a function to be called when the context tears down. + + This can be used to close resources opened during the script + execution. Resources that support Python's context manager + protocol which would be used in a ``with`` statement should be + registered with :meth:`with_resource` instead. + + :param f: The function to execute on teardown. + """ + return self._exit_stack.callback(f) + + def close(self) -> None: + """Invoke all close callbacks registered with + :meth:`call_on_close`, and exit all context managers entered + with :meth:`with_resource`. + """ + self._exit_stack.close() + # In case the context is reused, create a new exit stack. + self._exit_stack = ExitStack() + + @property + def command_path(self) -> str: + """The computed command path. This is used for the ``usage`` + information on the help page. It's automatically created by + combining the info names of the chain of contexts to the root. + """ + rv = "" + if self.info_name is not None: + rv = self.info_name + if self.parent is not None: + parent_command_path = [self.parent.command_path] + + if isinstance(self.parent.command, Command): + for param in self.parent.command.get_params(self): + parent_command_path.extend(param.get_usage_pieces(self)) + + rv = f"{' '.join(parent_command_path)} {rv}" + return rv.lstrip() + + def find_root(self) -> Context: + """Finds the outermost context.""" + node = self + while node.parent is not None: + node = node.parent + return node + + def find_object(self, object_type: type[V]) -> V | None: + """Finds the closest object of a given type.""" + node: Context | None = self + + while node is not None: + if isinstance(node.obj, object_type): + return node.obj + + node = node.parent + + return None + + def ensure_object(self, object_type: type[V]) -> V: + """Like :meth:`find_object` but sets the innermost object to a + new instance of `object_type` if it does not exist. + """ + rv = self.find_object(object_type) + if rv is None: + self.obj = rv = object_type() + return rv + + @t.overload + def lookup_default( + self, name: str, call: t.Literal[True] = True + ) -> t.Any | None: ... + + @t.overload + def lookup_default( + self, name: str, call: t.Literal[False] = ... + ) -> t.Any | t.Callable[[], t.Any] | None: ... + + def lookup_default(self, name: str, call: bool = True) -> t.Any | None: + """Get the default for a parameter from :attr:`default_map`. + + :param name: Name of the parameter. + :param call: If the default is a callable, call it. Disable to + return the callable instead. + + .. versionchanged:: 8.0 + Added the ``call`` parameter. + """ + if self.default_map is not None: + value = self.default_map.get(name) + + if call and callable(value): + return value() + + return value + + return None + + def fail(self, message: str) -> t.NoReturn: + """Aborts the execution of the program with a specific error + message. + + :param message: the error message to fail with. + """ + raise UsageError(message, self) + + def abort(self) -> t.NoReturn: + """Aborts the script.""" + raise Abort() + + def exit(self, code: int = 0) -> t.NoReturn: + """Exits the application with a given exit code. + + .. versionchanged:: 8.2 + Callbacks and context managers registered with :meth:`call_on_close` + and :meth:`with_resource` are closed before exiting. + """ + self.close() + raise Exit(code) + + def get_usage(self) -> str: + """Helper method to get formatted usage string for the current + context and command. + """ + return self.command.get_usage(self) + + def get_help(self) -> str: + """Helper method to get formatted help page for the current + context and command. + """ + return self.command.get_help(self) + + def _make_sub_context(self, command: Command) -> Context: + """Create a new context of the same type as this context, but + for a new command. + + :meta private: + """ + return type(self)(command, info_name=command.name, parent=self) + + @t.overload + def invoke( + self, callback: t.Callable[..., V], /, *args: t.Any, **kwargs: t.Any + ) -> V: ... + + @t.overload + def invoke(self, callback: Command, /, *args: t.Any, **kwargs: t.Any) -> t.Any: ... + + def invoke( + self, callback: Command | t.Callable[..., V], /, *args: t.Any, **kwargs: t.Any + ) -> t.Any | V: + """Invokes a command callback in exactly the way it expects. There + are two ways to invoke this method: + + 1. the first argument can be a callback and all other arguments and + keyword arguments are forwarded directly to the function. + 2. the first argument is a click command object. In that case all + arguments are forwarded as well but proper click parameters + (options and click arguments) must be keyword arguments and Click + will fill in defaults. + + .. versionchanged:: 8.0 + All ``kwargs`` are tracked in :attr:`params` so they will be + passed if :meth:`forward` is called at multiple levels. + + .. versionchanged:: 3.2 + A new context is created, and missing arguments use default values. + """ + if isinstance(callback, Command): + other_cmd = callback + + if other_cmd.callback is None: + raise TypeError( + "The given command does not have a callback that can be invoked." + ) + else: + callback = t.cast("t.Callable[..., V]", other_cmd.callback) + + ctx = self._make_sub_context(other_cmd) + + for param in other_cmd.params: + if param.name not in kwargs and param.expose_value: + kwargs[param.name] = param.type_cast_value( # type: ignore + ctx, param.get_default(ctx) + ) + + # Track all kwargs as params, so that forward() will pass + # them on in subsequent calls. + ctx.params.update(kwargs) + else: + ctx = self + + with augment_usage_errors(self): + with ctx: + return callback(*args, **kwargs) + + def forward(self, cmd: Command, /, *args: t.Any, **kwargs: t.Any) -> t.Any: + """Similar to :meth:`invoke` but fills in default keyword + arguments from the current context if the other command expects + it. This cannot invoke callbacks directly, only other commands. + + .. versionchanged:: 8.0 + All ``kwargs`` are tracked in :attr:`params` so they will be + passed if ``forward`` is called at multiple levels. + """ + # Can only forward to other commands, not direct callbacks. + if not isinstance(cmd, Command): + raise TypeError("Callback is not a command.") + + for param in self.params: + if param not in kwargs: + kwargs[param] = self.params[param] + + return self.invoke(cmd, *args, **kwargs) + + def set_parameter_source(self, name: str, source: ParameterSource) -> None: + """Set the source of a parameter. This indicates the location + from which the value of the parameter was obtained. + + :param name: The name of the parameter. + :param source: A member of :class:`~click.core.ParameterSource`. + """ + self._parameter_source[name] = source + + def get_parameter_source(self, name: str) -> ParameterSource | None: + """Get the source of a parameter. This indicates the location + from which the value of the parameter was obtained. + + This can be useful for determining when a user specified a value + on the command line that is the same as the default value. It + will be :attr:`~click.core.ParameterSource.DEFAULT` only if the + value was actually taken from the default. + + :param name: The name of the parameter. + :rtype: ParameterSource + + .. versionchanged:: 8.0 + Returns ``None`` if the parameter was not provided from any + source. + """ + return self._parameter_source.get(name) + + +class Command: + """Commands are the basic building block of command line interfaces in + Click. A basic command handles command line parsing and might dispatch + more parsing to commands nested below it. + + :param name: the name of the command to use unless a group overrides it. + :param context_settings: an optional dictionary with defaults that are + passed to the context object. + :param callback: the callback to invoke. This is optional. + :param params: the parameters to register with this command. This can + be either :class:`Option` or :class:`Argument` objects. + :param help: the help string to use for this command. + :param epilog: like the help string but it's printed at the end of the + help page after everything else. + :param short_help: the short help to use for this command. This is + shown on the command listing of the parent command. + :param add_help_option: by default each command registers a ``--help`` + option. This can be disabled by this parameter. + :param no_args_is_help: this controls what happens if no arguments are + provided. This option is disabled by default. + If enabled this will add ``--help`` as argument + if no arguments are passed + :param hidden: hide this command from help outputs. + :param deprecated: If ``True`` or non-empty string, issues a message + indicating that the command is deprecated and highlights + its deprecation in --help. The message can be customized + by using a string as the value. + + .. versionchanged:: 8.2 + This is the base class for all commands, not ``BaseCommand``. + ``deprecated`` can be set to a string as well to customize the + deprecation message. + + .. versionchanged:: 8.1 + ``help``, ``epilog``, and ``short_help`` are stored unprocessed, + all formatting is done when outputting help text, not at init, + and is done even if not using the ``@command`` decorator. + + .. versionchanged:: 8.0 + Added a ``repr`` showing the command name. + + .. versionchanged:: 7.1 + Added the ``no_args_is_help`` parameter. + + .. versionchanged:: 2.0 + Added the ``context_settings`` parameter. + """ + + #: The context class to create with :meth:`make_context`. + #: + #: .. versionadded:: 8.0 + context_class: type[Context] = Context + + #: the default for the :attr:`Context.allow_extra_args` flag. + allow_extra_args = False + + #: the default for the :attr:`Context.allow_interspersed_args` flag. + allow_interspersed_args = True + + #: the default for the :attr:`Context.ignore_unknown_options` flag. + ignore_unknown_options = False + + def __init__( + self, + name: str | None, + context_settings: cabc.MutableMapping[str, t.Any] | None = None, + callback: t.Callable[..., t.Any] | None = None, + params: list[Parameter] | None = None, + help: str | None = None, + epilog: str | None = None, + short_help: str | None = None, + options_metavar: str | None = "[OPTIONS]", + add_help_option: bool = True, + no_args_is_help: bool = False, + hidden: bool = False, + deprecated: bool | str = False, + ) -> None: + #: the name the command thinks it has. Upon registering a command + #: on a :class:`Group` the group will default the command name + #: with this information. You should instead use the + #: :class:`Context`\'s :attr:`~Context.info_name` attribute. + self.name = name + + if context_settings is None: + context_settings = {} + + #: an optional dictionary with defaults passed to the context. + self.context_settings: cabc.MutableMapping[str, t.Any] = context_settings + + #: the callback to execute when the command fires. This might be + #: `None` in which case nothing happens. + self.callback = callback + #: the list of parameters for this command in the order they + #: should show up in the help page and execute. Eager parameters + #: will automatically be handled before non eager ones. + self.params: list[Parameter] = params or [] + self.help = help + self.epilog = epilog + self.options_metavar = options_metavar + self.short_help = short_help + self.add_help_option = add_help_option + self._help_option = None + self.no_args_is_help = no_args_is_help + self.hidden = hidden + self.deprecated = deprecated + + def to_info_dict(self, ctx: Context) -> dict[str, t.Any]: + return { + "name": self.name, + "params": [param.to_info_dict() for param in self.get_params(ctx)], + "help": self.help, + "epilog": self.epilog, + "short_help": self.short_help, + "hidden": self.hidden, + "deprecated": self.deprecated, + } + + def __repr__(self) -> str: + return f"<{self.__class__.__name__} {self.name}>" + + def get_usage(self, ctx: Context) -> str: + """Formats the usage line into a string and returns it. + + Calls :meth:`format_usage` internally. + """ + formatter = ctx.make_formatter() + self.format_usage(ctx, formatter) + return formatter.getvalue().rstrip("\n") + + def get_params(self, ctx: Context) -> list[Parameter]: + params = self.params + help_option = self.get_help_option(ctx) + + if help_option is not None: + params = [*params, help_option] + + if __debug__: + import warnings + + opts = [opt for param in params for opt in param.opts] + opts_counter = Counter(opts) + duplicate_opts = (opt for opt, count in opts_counter.items() if count > 1) + + for duplicate_opt in duplicate_opts: + warnings.warn( + ( + f"The parameter {duplicate_opt} is used more than once. " + "Remove its duplicate as parameters should be unique." + ), + stacklevel=3, + ) + + return params + + def format_usage(self, ctx: Context, formatter: HelpFormatter) -> None: + """Writes the usage line into the formatter. + + This is a low-level method called by :meth:`get_usage`. + """ + pieces = self.collect_usage_pieces(ctx) + formatter.write_usage(ctx.command_path, " ".join(pieces)) + + def collect_usage_pieces(self, ctx: Context) -> list[str]: + """Returns all the pieces that go into the usage line and returns + it as a list of strings. + """ + rv = [self.options_metavar] if self.options_metavar else [] + + for param in self.get_params(ctx): + rv.extend(param.get_usage_pieces(ctx)) + + return rv + + def get_help_option_names(self, ctx: Context) -> list[str]: + """Returns the names for the help option.""" + all_names = set(ctx.help_option_names) + for param in self.params: + all_names.difference_update(param.opts) + all_names.difference_update(param.secondary_opts) + return list(all_names) + + def get_help_option(self, ctx: Context) -> Option | None: + """Returns the help option object. + + Skipped if :attr:`add_help_option` is ``False``. + + .. versionchanged:: 8.1.8 + The help option is now cached to avoid creating it multiple times. + """ + help_option_names = self.get_help_option_names(ctx) + + if not help_option_names or not self.add_help_option: + return None + + # Cache the help option object in private _help_option attribute to + # avoid creating it multiple times. Not doing this will break the + # callback odering by iter_params_for_processing(), which relies on + # object comparison. + if self._help_option is None: + # Avoid circular import. + from .decorators import help_option + + # Apply help_option decorator and pop resulting option + help_option(*help_option_names)(self) + self._help_option = self.params.pop() # type: ignore[assignment] + + return self._help_option + + def make_parser(self, ctx: Context) -> _OptionParser: + """Creates the underlying option parser for this command.""" + parser = _OptionParser(ctx) + for param in self.get_params(ctx): + param.add_to_parser(parser, ctx) + return parser + + def get_help(self, ctx: Context) -> str: + """Formats the help into a string and returns it. + + Calls :meth:`format_help` internally. + """ + formatter = ctx.make_formatter() + self.format_help(ctx, formatter) + return formatter.getvalue().rstrip("\n") + + def get_short_help_str(self, limit: int = 45) -> str: + """Gets short help for the command or makes it by shortening the + long help string. + """ + if self.short_help: + text = inspect.cleandoc(self.short_help) + elif self.help: + text = make_default_short_help(self.help, limit) + else: + text = "" + + if self.deprecated: + deprecated_message = ( + f"(DEPRECATED: {self.deprecated})" + if isinstance(self.deprecated, str) + else "(DEPRECATED)" + ) + text = _("{text} {deprecated_message}").format( + text=text, deprecated_message=deprecated_message + ) + + return text.strip() + + def format_help(self, ctx: Context, formatter: HelpFormatter) -> None: + """Writes the help into the formatter if it exists. + + This is a low-level method called by :meth:`get_help`. + + This calls the following methods: + + - :meth:`format_usage` + - :meth:`format_help_text` + - :meth:`format_options` + - :meth:`format_epilog` + """ + self.format_usage(ctx, formatter) + self.format_help_text(ctx, formatter) + self.format_options(ctx, formatter) + self.format_epilog(ctx, formatter) + + def format_help_text(self, ctx: Context, formatter: HelpFormatter) -> None: + """Writes the help text to the formatter if it exists.""" + if self.help is not None: + # truncate the help text to the first form feed + text = inspect.cleandoc(self.help).partition("\f")[0] + else: + text = "" + + if self.deprecated: + deprecated_message = ( + f"(DEPRECATED: {self.deprecated})" + if isinstance(self.deprecated, str) + else "(DEPRECATED)" + ) + text = _("{text} {deprecated_message}").format( + text=text, deprecated_message=deprecated_message + ) + + if text: + formatter.write_paragraph() + + with formatter.indentation(): + formatter.write_text(text) + + def format_options(self, ctx: Context, formatter: HelpFormatter) -> None: + """Writes all the options into the formatter if they exist.""" + opts = [] + for param in self.get_params(ctx): + rv = param.get_help_record(ctx) + if rv is not None: + opts.append(rv) + + if opts: + with formatter.section(_("Options")): + formatter.write_dl(opts) + + def format_epilog(self, ctx: Context, formatter: HelpFormatter) -> None: + """Writes the epilog into the formatter if it exists.""" + if self.epilog: + epilog = inspect.cleandoc(self.epilog) + formatter.write_paragraph() + + with formatter.indentation(): + formatter.write_text(epilog) + + def make_context( + self, + info_name: str | None, + args: list[str], + parent: Context | None = None, + **extra: t.Any, + ) -> Context: + """This function when given an info name and arguments will kick + off the parsing and create a new :class:`Context`. It does not + invoke the actual command callback though. + + To quickly customize the context class used without overriding + this method, set the :attr:`context_class` attribute. + + :param info_name: the info name for this invocation. Generally this + is the most descriptive name for the script or + command. For the toplevel script it's usually + the name of the script, for commands below it's + the name of the command. + :param args: the arguments to parse as list of strings. + :param parent: the parent context if available. + :param extra: extra keyword arguments forwarded to the context + constructor. + + .. versionchanged:: 8.0 + Added the :attr:`context_class` attribute. + """ + for key, value in self.context_settings.items(): + if key not in extra: + extra[key] = value + + ctx = self.context_class(self, info_name=info_name, parent=parent, **extra) + + with ctx.scope(cleanup=False): + self.parse_args(ctx, args) + return ctx + + def parse_args(self, ctx: Context, args: list[str]) -> list[str]: + if not args and self.no_args_is_help and not ctx.resilient_parsing: + raise NoArgsIsHelpError(ctx) + + parser = self.make_parser(ctx) + opts, args, param_order = parser.parse_args(args=args) + + for param in iter_params_for_processing(param_order, self.get_params(ctx)): + value, args = param.handle_parse_result(ctx, opts, args) + + if args and not ctx.allow_extra_args and not ctx.resilient_parsing: + ctx.fail( + ngettext( + "Got unexpected extra argument ({args})", + "Got unexpected extra arguments ({args})", + len(args), + ).format(args=" ".join(map(str, args))) + ) + + ctx.args = args + ctx._opt_prefixes.update(parser._opt_prefixes) + return args + + def invoke(self, ctx: Context) -> t.Any: + """Given a context, this invokes the attached callback (if it exists) + in the right way. + """ + if self.deprecated: + extra_message = ( + f" {self.deprecated}" if isinstance(self.deprecated, str) else "" + ) + message = _( + "DeprecationWarning: The command {name!r} is deprecated.{extra_message}" + ).format(name=self.name, extra_message=extra_message) + echo(style(message, fg="red"), err=True) + + if self.callback is not None: + return ctx.invoke(self.callback, **ctx.params) + + def shell_complete(self, ctx: Context, incomplete: str) -> list[CompletionItem]: + """Return a list of completions for the incomplete value. Looks + at the names of options and chained multi-commands. + + Any command could be part of a chained multi-command, so sibling + commands are valid at any point during command completion. + + :param ctx: Invocation context for this command. + :param incomplete: Value being completed. May be empty. + + .. versionadded:: 8.0 + """ + from click.shell_completion import CompletionItem + + results: list[CompletionItem] = [] + + if incomplete and not incomplete[0].isalnum(): + for param in self.get_params(ctx): + if ( + not isinstance(param, Option) + or param.hidden + or ( + not param.multiple + and ctx.get_parameter_source(param.name) # type: ignore + is ParameterSource.COMMANDLINE + ) + ): + continue + + results.extend( + CompletionItem(name, help=param.help) + for name in [*param.opts, *param.secondary_opts] + if name.startswith(incomplete) + ) + + while ctx.parent is not None: + ctx = ctx.parent + + if isinstance(ctx.command, Group) and ctx.command.chain: + results.extend( + CompletionItem(name, help=command.get_short_help_str()) + for name, command in _complete_visible_commands(ctx, incomplete) + if name not in ctx._protected_args + ) + + return results + + @t.overload + def main( + self, + args: cabc.Sequence[str] | None = None, + prog_name: str | None = None, + complete_var: str | None = None, + standalone_mode: t.Literal[True] = True, + **extra: t.Any, + ) -> t.NoReturn: ... + + @t.overload + def main( + self, + args: cabc.Sequence[str] | None = None, + prog_name: str | None = None, + complete_var: str | None = None, + standalone_mode: bool = ..., + **extra: t.Any, + ) -> t.Any: ... + + def main( + self, + args: cabc.Sequence[str] | None = None, + prog_name: str | None = None, + complete_var: str | None = None, + standalone_mode: bool = True, + windows_expand_args: bool = True, + **extra: t.Any, + ) -> t.Any: + """This is the way to invoke a script with all the bells and + whistles as a command line application. This will always terminate + the application after a call. If this is not wanted, ``SystemExit`` + needs to be caught. + + This method is also available by directly calling the instance of + a :class:`Command`. + + :param args: the arguments that should be used for parsing. If not + provided, ``sys.argv[1:]`` is used. + :param prog_name: the program name that should be used. By default + the program name is constructed by taking the file + name from ``sys.argv[0]``. + :param complete_var: the environment variable that controls the + bash completion support. The default is + ``"__COMPLETE"`` with prog_name in + uppercase. + :param standalone_mode: the default behavior is to invoke the script + in standalone mode. Click will then + handle exceptions and convert them into + error messages and the function will never + return but shut down the interpreter. If + this is set to `False` they will be + propagated to the caller and the return + value of this function is the return value + of :meth:`invoke`. + :param windows_expand_args: Expand glob patterns, user dir, and + env vars in command line args on Windows. + :param extra: extra keyword arguments are forwarded to the context + constructor. See :class:`Context` for more information. + + .. versionchanged:: 8.0.1 + Added the ``windows_expand_args`` parameter to allow + disabling command line arg expansion on Windows. + + .. versionchanged:: 8.0 + When taking arguments from ``sys.argv`` on Windows, glob + patterns, user dir, and env vars are expanded. + + .. versionchanged:: 3.0 + Added the ``standalone_mode`` parameter. + """ + if args is None: + args = sys.argv[1:] + + if os.name == "nt" and windows_expand_args: + args = _expand_args(args) + else: + args = list(args) + + if prog_name is None: + prog_name = _detect_program_name() + + # Process shell completion requests and exit early. + self._main_shell_completion(extra, prog_name, complete_var) + + try: + try: + with self.make_context(prog_name, args, **extra) as ctx: + rv = self.invoke(ctx) + if not standalone_mode: + return rv + # it's not safe to `ctx.exit(rv)` here! + # note that `rv` may actually contain data like "1" which + # has obvious effects + # more subtle case: `rv=[None, None]` can come out of + # chained commands which all returned `None` -- so it's not + # even always obvious that `rv` indicates success/failure + # by its truthiness/falsiness + ctx.exit() + except (EOFError, KeyboardInterrupt) as e: + echo(file=sys.stderr) + raise Abort() from e + except ClickException as e: + if not standalone_mode: + raise + e.show() + sys.exit(e.exit_code) + except OSError as e: + if e.errno == errno.EPIPE: + sys.stdout = t.cast(t.TextIO, PacifyFlushWrapper(sys.stdout)) + sys.stderr = t.cast(t.TextIO, PacifyFlushWrapper(sys.stderr)) + sys.exit(1) + else: + raise + except Exit as e: + if standalone_mode: + sys.exit(e.exit_code) + else: + # in non-standalone mode, return the exit code + # note that this is only reached if `self.invoke` above raises + # an Exit explicitly -- thus bypassing the check there which + # would return its result + # the results of non-standalone execution may therefore be + # somewhat ambiguous: if there are codepaths which lead to + # `ctx.exit(1)` and to `return 1`, the caller won't be able to + # tell the difference between the two + return e.exit_code + except Abort: + if not standalone_mode: + raise + echo(_("Aborted!"), file=sys.stderr) + sys.exit(1) + + def _main_shell_completion( + self, + ctx_args: cabc.MutableMapping[str, t.Any], + prog_name: str, + complete_var: str | None = None, + ) -> None: + """Check if the shell is asking for tab completion, process + that, then exit early. Called from :meth:`main` before the + program is invoked. + + :param prog_name: Name of the executable in the shell. + :param complete_var: Name of the environment variable that holds + the completion instruction. Defaults to + ``_{PROG_NAME}_COMPLETE``. + + .. versionchanged:: 8.2.0 + Dots (``.``) in ``prog_name`` are replaced with underscores (``_``). + """ + if complete_var is None: + complete_name = prog_name.replace("-", "_").replace(".", "_") + complete_var = f"_{complete_name}_COMPLETE".upper() + + instruction = os.environ.get(complete_var) + + if not instruction: + return + + from .shell_completion import shell_complete + + rv = shell_complete(self, ctx_args, prog_name, complete_var, instruction) + sys.exit(rv) + + def __call__(self, *args: t.Any, **kwargs: t.Any) -> t.Any: + """Alias for :meth:`main`.""" + return self.main(*args, **kwargs) + + +class _FakeSubclassCheck(type): + def __subclasscheck__(cls, subclass: type) -> bool: + return issubclass(subclass, cls.__bases__[0]) + + def __instancecheck__(cls, instance: t.Any) -> bool: + return isinstance(instance, cls.__bases__[0]) + + +class _BaseCommand(Command, metaclass=_FakeSubclassCheck): + """ + .. deprecated:: 8.2 + Will be removed in Click 9.0. Use ``Command`` instead. + """ + + +class Group(Command): + """A group is a command that nests other commands (or more groups). + + :param name: The name of the group command. + :param commands: Map names to :class:`Command` objects. Can be a list, which + will use :attr:`Command.name` as the keys. + :param invoke_without_command: Invoke the group's callback even if a + subcommand is not given. + :param no_args_is_help: If no arguments are given, show the group's help and + exit. Defaults to the opposite of ``invoke_without_command``. + :param subcommand_metavar: How to represent the subcommand argument in help. + The default will represent whether ``chain`` is set or not. + :param chain: Allow passing more than one subcommand argument. After parsing + a command's arguments, if any arguments remain another command will be + matched, and so on. + :param result_callback: A function to call after the group's and + subcommand's callbacks. The value returned by the subcommand is passed. + If ``chain`` is enabled, the value will be a list of values returned by + all the commands. If ``invoke_without_command`` is enabled, the value + will be the value returned by the group's callback, or an empty list if + ``chain`` is enabled. + :param kwargs: Other arguments passed to :class:`Command`. + + .. versionchanged:: 8.0 + The ``commands`` argument can be a list of command objects. + + .. versionchanged:: 8.2 + Merged with and replaces the ``MultiCommand`` base class. + """ + + allow_extra_args = True + allow_interspersed_args = False + + #: If set, this is used by the group's :meth:`command` decorator + #: as the default :class:`Command` class. This is useful to make all + #: subcommands use a custom command class. + #: + #: .. versionadded:: 8.0 + command_class: type[Command] | None = None + + #: If set, this is used by the group's :meth:`group` decorator + #: as the default :class:`Group` class. This is useful to make all + #: subgroups use a custom group class. + #: + #: If set to the special value :class:`type` (literally + #: ``group_class = type``), this group's class will be used as the + #: default class. This makes a custom group class continue to make + #: custom groups. + #: + #: .. versionadded:: 8.0 + group_class: type[Group] | type[type] | None = None + # Literal[type] isn't valid, so use Type[type] + + def __init__( + self, + name: str | None = None, + commands: cabc.MutableMapping[str, Command] + | cabc.Sequence[Command] + | None = None, + invoke_without_command: bool = False, + no_args_is_help: bool | None = None, + subcommand_metavar: str | None = None, + chain: bool = False, + result_callback: t.Callable[..., t.Any] | None = None, + **kwargs: t.Any, + ) -> None: + super().__init__(name, **kwargs) + + if commands is None: + commands = {} + elif isinstance(commands, abc.Sequence): + commands = {c.name: c for c in commands if c.name is not None} + + #: The registered subcommands by their exported names. + self.commands: cabc.MutableMapping[str, Command] = commands + + if no_args_is_help is None: + no_args_is_help = not invoke_without_command + + self.no_args_is_help = no_args_is_help + self.invoke_without_command = invoke_without_command + + if subcommand_metavar is None: + if chain: + subcommand_metavar = "COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]..." + else: + subcommand_metavar = "COMMAND [ARGS]..." + + self.subcommand_metavar = subcommand_metavar + self.chain = chain + # The result callback that is stored. This can be set or + # overridden with the :func:`result_callback` decorator. + self._result_callback = result_callback + + if self.chain: + for param in self.params: + if isinstance(param, Argument) and not param.required: + raise RuntimeError( + "A group in chain mode cannot have optional arguments." + ) + + def to_info_dict(self, ctx: Context) -> dict[str, t.Any]: + info_dict = super().to_info_dict(ctx) + commands = {} + + for name in self.list_commands(ctx): + command = self.get_command(ctx, name) + + if command is None: + continue + + sub_ctx = ctx._make_sub_context(command) + + with sub_ctx.scope(cleanup=False): + commands[name] = command.to_info_dict(sub_ctx) + + info_dict.update(commands=commands, chain=self.chain) + return info_dict + + def add_command(self, cmd: Command, name: str | None = None) -> None: + """Registers another :class:`Command` with this group. If the name + is not provided, the name of the command is used. + """ + name = name or cmd.name + if name is None: + raise TypeError("Command has no name.") + _check_nested_chain(self, name, cmd, register=True) + self.commands[name] = cmd + + @t.overload + def command(self, __func: t.Callable[..., t.Any]) -> Command: ... + + @t.overload + def command( + self, *args: t.Any, **kwargs: t.Any + ) -> t.Callable[[t.Callable[..., t.Any]], Command]: ... + + def command( + self, *args: t.Any, **kwargs: t.Any + ) -> t.Callable[[t.Callable[..., t.Any]], Command] | Command: + """A shortcut decorator for declaring and attaching a command to + the group. This takes the same arguments as :func:`command` and + immediately registers the created command with this group by + calling :meth:`add_command`. + + To customize the command class used, set the + :attr:`command_class` attribute. + + .. versionchanged:: 8.1 + This decorator can be applied without parentheses. + + .. versionchanged:: 8.0 + Added the :attr:`command_class` attribute. + """ + from .decorators import command + + func: t.Callable[..., t.Any] | None = None + + if args and callable(args[0]): + assert len(args) == 1 and not kwargs, ( + "Use 'command(**kwargs)(callable)' to provide arguments." + ) + (func,) = args + args = () + + if self.command_class and kwargs.get("cls") is None: + kwargs["cls"] = self.command_class + + def decorator(f: t.Callable[..., t.Any]) -> Command: + cmd: Command = command(*args, **kwargs)(f) + self.add_command(cmd) + return cmd + + if func is not None: + return decorator(func) + + return decorator + + @t.overload + def group(self, __func: t.Callable[..., t.Any]) -> Group: ... + + @t.overload + def group( + self, *args: t.Any, **kwargs: t.Any + ) -> t.Callable[[t.Callable[..., t.Any]], Group]: ... + + def group( + self, *args: t.Any, **kwargs: t.Any + ) -> t.Callable[[t.Callable[..., t.Any]], Group] | Group: + """A shortcut decorator for declaring and attaching a group to + the group. This takes the same arguments as :func:`group` and + immediately registers the created group with this group by + calling :meth:`add_command`. + + To customize the group class used, set the :attr:`group_class` + attribute. + + .. versionchanged:: 8.1 + This decorator can be applied without parentheses. + + .. versionchanged:: 8.0 + Added the :attr:`group_class` attribute. + """ + from .decorators import group + + func: t.Callable[..., t.Any] | None = None + + if args and callable(args[0]): + assert len(args) == 1 and not kwargs, ( + "Use 'group(**kwargs)(callable)' to provide arguments." + ) + (func,) = args + args = () + + if self.group_class is not None and kwargs.get("cls") is None: + if self.group_class is type: + kwargs["cls"] = type(self) + else: + kwargs["cls"] = self.group_class + + def decorator(f: t.Callable[..., t.Any]) -> Group: + cmd: Group = group(*args, **kwargs)(f) + self.add_command(cmd) + return cmd + + if func is not None: + return decorator(func) + + return decorator + + def result_callback(self, replace: bool = False) -> t.Callable[[F], F]: + """Adds a result callback to the command. By default if a + result callback is already registered this will chain them but + this can be disabled with the `replace` parameter. The result + callback is invoked with the return value of the subcommand + (or the list of return values from all subcommands if chaining + is enabled) as well as the parameters as they would be passed + to the main callback. + + Example:: + + @click.group() + @click.option('-i', '--input', default=23) + def cli(input): + return 42 + + @cli.result_callback() + def process_result(result, input): + return result + input + + :param replace: if set to `True` an already existing result + callback will be removed. + + .. versionchanged:: 8.0 + Renamed from ``resultcallback``. + + .. versionadded:: 3.0 + """ + + def decorator(f: F) -> F: + old_callback = self._result_callback + + if old_callback is None or replace: + self._result_callback = f + return f + + def function(value: t.Any, /, *args: t.Any, **kwargs: t.Any) -> t.Any: + inner = old_callback(value, *args, **kwargs) + return f(inner, *args, **kwargs) + + self._result_callback = rv = update_wrapper(t.cast(F, function), f) + return rv # type: ignore[return-value] + + return decorator + + def get_command(self, ctx: Context, cmd_name: str) -> Command | None: + """Given a context and a command name, this returns a :class:`Command` + object if it exists or returns ``None``. + """ + return self.commands.get(cmd_name) + + def list_commands(self, ctx: Context) -> list[str]: + """Returns a list of subcommand names in the order they should appear.""" + return sorted(self.commands) + + def collect_usage_pieces(self, ctx: Context) -> list[str]: + rv = super().collect_usage_pieces(ctx) + rv.append(self.subcommand_metavar) + return rv + + def format_options(self, ctx: Context, formatter: HelpFormatter) -> None: + super().format_options(ctx, formatter) + self.format_commands(ctx, formatter) + + def format_commands(self, ctx: Context, formatter: HelpFormatter) -> None: + """Extra format methods for multi methods that adds all the commands + after the options. + """ + commands = [] + for subcommand in self.list_commands(ctx): + cmd = self.get_command(ctx, subcommand) + # What is this, the tool lied about a command. Ignore it + if cmd is None: + continue + if cmd.hidden: + continue + + commands.append((subcommand, cmd)) + + # allow for 3 times the default spacing + if len(commands): + limit = formatter.width - 6 - max(len(cmd[0]) for cmd in commands) + + rows = [] + for subcommand, cmd in commands: + help = cmd.get_short_help_str(limit) + rows.append((subcommand, help)) + + if rows: + with formatter.section(_("Commands")): + formatter.write_dl(rows) + + def parse_args(self, ctx: Context, args: list[str]) -> list[str]: + if not args and self.no_args_is_help and not ctx.resilient_parsing: + raise NoArgsIsHelpError(ctx) + + rest = super().parse_args(ctx, args) + + if self.chain: + ctx._protected_args = rest + ctx.args = [] + elif rest: + ctx._protected_args, ctx.args = rest[:1], rest[1:] + + return ctx.args + + def invoke(self, ctx: Context) -> t.Any: + def _process_result(value: t.Any) -> t.Any: + if self._result_callback is not None: + value = ctx.invoke(self._result_callback, value, **ctx.params) + return value + + if not ctx._protected_args: + if self.invoke_without_command: + # No subcommand was invoked, so the result callback is + # invoked with the group return value for regular + # groups, or an empty list for chained groups. + with ctx: + rv = super().invoke(ctx) + return _process_result([] if self.chain else rv) + ctx.fail(_("Missing command.")) + + # Fetch args back out + args = [*ctx._protected_args, *ctx.args] + ctx.args = [] + ctx._protected_args = [] + + # If we're not in chain mode, we only allow the invocation of a + # single command but we also inform the current context about the + # name of the command to invoke. + if not self.chain: + # Make sure the context is entered so we do not clean up + # resources until the result processor has worked. + with ctx: + cmd_name, cmd, args = self.resolve_command(ctx, args) + assert cmd is not None + ctx.invoked_subcommand = cmd_name + super().invoke(ctx) + sub_ctx = cmd.make_context(cmd_name, args, parent=ctx) + with sub_ctx: + return _process_result(sub_ctx.command.invoke(sub_ctx)) + + # In chain mode we create the contexts step by step, but after the + # base command has been invoked. Because at that point we do not + # know the subcommands yet, the invoked subcommand attribute is + # set to ``*`` to inform the command that subcommands are executed + # but nothing else. + with ctx: + ctx.invoked_subcommand = "*" if args else None + super().invoke(ctx) + + # Otherwise we make every single context and invoke them in a + # chain. In that case the return value to the result processor + # is the list of all invoked subcommand's results. + contexts = [] + while args: + cmd_name, cmd, args = self.resolve_command(ctx, args) + assert cmd is not None + sub_ctx = cmd.make_context( + cmd_name, + args, + parent=ctx, + allow_extra_args=True, + allow_interspersed_args=False, + ) + contexts.append(sub_ctx) + args, sub_ctx.args = sub_ctx.args, [] + + rv = [] + for sub_ctx in contexts: + with sub_ctx: + rv.append(sub_ctx.command.invoke(sub_ctx)) + return _process_result(rv) + + def resolve_command( + self, ctx: Context, args: list[str] + ) -> tuple[str | None, Command | None, list[str]]: + cmd_name = make_str(args[0]) + original_cmd_name = cmd_name + + # Get the command + cmd = self.get_command(ctx, cmd_name) + + # If we can't find the command but there is a normalization + # function available, we try with that one. + if cmd is None and ctx.token_normalize_func is not None: + cmd_name = ctx.token_normalize_func(cmd_name) + cmd = self.get_command(ctx, cmd_name) + + # If we don't find the command we want to show an error message + # to the user that it was not provided. However, there is + # something else we should do: if the first argument looks like + # an option we want to kick off parsing again for arguments to + # resolve things like --help which now should go to the main + # place. + if cmd is None and not ctx.resilient_parsing: + if _split_opt(cmd_name)[0]: + self.parse_args(ctx, args) + ctx.fail(_("No such command {name!r}.").format(name=original_cmd_name)) + return cmd_name if cmd else None, cmd, args[1:] + + def shell_complete(self, ctx: Context, incomplete: str) -> list[CompletionItem]: + """Return a list of completions for the incomplete value. Looks + at the names of options, subcommands, and chained + multi-commands. + + :param ctx: Invocation context for this command. + :param incomplete: Value being completed. May be empty. + + .. versionadded:: 8.0 + """ + from click.shell_completion import CompletionItem + + results = [ + CompletionItem(name, help=command.get_short_help_str()) + for name, command in _complete_visible_commands(ctx, incomplete) + ] + results.extend(super().shell_complete(ctx, incomplete)) + return results + + +class _MultiCommand(Group, metaclass=_FakeSubclassCheck): + """ + .. deprecated:: 8.2 + Will be removed in Click 9.0. Use ``Group`` instead. + """ + + +class CommandCollection(Group): + """A :class:`Group` that looks up subcommands on other groups. If a command + is not found on this group, each registered source is checked in order. + Parameters on a source are not added to this group, and a source's callback + is not invoked when invoking its commands. In other words, this "flattens" + commands in many groups into this one group. + + :param name: The name of the group command. + :param sources: A list of :class:`Group` objects to look up commands from. + :param kwargs: Other arguments passed to :class:`Group`. + + .. versionchanged:: 8.2 + This is a subclass of ``Group``. Commands are looked up first on this + group, then each of its sources. + """ + + def __init__( + self, + name: str | None = None, + sources: list[Group] | None = None, + **kwargs: t.Any, + ) -> None: + super().__init__(name, **kwargs) + #: The list of registered groups. + self.sources: list[Group] = sources or [] + + def add_source(self, group: Group) -> None: + """Add a group as a source of commands.""" + self.sources.append(group) + + def get_command(self, ctx: Context, cmd_name: str) -> Command | None: + rv = super().get_command(ctx, cmd_name) + + if rv is not None: + return rv + + for source in self.sources: + rv = source.get_command(ctx, cmd_name) + + if rv is not None: + if self.chain: + _check_nested_chain(self, cmd_name, rv) + + return rv + + return None + + def list_commands(self, ctx: Context) -> list[str]: + rv: set[str] = set(super().list_commands(ctx)) + + for source in self.sources: + rv.update(source.list_commands(ctx)) + + return sorted(rv) + + +def _check_iter(value: t.Any) -> cabc.Iterator[t.Any]: + """Check if the value is iterable but not a string. Raises a type + error, or return an iterator over the value. + """ + if isinstance(value, str): + raise TypeError + + return iter(value) + + +class Parameter: + r"""A parameter to a command comes in two versions: they are either + :class:`Option`\s or :class:`Argument`\s. Other subclasses are currently + not supported by design as some of the internals for parsing are + intentionally not finalized. + + Some settings are supported by both options and arguments. + + :param param_decls: the parameter declarations for this option or + argument. This is a list of flags or argument + names. + :param type: the type that should be used. Either a :class:`ParamType` + or a Python type. The latter is converted into the former + automatically if supported. + :param required: controls if this is optional or not. + :param default: the default value if omitted. This can also be a callable, + in which case it's invoked when the default is needed + without any arguments. + :param callback: A function to further process or validate the value + after type conversion. It is called as ``f(ctx, param, value)`` + and must return the value. It is called for all sources, + including prompts. + :param nargs: the number of arguments to match. If not ``1`` the return + value is a tuple instead of single value. The default for + nargs is ``1`` (except if the type is a tuple, then it's + the arity of the tuple). If ``nargs=-1``, all remaining + parameters are collected. + :param metavar: how the value is represented in the help page. + :param expose_value: if this is `True` then the value is passed onwards + to the command callback and stored on the context, + otherwise it's skipped. + :param is_eager: eager values are processed before non eager ones. This + should not be set for arguments or it will inverse the + order of processing. + :param envvar: a string or list of strings that are environment variables + that should be checked. + :param shell_complete: A function that returns custom shell + completions. Used instead of the param's type completion if + given. Takes ``ctx, param, incomplete`` and must return a list + of :class:`~click.shell_completion.CompletionItem` or a list of + strings. + :param deprecated: If ``True`` or non-empty string, issues a message + indicating that the argument is deprecated and highlights + its deprecation in --help. The message can be customized + by using a string as the value. A deprecated parameter + cannot be required, a ValueError will be raised otherwise. + + .. versionchanged:: 8.2.0 + Introduction of ``deprecated``. + + .. versionchanged:: 8.2 + Adding duplicate parameter names to a :class:`~click.core.Command` will + result in a ``UserWarning`` being shown. + + .. versionchanged:: 8.2 + Adding duplicate parameter names to a :class:`~click.core.Command` will + result in a ``UserWarning`` being shown. + + .. versionchanged:: 8.0 + ``process_value`` validates required parameters and bounded + ``nargs``, and invokes the parameter callback before returning + the value. This allows the callback to validate prompts. + ``full_process_value`` is removed. + + .. versionchanged:: 8.0 + ``autocompletion`` is renamed to ``shell_complete`` and has new + semantics described above. The old name is deprecated and will + be removed in 8.1, until then it will be wrapped to match the + new requirements. + + .. versionchanged:: 8.0 + For ``multiple=True, nargs>1``, the default must be a list of + tuples. + + .. versionchanged:: 8.0 + Setting a default is no longer required for ``nargs>1``, it will + default to ``None``. ``multiple=True`` or ``nargs=-1`` will + default to ``()``. + + .. versionchanged:: 7.1 + Empty environment variables are ignored rather than taking the + empty string value. This makes it possible for scripts to clear + variables if they can't unset them. + + .. versionchanged:: 2.0 + Changed signature for parameter callback to also be passed the + parameter. The old callback format will still work, but it will + raise a warning to give you a chance to migrate the code easier. + """ + + param_type_name = "parameter" + + def __init__( + self, + param_decls: cabc.Sequence[str] | None = None, + type: types.ParamType | t.Any | None = None, + required: bool = False, + default: t.Any | t.Callable[[], t.Any] | None = None, + callback: t.Callable[[Context, Parameter, t.Any], t.Any] | None = None, + nargs: int | None = None, + multiple: bool = False, + metavar: str | None = None, + expose_value: bool = True, + is_eager: bool = False, + envvar: str | cabc.Sequence[str] | None = None, + shell_complete: t.Callable[ + [Context, Parameter, str], list[CompletionItem] | list[str] + ] + | None = None, + deprecated: bool | str = False, + ) -> None: + self.name: str | None + self.opts: list[str] + self.secondary_opts: list[str] + self.name, self.opts, self.secondary_opts = self._parse_decls( + param_decls or (), expose_value + ) + self.type: types.ParamType = types.convert_type(type, default) + + # Default nargs to what the type tells us if we have that + # information available. + if nargs is None: + if self.type.is_composite: + nargs = self.type.arity + else: + nargs = 1 + + self.required = required + self.callback = callback + self.nargs = nargs + self.multiple = multiple + self.expose_value = expose_value + self.default = default + self.is_eager = is_eager + self.metavar = metavar + self.envvar = envvar + self._custom_shell_complete = shell_complete + self.deprecated = deprecated + + if __debug__: + if self.type.is_composite and nargs != self.type.arity: + raise ValueError( + f"'nargs' must be {self.type.arity} (or None) for" + f" type {self.type!r}, but it was {nargs}." + ) + + # Skip no default or callable default. + check_default = default if not callable(default) else None + + if check_default is not None: + if multiple: + try: + # Only check the first value against nargs. + check_default = next(_check_iter(check_default), None) + except TypeError: + raise ValueError( + "'default' must be a list when 'multiple' is true." + ) from None + + # Can be None for multiple with empty default. + if nargs != 1 and check_default is not None: + try: + _check_iter(check_default) + except TypeError: + if multiple: + message = ( + "'default' must be a list of lists when 'multiple' is" + " true and 'nargs' != 1." + ) + else: + message = "'default' must be a list when 'nargs' != 1." + + raise ValueError(message) from None + + if nargs > 1 and len(check_default) != nargs: + subject = "item length" if multiple else "length" + raise ValueError( + f"'default' {subject} must match nargs={nargs}." + ) + + if required and deprecated: + raise ValueError( + f"The {self.param_type_name} '{self.human_readable_name}' " + "is deprecated and still required. A deprecated " + f"{self.param_type_name} cannot be required." + ) + + def to_info_dict(self) -> dict[str, t.Any]: + """Gather information that could be useful for a tool generating + user-facing documentation. + + Use :meth:`click.Context.to_info_dict` to traverse the entire + CLI structure. + + .. versionadded:: 8.0 + """ + return { + "name": self.name, + "param_type_name": self.param_type_name, + "opts": self.opts, + "secondary_opts": self.secondary_opts, + "type": self.type.to_info_dict(), + "required": self.required, + "nargs": self.nargs, + "multiple": self.multiple, + "default": self.default, + "envvar": self.envvar, + } + + def __repr__(self) -> str: + return f"<{self.__class__.__name__} {self.name}>" + + def _parse_decls( + self, decls: cabc.Sequence[str], expose_value: bool + ) -> tuple[str | None, list[str], list[str]]: + raise NotImplementedError() + + @property + def human_readable_name(self) -> str: + """Returns the human readable name of this parameter. This is the + same as the name for options, but the metavar for arguments. + """ + return self.name # type: ignore + + def make_metavar(self, ctx: Context) -> str: + if self.metavar is not None: + return self.metavar + + metavar = self.type.get_metavar(param=self, ctx=ctx) + + if metavar is None: + metavar = self.type.name.upper() + + if self.nargs != 1: + metavar += "..." + + return metavar + + @t.overload + def get_default( + self, ctx: Context, call: t.Literal[True] = True + ) -> t.Any | None: ... + + @t.overload + def get_default( + self, ctx: Context, call: bool = ... + ) -> t.Any | t.Callable[[], t.Any] | None: ... + + def get_default( + self, ctx: Context, call: bool = True + ) -> t.Any | t.Callable[[], t.Any] | None: + """Get the default for the parameter. Tries + :meth:`Context.lookup_default` first, then the local default. + + :param ctx: Current context. + :param call: If the default is a callable, call it. Disable to + return the callable instead. + + .. versionchanged:: 8.0.2 + Type casting is no longer performed when getting a default. + + .. versionchanged:: 8.0.1 + Type casting can fail in resilient parsing mode. Invalid + defaults will not prevent showing help text. + + .. versionchanged:: 8.0 + Looks at ``ctx.default_map`` first. + + .. versionchanged:: 8.0 + Added the ``call`` parameter. + """ + value = ctx.lookup_default(self.name, call=False) # type: ignore + + if value is None: + value = self.default + + if call and callable(value): + value = value() + + return value + + def add_to_parser(self, parser: _OptionParser, ctx: Context) -> None: + raise NotImplementedError() + + def consume_value( + self, ctx: Context, opts: cabc.Mapping[str, t.Any] + ) -> tuple[t.Any, ParameterSource]: + value = opts.get(self.name) # type: ignore + source = ParameterSource.COMMANDLINE + + if value is None: + value = self.value_from_envvar(ctx) + source = ParameterSource.ENVIRONMENT + + if value is None: + value = ctx.lookup_default(self.name) # type: ignore + source = ParameterSource.DEFAULT_MAP + + if value is None: + value = self.get_default(ctx) + source = ParameterSource.DEFAULT + + return value, source + + def type_cast_value(self, ctx: Context, value: t.Any) -> t.Any: + """Convert and validate a value against the option's + :attr:`type`, :attr:`multiple`, and :attr:`nargs`. + """ + if value is None: + return () if self.multiple or self.nargs == -1 else None + + def check_iter(value: t.Any) -> cabc.Iterator[t.Any]: + try: + return _check_iter(value) + except TypeError: + # This should only happen when passing in args manually, + # the parser should construct an iterable when parsing + # the command line. + raise BadParameter( + _("Value must be an iterable."), ctx=ctx, param=self + ) from None + + if self.nargs == 1 or self.type.is_composite: + + def convert(value: t.Any) -> t.Any: + return self.type(value, param=self, ctx=ctx) + + elif self.nargs == -1: + + def convert(value: t.Any) -> t.Any: # tuple[t.Any, ...] + return tuple(self.type(x, self, ctx) for x in check_iter(value)) + + else: # nargs > 1 + + def convert(value: t.Any) -> t.Any: # tuple[t.Any, ...] + value = tuple(check_iter(value)) + + if len(value) != self.nargs: + raise BadParameter( + ngettext( + "Takes {nargs} values but 1 was given.", + "Takes {nargs} values but {len} were given.", + len(value), + ).format(nargs=self.nargs, len=len(value)), + ctx=ctx, + param=self, + ) + + return tuple(self.type(x, self, ctx) for x in value) + + if self.multiple: + return tuple(convert(x) for x in check_iter(value)) + + return convert(value) + + def value_is_missing(self, value: t.Any) -> bool: + if value is None: + return True + + if (self.nargs != 1 or self.multiple) and value == (): + return True + + return False + + def process_value(self, ctx: Context, value: t.Any) -> t.Any: + value = self.type_cast_value(ctx, value) + + if self.required and self.value_is_missing(value): + raise MissingParameter(ctx=ctx, param=self) + + if self.callback is not None: + value = self.callback(ctx, self, value) + + return value + + def resolve_envvar_value(self, ctx: Context) -> str | None: + if self.envvar is None: + return None + + if isinstance(self.envvar, str): + rv = os.environ.get(self.envvar) + + if rv: + return rv + else: + for envvar in self.envvar: + rv = os.environ.get(envvar) + + if rv: + return rv + + return None + + def value_from_envvar(self, ctx: Context) -> t.Any | None: + rv: t.Any | None = self.resolve_envvar_value(ctx) + + if rv is not None and self.nargs != 1: + rv = self.type.split_envvar_value(rv) + + return rv + + def handle_parse_result( + self, ctx: Context, opts: cabc.Mapping[str, t.Any], args: list[str] + ) -> tuple[t.Any, list[str]]: + with augment_usage_errors(ctx, param=self): + value, source = self.consume_value(ctx, opts) + + if ( + self.deprecated + and value is not None + and source + not in ( + ParameterSource.DEFAULT, + ParameterSource.DEFAULT_MAP, + ) + ): + extra_message = ( + f" {self.deprecated}" if isinstance(self.deprecated, str) else "" + ) + message = _( + "DeprecationWarning: The {param_type} {name!r} is deprecated." + "{extra_message}" + ).format( + param_type=self.param_type_name, + name=self.human_readable_name, + extra_message=extra_message, + ) + echo(style(message, fg="red"), err=True) + + ctx.set_parameter_source(self.name, source) # type: ignore + + try: + value = self.process_value(ctx, value) + except Exception: + if not ctx.resilient_parsing: + raise + + value = None + + if self.expose_value: + ctx.params[self.name] = value # type: ignore + + return value, args + + def get_help_record(self, ctx: Context) -> tuple[str, str] | None: + pass + + def get_usage_pieces(self, ctx: Context) -> list[str]: + return [] + + def get_error_hint(self, ctx: Context) -> str: + """Get a stringified version of the param for use in error messages to + indicate which param caused the error. + """ + hint_list = self.opts or [self.human_readable_name] + return " / ".join(f"'{x}'" for x in hint_list) + + def shell_complete(self, ctx: Context, incomplete: str) -> list[CompletionItem]: + """Return a list of completions for the incomplete value. If a + ``shell_complete`` function was given during init, it is used. + Otherwise, the :attr:`type` + :meth:`~click.types.ParamType.shell_complete` function is used. + + :param ctx: Invocation context for this command. + :param incomplete: Value being completed. May be empty. + + .. versionadded:: 8.0 + """ + if self._custom_shell_complete is not None: + results = self._custom_shell_complete(ctx, self, incomplete) + + if results and isinstance(results[0], str): + from click.shell_completion import CompletionItem + + results = [CompletionItem(c) for c in results] + + return t.cast("list[CompletionItem]", results) + + return self.type.shell_complete(ctx, self, incomplete) + + +class Option(Parameter): + """Options are usually optional values on the command line and + have some extra features that arguments don't have. + + All other parameters are passed onwards to the parameter constructor. + + :param show_default: Show the default value for this option in its + help text. Values are not shown by default, unless + :attr:`Context.show_default` is ``True``. If this value is a + string, it shows that string in parentheses instead of the + actual value. This is particularly useful for dynamic options. + For single option boolean flags, the default remains hidden if + its value is ``False``. + :param show_envvar: Controls if an environment variable should be + shown on the help page and error messages. + Normally, environment variables are not shown. + :param prompt: If set to ``True`` or a non empty string then the + user will be prompted for input. If set to ``True`` the prompt + will be the option name capitalized. A deprecated option cannot be + prompted. + :param confirmation_prompt: Prompt a second time to confirm the + value if it was prompted for. Can be set to a string instead of + ``True`` to customize the message. + :param prompt_required: If set to ``False``, the user will be + prompted for input only when the option was specified as a flag + without a value. + :param hide_input: If this is ``True`` then the input on the prompt + will be hidden from the user. This is useful for password input. + :param is_flag: forces this option to act as a flag. The default is + auto detection. + :param flag_value: which value should be used for this flag if it's + enabled. This is set to a boolean automatically if + the option string contains a slash to mark two options. + :param multiple: if this is set to `True` then the argument is accepted + multiple times and recorded. This is similar to ``nargs`` + in how it works but supports arbitrary number of + arguments. + :param count: this flag makes an option increment an integer. + :param allow_from_autoenv: if this is enabled then the value of this + parameter will be pulled from an environment + variable in case a prefix is defined on the + context. + :param help: the help string. + :param hidden: hide this option from help outputs. + :param attrs: Other command arguments described in :class:`Parameter`. + + .. versionchanged:: 8.2 + ``envvar`` used with ``flag_value`` will always use the ``flag_value``, + previously it would use the value of the environment variable. + + .. versionchanged:: 8.1 + Help text indentation is cleaned here instead of only in the + ``@option`` decorator. + + .. versionchanged:: 8.1 + The ``show_default`` parameter overrides + ``Context.show_default``. + + .. versionchanged:: 8.1 + The default of a single option boolean flag is not shown if the + default value is ``False``. + + .. versionchanged:: 8.0.1 + ``type`` is detected from ``flag_value`` if given. + """ + + param_type_name = "option" + + def __init__( + self, + param_decls: cabc.Sequence[str] | None = None, + show_default: bool | str | None = None, + prompt: bool | str = False, + confirmation_prompt: bool | str = False, + prompt_required: bool = True, + hide_input: bool = False, + is_flag: bool | None = None, + flag_value: t.Any | None = None, + multiple: bool = False, + count: bool = False, + allow_from_autoenv: bool = True, + type: types.ParamType | t.Any | None = None, + help: str | None = None, + hidden: bool = False, + show_choices: bool = True, + show_envvar: bool = False, + deprecated: bool | str = False, + **attrs: t.Any, + ) -> None: + if help: + help = inspect.cleandoc(help) + + default_is_missing = "default" not in attrs + super().__init__( + param_decls, type=type, multiple=multiple, deprecated=deprecated, **attrs + ) + + if prompt is True: + if self.name is None: + raise TypeError("'name' is required with 'prompt=True'.") + + prompt_text: str | None = self.name.replace("_", " ").capitalize() + elif prompt is False: + prompt_text = None + else: + prompt_text = prompt + + if deprecated: + deprecated_message = ( + f"(DEPRECATED: {deprecated})" + if isinstance(deprecated, str) + else "(DEPRECATED)" + ) + help = help + deprecated_message if help is not None else deprecated_message + + self.prompt = prompt_text + self.confirmation_prompt = confirmation_prompt + self.prompt_required = prompt_required + self.hide_input = hide_input + self.hidden = hidden + + # If prompt is enabled but not required, then the option can be + # used as a flag to indicate using prompt or flag_value. + self._flag_needs_value = self.prompt is not None and not self.prompt_required + + if is_flag is None: + if flag_value is not None: + # Implicitly a flag because flag_value was set. + is_flag = True + elif self._flag_needs_value: + # Not a flag, but when used as a flag it shows a prompt. + is_flag = False + else: + # Implicitly a flag because flag options were given. + is_flag = bool(self.secondary_opts) + elif is_flag is False and not self._flag_needs_value: + # Not a flag, and prompt is not enabled, can be used as a + # flag if flag_value is set. + self._flag_needs_value = flag_value is not None + + self.default: t.Any | t.Callable[[], t.Any] + + if is_flag and default_is_missing and not self.required: + if multiple: + self.default = () + else: + self.default = False + + if is_flag and flag_value is None: + flag_value = not self.default + + self.type: types.ParamType + if is_flag and type is None: + # Re-guess the type from the flag value instead of the + # default. + self.type = types.convert_type(None, flag_value) + + self.is_flag: bool = is_flag + self.is_bool_flag: bool = is_flag and isinstance(self.type, types.BoolParamType) + self.flag_value: t.Any = flag_value + + # Counting + self.count = count + if count: + if type is None: + self.type = types.IntRange(min=0) + if default_is_missing: + self.default = 0 + + self.allow_from_autoenv = allow_from_autoenv + self.help = help + self.show_default = show_default + self.show_choices = show_choices + self.show_envvar = show_envvar + + if __debug__: + if deprecated and prompt: + raise ValueError("`deprecated` options cannot use `prompt`.") + + if self.nargs == -1: + raise TypeError("nargs=-1 is not supported for options.") + + if self.prompt and self.is_flag and not self.is_bool_flag: + raise TypeError("'prompt' is not valid for non-boolean flag.") + + if not self.is_bool_flag and self.secondary_opts: + raise TypeError("Secondary flag is not valid for non-boolean flag.") + + if self.is_bool_flag and self.hide_input and self.prompt is not None: + raise TypeError( + "'prompt' with 'hide_input' is not valid for boolean flag." + ) + + if self.count: + if self.multiple: + raise TypeError("'count' is not valid with 'multiple'.") + + if self.is_flag: + raise TypeError("'count' is not valid with 'is_flag'.") + + def to_info_dict(self) -> dict[str, t.Any]: + info_dict = super().to_info_dict() + info_dict.update( + help=self.help, + prompt=self.prompt, + is_flag=self.is_flag, + flag_value=self.flag_value, + count=self.count, + hidden=self.hidden, + ) + return info_dict + + def get_error_hint(self, ctx: Context) -> str: + result = super().get_error_hint(ctx) + if self.show_envvar: + result += f" (env var: '{self.envvar}')" + return result + + def _parse_decls( + self, decls: cabc.Sequence[str], expose_value: bool + ) -> tuple[str | None, list[str], list[str]]: + opts = [] + secondary_opts = [] + name = None + possible_names = [] + + for decl in decls: + if decl.isidentifier(): + if name is not None: + raise TypeError(f"Name '{name}' defined twice") + name = decl + else: + split_char = ";" if decl[:1] == "/" else "/" + if split_char in decl: + first, second = decl.split(split_char, 1) + first = first.rstrip() + if first: + possible_names.append(_split_opt(first)) + opts.append(first) + second = second.lstrip() + if second: + secondary_opts.append(second.lstrip()) + if first == second: + raise ValueError( + f"Boolean option {decl!r} cannot use the" + " same flag for true/false." + ) + else: + possible_names.append(_split_opt(decl)) + opts.append(decl) + + if name is None and possible_names: + possible_names.sort(key=lambda x: -len(x[0])) # group long options first + name = possible_names[0][1].replace("-", "_").lower() + if not name.isidentifier(): + name = None + + if name is None: + if not expose_value: + return None, opts, secondary_opts + raise TypeError( + f"Could not determine name for option with declarations {decls!r}" + ) + + if not opts and not secondary_opts: + raise TypeError( + f"No options defined but a name was passed ({name})." + " Did you mean to declare an argument instead? Did" + f" you mean to pass '--{name}'?" + ) + + return name, opts, secondary_opts + + def add_to_parser(self, parser: _OptionParser, ctx: Context) -> None: + if self.multiple: + action = "append" + elif self.count: + action = "count" + else: + action = "store" + + if self.is_flag: + action = f"{action}_const" + + if self.is_bool_flag and self.secondary_opts: + parser.add_option( + obj=self, opts=self.opts, dest=self.name, action=action, const=True + ) + parser.add_option( + obj=self, + opts=self.secondary_opts, + dest=self.name, + action=action, + const=False, + ) + else: + parser.add_option( + obj=self, + opts=self.opts, + dest=self.name, + action=action, + const=self.flag_value, + ) + else: + parser.add_option( + obj=self, + opts=self.opts, + dest=self.name, + action=action, + nargs=self.nargs, + ) + + def get_help_record(self, ctx: Context) -> tuple[str, str] | None: + if self.hidden: + return None + + any_prefix_is_slash = False + + def _write_opts(opts: cabc.Sequence[str]) -> str: + nonlocal any_prefix_is_slash + + rv, any_slashes = join_options(opts) + + if any_slashes: + any_prefix_is_slash = True + + if not self.is_flag and not self.count: + rv += f" {self.make_metavar(ctx=ctx)}" + + return rv + + rv = [_write_opts(self.opts)] + + if self.secondary_opts: + rv.append(_write_opts(self.secondary_opts)) + + help = self.help or "" + + extra = self.get_help_extra(ctx) + extra_items = [] + if "envvars" in extra: + extra_items.append( + _("env var: {var}").format(var=", ".join(extra["envvars"])) + ) + if "default" in extra: + extra_items.append(_("default: {default}").format(default=extra["default"])) + if "range" in extra: + extra_items.append(extra["range"]) + if "required" in extra: + extra_items.append(_(extra["required"])) + + if extra_items: + extra_str = "; ".join(extra_items) + help = f"{help} [{extra_str}]" if help else f"[{extra_str}]" + + return ("; " if any_prefix_is_slash else " / ").join(rv), help + + def get_help_extra(self, ctx: Context) -> types.OptionHelpExtra: + extra: types.OptionHelpExtra = {} + + if self.show_envvar: + envvar = self.envvar + + if envvar is None: + if ( + self.allow_from_autoenv + and ctx.auto_envvar_prefix is not None + and self.name is not None + ): + envvar = f"{ctx.auto_envvar_prefix}_{self.name.upper()}" + + if envvar is not None: + if isinstance(envvar, str): + extra["envvars"] = (envvar,) + else: + extra["envvars"] = tuple(str(d) for d in envvar) + + # Temporarily enable resilient parsing to avoid type casting + # failing for the default. Might be possible to extend this to + # help formatting in general. + resilient = ctx.resilient_parsing + ctx.resilient_parsing = True + + try: + default_value = self.get_default(ctx, call=False) + finally: + ctx.resilient_parsing = resilient + + show_default = False + show_default_is_str = False + + if self.show_default is not None: + if isinstance(self.show_default, str): + show_default_is_str = show_default = True + else: + show_default = self.show_default + elif ctx.show_default is not None: + show_default = ctx.show_default + + if show_default_is_str or (show_default and (default_value is not None)): + if show_default_is_str: + default_string = f"({self.show_default})" + elif isinstance(default_value, (list, tuple)): + default_string = ", ".join(str(d) for d in default_value) + elif inspect.isfunction(default_value): + default_string = _("(dynamic)") + elif self.is_bool_flag and self.secondary_opts: + # For boolean flags that have distinct True/False opts, + # use the opt without prefix instead of the value. + default_string = _split_opt( + (self.opts if default_value else self.secondary_opts)[0] + )[1] + elif self.is_bool_flag and not self.secondary_opts and not default_value: + default_string = "" + elif default_value == "": + default_string = '""' + else: + default_string = str(default_value) + + if default_string: + extra["default"] = default_string + + if ( + isinstance(self.type, types._NumberRangeBase) + # skip count with default range type + and not (self.count and self.type.min == 0 and self.type.max is None) + ): + range_str = self.type._describe_range() + + if range_str: + extra["range"] = range_str + + if self.required: + extra["required"] = "required" + + return extra + + @t.overload + def get_default( + self, ctx: Context, call: t.Literal[True] = True + ) -> t.Any | None: ... + + @t.overload + def get_default( + self, ctx: Context, call: bool = ... + ) -> t.Any | t.Callable[[], t.Any] | None: ... + + def get_default( + self, ctx: Context, call: bool = True + ) -> t.Any | t.Callable[[], t.Any] | None: + # If we're a non boolean flag our default is more complex because + # we need to look at all flags in the same group to figure out + # if we're the default one in which case we return the flag + # value as default. + if self.is_flag and not self.is_bool_flag: + for param in ctx.command.params: + if param.name == self.name and param.default: + return t.cast(Option, param).flag_value + + return None + + return super().get_default(ctx, call=call) + + def prompt_for_value(self, ctx: Context) -> t.Any: + """This is an alternative flow that can be activated in the full + value processing if a value does not exist. It will prompt the + user until a valid value exists and then returns the processed + value as result. + """ + assert self.prompt is not None + + # Calculate the default before prompting anything to be stable. + default = self.get_default(ctx) + + # If this is a prompt for a flag we need to handle this + # differently. + if self.is_bool_flag: + return confirm(self.prompt, default) + + # If show_default is set to True/False, provide this to `prompt` as well. For + # non-bool values of `show_default`, we use `prompt`'s default behavior + prompt_kwargs: t.Any = {} + if isinstance(self.show_default, bool): + prompt_kwargs["show_default"] = self.show_default + + return prompt( + self.prompt, + default=default, + type=self.type, + hide_input=self.hide_input, + show_choices=self.show_choices, + confirmation_prompt=self.confirmation_prompt, + value_proc=lambda x: self.process_value(ctx, x), + **prompt_kwargs, + ) + + def resolve_envvar_value(self, ctx: Context) -> str | None: + rv = super().resolve_envvar_value(ctx) + + if rv is not None: + if self.is_flag and self.flag_value: + return str(self.flag_value) + return rv + + if ( + self.allow_from_autoenv + and ctx.auto_envvar_prefix is not None + and self.name is not None + ): + envvar = f"{ctx.auto_envvar_prefix}_{self.name.upper()}" + rv = os.environ.get(envvar) + + if rv: + return rv + + return None + + def value_from_envvar(self, ctx: Context) -> t.Any | None: + rv: t.Any | None = self.resolve_envvar_value(ctx) + + if rv is None: + return None + + value_depth = (self.nargs != 1) + bool(self.multiple) + + if value_depth > 0: + rv = self.type.split_envvar_value(rv) + + if self.multiple and self.nargs != 1: + rv = batch(rv, self.nargs) + + return rv + + def consume_value( + self, ctx: Context, opts: cabc.Mapping[str, Parameter] + ) -> tuple[t.Any, ParameterSource]: + value, source = super().consume_value(ctx, opts) + + # The parser will emit a sentinel value if the option can be + # given as a flag without a value. This is different from None + # to distinguish from the flag not being given at all. + if value is _flag_needs_value: + if self.prompt is not None and not ctx.resilient_parsing: + value = self.prompt_for_value(ctx) + source = ParameterSource.PROMPT + else: + value = self.flag_value + source = ParameterSource.COMMANDLINE + + elif ( + self.multiple + and value is not None + and any(v is _flag_needs_value for v in value) + ): + value = [self.flag_value if v is _flag_needs_value else v for v in value] + source = ParameterSource.COMMANDLINE + + # The value wasn't set, or used the param's default, prompt if + # prompting is enabled. + elif ( + source in {None, ParameterSource.DEFAULT} + and self.prompt is not None + and (self.required or self.prompt_required) + and not ctx.resilient_parsing + ): + value = self.prompt_for_value(ctx) + source = ParameterSource.PROMPT + + return value, source + + +class Argument(Parameter): + """Arguments are positional parameters to a command. They generally + provide fewer features than options but can have infinite ``nargs`` + and are required by default. + + All parameters are passed onwards to the constructor of :class:`Parameter`. + """ + + param_type_name = "argument" + + def __init__( + self, + param_decls: cabc.Sequence[str], + required: bool | None = None, + **attrs: t.Any, + ) -> None: + if required is None: + if attrs.get("default") is not None: + required = False + else: + required = attrs.get("nargs", 1) > 0 + + if "multiple" in attrs: + raise TypeError("__init__() got an unexpected keyword argument 'multiple'.") + + super().__init__(param_decls, required=required, **attrs) + + if __debug__: + if self.default is not None and self.nargs == -1: + raise TypeError("'default' is not supported for nargs=-1.") + + @property + def human_readable_name(self) -> str: + if self.metavar is not None: + return self.metavar + return self.name.upper() # type: ignore + + def make_metavar(self, ctx: Context) -> str: + if self.metavar is not None: + return self.metavar + var = self.type.get_metavar(param=self, ctx=ctx) + if not var: + var = self.name.upper() # type: ignore + if self.deprecated: + var += "!" + if not self.required: + var = f"[{var}]" + if self.nargs != 1: + var += "..." + return var + + def _parse_decls( + self, decls: cabc.Sequence[str], expose_value: bool + ) -> tuple[str | None, list[str], list[str]]: + if not decls: + if not expose_value: + return None, [], [] + raise TypeError("Argument is marked as exposed, but does not have a name.") + if len(decls) == 1: + name = arg = decls[0] + name = name.replace("-", "_").lower() + else: + raise TypeError( + "Arguments take exactly one parameter declaration, got" + f" {len(decls)}: {decls}." + ) + return name, [arg], [] + + def get_usage_pieces(self, ctx: Context) -> list[str]: + return [self.make_metavar(ctx)] + + def get_error_hint(self, ctx: Context) -> str: + return f"'{self.make_metavar(ctx)}'" + + def add_to_parser(self, parser: _OptionParser, ctx: Context) -> None: + parser.add_argument(dest=self.name, nargs=self.nargs, obj=self) + + +def __getattr__(name: str) -> object: + import warnings + + if name == "BaseCommand": + warnings.warn( + "'BaseCommand' is deprecated and will be removed in Click 9.0. Use" + " 'Command' instead.", + DeprecationWarning, + stacklevel=2, + ) + return _BaseCommand + + if name == "MultiCommand": + warnings.warn( + "'MultiCommand' is deprecated and will be removed in Click 9.0. Use" + " 'Group' instead.", + DeprecationWarning, + stacklevel=2, + ) + return _MultiCommand + + raise AttributeError(name) diff --git a/venv/Lib/site-packages/click/decorators.py b/venv/Lib/site-packages/click/decorators.py new file mode 100644 index 0000000000000000000000000000000000000000..21f4c342245fa93a7946b17d7661e0d2fa6a0c29 --- /dev/null +++ b/venv/Lib/site-packages/click/decorators.py @@ -0,0 +1,551 @@ +from __future__ import annotations + +import inspect +import typing as t +from functools import update_wrapper +from gettext import gettext as _ + +from .core import Argument +from .core import Command +from .core import Context +from .core import Group +from .core import Option +from .core import Parameter +from .globals import get_current_context +from .utils import echo + +if t.TYPE_CHECKING: + import typing_extensions as te + + P = te.ParamSpec("P") + +R = t.TypeVar("R") +T = t.TypeVar("T") +_AnyCallable = t.Callable[..., t.Any] +FC = t.TypeVar("FC", bound="_AnyCallable | Command") + + +def pass_context(f: t.Callable[te.Concatenate[Context, P], R]) -> t.Callable[P, R]: + """Marks a callback as wanting to receive the current context + object as first argument. + """ + + def new_func(*args: P.args, **kwargs: P.kwargs) -> R: + return f(get_current_context(), *args, **kwargs) + + return update_wrapper(new_func, f) + + +def pass_obj(f: t.Callable[te.Concatenate[T, P], R]) -> t.Callable[P, R]: + """Similar to :func:`pass_context`, but only pass the object on the + context onwards (:attr:`Context.obj`). This is useful if that object + represents the state of a nested system. + """ + + def new_func(*args: P.args, **kwargs: P.kwargs) -> R: + return f(get_current_context().obj, *args, **kwargs) + + return update_wrapper(new_func, f) + + +def make_pass_decorator( + object_type: type[T], ensure: bool = False +) -> t.Callable[[t.Callable[te.Concatenate[T, P], R]], t.Callable[P, R]]: + """Given an object type this creates a decorator that will work + similar to :func:`pass_obj` but instead of passing the object of the + current context, it will find the innermost context of type + :func:`object_type`. + + This generates a decorator that works roughly like this:: + + from functools import update_wrapper + + def decorator(f): + @pass_context + def new_func(ctx, *args, **kwargs): + obj = ctx.find_object(object_type) + return ctx.invoke(f, obj, *args, **kwargs) + return update_wrapper(new_func, f) + return decorator + + :param object_type: the type of the object to pass. + :param ensure: if set to `True`, a new object will be created and + remembered on the context if it's not there yet. + """ + + def decorator(f: t.Callable[te.Concatenate[T, P], R]) -> t.Callable[P, R]: + def new_func(*args: P.args, **kwargs: P.kwargs) -> R: + ctx = get_current_context() + + obj: T | None + if ensure: + obj = ctx.ensure_object(object_type) + else: + obj = ctx.find_object(object_type) + + if obj is None: + raise RuntimeError( + "Managed to invoke callback without a context" + f" object of type {object_type.__name__!r}" + " existing." + ) + + return ctx.invoke(f, obj, *args, **kwargs) + + return update_wrapper(new_func, f) + + return decorator + + +def pass_meta_key( + key: str, *, doc_description: str | None = None +) -> t.Callable[[t.Callable[te.Concatenate[T, P], R]], t.Callable[P, R]]: + """Create a decorator that passes a key from + :attr:`click.Context.meta` as the first argument to the decorated + function. + + :param key: Key in ``Context.meta`` to pass. + :param doc_description: Description of the object being passed, + inserted into the decorator's docstring. Defaults to "the 'key' + key from Context.meta". + + .. versionadded:: 8.0 + """ + + def decorator(f: t.Callable[te.Concatenate[T, P], R]) -> t.Callable[P, R]: + def new_func(*args: P.args, **kwargs: P.kwargs) -> R: + ctx = get_current_context() + obj = ctx.meta[key] + return ctx.invoke(f, obj, *args, **kwargs) + + return update_wrapper(new_func, f) + + if doc_description is None: + doc_description = f"the {key!r} key from :attr:`click.Context.meta`" + + decorator.__doc__ = ( + f"Decorator that passes {doc_description} as the first argument" + " to the decorated function." + ) + return decorator + + +CmdType = t.TypeVar("CmdType", bound=Command) + + +# variant: no call, directly as decorator for a function. +@t.overload +def command(name: _AnyCallable) -> Command: ... + + +# variant: with positional name and with positional or keyword cls argument: +# @command(namearg, CommandCls, ...) or @command(namearg, cls=CommandCls, ...) +@t.overload +def command( + name: str | None, + cls: type[CmdType], + **attrs: t.Any, +) -> t.Callable[[_AnyCallable], CmdType]: ... + + +# variant: name omitted, cls _must_ be a keyword argument, @command(cls=CommandCls, ...) +@t.overload +def command( + name: None = None, + *, + cls: type[CmdType], + **attrs: t.Any, +) -> t.Callable[[_AnyCallable], CmdType]: ... + + +# variant: with optional string name, no cls argument provided. +@t.overload +def command( + name: str | None = ..., cls: None = None, **attrs: t.Any +) -> t.Callable[[_AnyCallable], Command]: ... + + +def command( + name: str | _AnyCallable | None = None, + cls: type[CmdType] | None = None, + **attrs: t.Any, +) -> Command | t.Callable[[_AnyCallable], Command | CmdType]: + r"""Creates a new :class:`Command` and uses the decorated function as + callback. This will also automatically attach all decorated + :func:`option`\s and :func:`argument`\s as parameters to the command. + + The name of the command defaults to the name of the function, converted to + lowercase, with underscores ``_`` replaced by dashes ``-``, and the suffixes + ``_command``, ``_cmd``, ``_group``, and ``_grp`` are removed. For example, + ``init_data_command`` becomes ``init-data``. + + All keyword arguments are forwarded to the underlying command class. + For the ``params`` argument, any decorated params are appended to + the end of the list. + + Once decorated the function turns into a :class:`Command` instance + that can be invoked as a command line utility or be attached to a + command :class:`Group`. + + :param name: The name of the command. Defaults to modifying the function's + name as described above. + :param cls: The command class to create. Defaults to :class:`Command`. + + .. versionchanged:: 8.2 + The suffixes ``_command``, ``_cmd``, ``_group``, and ``_grp`` are + removed when generating the name. + + .. versionchanged:: 8.1 + This decorator can be applied without parentheses. + + .. versionchanged:: 8.1 + The ``params`` argument can be used. Decorated params are + appended to the end of the list. + """ + + func: t.Callable[[_AnyCallable], t.Any] | None = None + + if callable(name): + func = name + name = None + assert cls is None, "Use 'command(cls=cls)(callable)' to specify a class." + assert not attrs, "Use 'command(**kwargs)(callable)' to provide arguments." + + if cls is None: + cls = t.cast("type[CmdType]", Command) + + def decorator(f: _AnyCallable) -> CmdType: + if isinstance(f, Command): + raise TypeError("Attempted to convert a callback into a command twice.") + + attr_params = attrs.pop("params", None) + params = attr_params if attr_params is not None else [] + + try: + decorator_params = f.__click_params__ # type: ignore + except AttributeError: + pass + else: + del f.__click_params__ # type: ignore + params.extend(reversed(decorator_params)) + + if attrs.get("help") is None: + attrs["help"] = f.__doc__ + + if t.TYPE_CHECKING: + assert cls is not None + assert not callable(name) + + if name is not None: + cmd_name = name + else: + cmd_name = f.__name__.lower().replace("_", "-") + cmd_left, sep, suffix = cmd_name.rpartition("-") + + if sep and suffix in {"command", "cmd", "group", "grp"}: + cmd_name = cmd_left + + cmd = cls(name=cmd_name, callback=f, params=params, **attrs) + cmd.__doc__ = f.__doc__ + return cmd + + if func is not None: + return decorator(func) + + return decorator + + +GrpType = t.TypeVar("GrpType", bound=Group) + + +# variant: no call, directly as decorator for a function. +@t.overload +def group(name: _AnyCallable) -> Group: ... + + +# variant: with positional name and with positional or keyword cls argument: +# @group(namearg, GroupCls, ...) or @group(namearg, cls=GroupCls, ...) +@t.overload +def group( + name: str | None, + cls: type[GrpType], + **attrs: t.Any, +) -> t.Callable[[_AnyCallable], GrpType]: ... + + +# variant: name omitted, cls _must_ be a keyword argument, @group(cmd=GroupCls, ...) +@t.overload +def group( + name: None = None, + *, + cls: type[GrpType], + **attrs: t.Any, +) -> t.Callable[[_AnyCallable], GrpType]: ... + + +# variant: with optional string name, no cls argument provided. +@t.overload +def group( + name: str | None = ..., cls: None = None, **attrs: t.Any +) -> t.Callable[[_AnyCallable], Group]: ... + + +def group( + name: str | _AnyCallable | None = None, + cls: type[GrpType] | None = None, + **attrs: t.Any, +) -> Group | t.Callable[[_AnyCallable], Group | GrpType]: + """Creates a new :class:`Group` with a function as callback. This + works otherwise the same as :func:`command` just that the `cls` + parameter is set to :class:`Group`. + + .. versionchanged:: 8.1 + This decorator can be applied without parentheses. + """ + if cls is None: + cls = t.cast("type[GrpType]", Group) + + if callable(name): + return command(cls=cls, **attrs)(name) + + return command(name, cls, **attrs) + + +def _param_memo(f: t.Callable[..., t.Any], param: Parameter) -> None: + if isinstance(f, Command): + f.params.append(param) + else: + if not hasattr(f, "__click_params__"): + f.__click_params__ = [] # type: ignore + + f.__click_params__.append(param) # type: ignore + + +def argument( + *param_decls: str, cls: type[Argument] | None = None, **attrs: t.Any +) -> t.Callable[[FC], FC]: + """Attaches an argument to the command. All positional arguments are + passed as parameter declarations to :class:`Argument`; all keyword + arguments are forwarded unchanged (except ``cls``). + This is equivalent to creating an :class:`Argument` instance manually + and attaching it to the :attr:`Command.params` list. + + For the default argument class, refer to :class:`Argument` and + :class:`Parameter` for descriptions of parameters. + + :param cls: the argument class to instantiate. This defaults to + :class:`Argument`. + :param param_decls: Passed as positional arguments to the constructor of + ``cls``. + :param attrs: Passed as keyword arguments to the constructor of ``cls``. + """ + if cls is None: + cls = Argument + + def decorator(f: FC) -> FC: + _param_memo(f, cls(param_decls, **attrs)) + return f + + return decorator + + +def option( + *param_decls: str, cls: type[Option] | None = None, **attrs: t.Any +) -> t.Callable[[FC], FC]: + """Attaches an option to the command. All positional arguments are + passed as parameter declarations to :class:`Option`; all keyword + arguments are forwarded unchanged (except ``cls``). + This is equivalent to creating an :class:`Option` instance manually + and attaching it to the :attr:`Command.params` list. + + For the default option class, refer to :class:`Option` and + :class:`Parameter` for descriptions of parameters. + + :param cls: the option class to instantiate. This defaults to + :class:`Option`. + :param param_decls: Passed as positional arguments to the constructor of + ``cls``. + :param attrs: Passed as keyword arguments to the constructor of ``cls``. + """ + if cls is None: + cls = Option + + def decorator(f: FC) -> FC: + _param_memo(f, cls(param_decls, **attrs)) + return f + + return decorator + + +def confirmation_option(*param_decls: str, **kwargs: t.Any) -> t.Callable[[FC], FC]: + """Add a ``--yes`` option which shows a prompt before continuing if + not passed. If the prompt is declined, the program will exit. + + :param param_decls: One or more option names. Defaults to the single + value ``"--yes"``. + :param kwargs: Extra arguments are passed to :func:`option`. + """ + + def callback(ctx: Context, param: Parameter, value: bool) -> None: + if not value: + ctx.abort() + + if not param_decls: + param_decls = ("--yes",) + + kwargs.setdefault("is_flag", True) + kwargs.setdefault("callback", callback) + kwargs.setdefault("expose_value", False) + kwargs.setdefault("prompt", "Do you want to continue?") + kwargs.setdefault("help", "Confirm the action without prompting.") + return option(*param_decls, **kwargs) + + +def password_option(*param_decls: str, **kwargs: t.Any) -> t.Callable[[FC], FC]: + """Add a ``--password`` option which prompts for a password, hiding + input and asking to enter the value again for confirmation. + + :param param_decls: One or more option names. Defaults to the single + value ``"--password"``. + :param kwargs: Extra arguments are passed to :func:`option`. + """ + if not param_decls: + param_decls = ("--password",) + + kwargs.setdefault("prompt", True) + kwargs.setdefault("confirmation_prompt", True) + kwargs.setdefault("hide_input", True) + return option(*param_decls, **kwargs) + + +def version_option( + version: str | None = None, + *param_decls: str, + package_name: str | None = None, + prog_name: str | None = None, + message: str | None = None, + **kwargs: t.Any, +) -> t.Callable[[FC], FC]: + """Add a ``--version`` option which immediately prints the version + number and exits the program. + + If ``version`` is not provided, Click will try to detect it using + :func:`importlib.metadata.version` to get the version for the + ``package_name``. + + If ``package_name`` is not provided, Click will try to detect it by + inspecting the stack frames. This will be used to detect the + version, so it must match the name of the installed package. + + :param version: The version number to show. If not provided, Click + will try to detect it. + :param param_decls: One or more option names. Defaults to the single + value ``"--version"``. + :param package_name: The package name to detect the version from. If + not provided, Click will try to detect it. + :param prog_name: The name of the CLI to show in the message. If not + provided, it will be detected from the command. + :param message: The message to show. The values ``%(prog)s``, + ``%(package)s``, and ``%(version)s`` are available. Defaults to + ``"%(prog)s, version %(version)s"``. + :param kwargs: Extra arguments are passed to :func:`option`. + :raise RuntimeError: ``version`` could not be detected. + + .. versionchanged:: 8.0 + Add the ``package_name`` parameter, and the ``%(package)s`` + value for messages. + + .. versionchanged:: 8.0 + Use :mod:`importlib.metadata` instead of ``pkg_resources``. The + version is detected based on the package name, not the entry + point name. The Python package name must match the installed + package name, or be passed with ``package_name=``. + """ + if message is None: + message = _("%(prog)s, version %(version)s") + + if version is None and package_name is None: + frame = inspect.currentframe() + f_back = frame.f_back if frame is not None else None + f_globals = f_back.f_globals if f_back is not None else None + # break reference cycle + # https://docs.python.org/3/library/inspect.html#the-interpreter-stack + del frame + + if f_globals is not None: + package_name = f_globals.get("__name__") + + if package_name == "__main__": + package_name = f_globals.get("__package__") + + if package_name: + package_name = package_name.partition(".")[0] + + def callback(ctx: Context, param: Parameter, value: bool) -> None: + if not value or ctx.resilient_parsing: + return + + nonlocal prog_name + nonlocal version + + if prog_name is None: + prog_name = ctx.find_root().info_name + + if version is None and package_name is not None: + import importlib.metadata + + try: + version = importlib.metadata.version(package_name) + except importlib.metadata.PackageNotFoundError: + raise RuntimeError( + f"{package_name!r} is not installed. Try passing" + " 'package_name' instead." + ) from None + + if version is None: + raise RuntimeError( + f"Could not determine the version for {package_name!r} automatically." + ) + + echo( + message % {"prog": prog_name, "package": package_name, "version": version}, + color=ctx.color, + ) + ctx.exit() + + if not param_decls: + param_decls = ("--version",) + + kwargs.setdefault("is_flag", True) + kwargs.setdefault("expose_value", False) + kwargs.setdefault("is_eager", True) + kwargs.setdefault("help", _("Show the version and exit.")) + kwargs["callback"] = callback + return option(*param_decls, **kwargs) + + +def help_option(*param_decls: str, **kwargs: t.Any) -> t.Callable[[FC], FC]: + """Pre-configured ``--help`` option which immediately prints the help page + and exits the program. + + :param param_decls: One or more option names. Defaults to the single + value ``"--help"``. + :param kwargs: Extra arguments are passed to :func:`option`. + """ + + def show_help(ctx: Context, param: Parameter, value: bool) -> None: + """Callback that print the help page on ```` and exits.""" + if value and not ctx.resilient_parsing: + echo(ctx.get_help(), color=ctx.color) + ctx.exit() + + if not param_decls: + param_decls = ("--help",) + + kwargs.setdefault("is_flag", True) + kwargs.setdefault("expose_value", False) + kwargs.setdefault("is_eager", True) + kwargs.setdefault("help", _("Show this message and exit.")) + kwargs.setdefault("callback", show_help) + + return option(*param_decls, **kwargs) diff --git a/venv/Lib/site-packages/click/exceptions.py b/venv/Lib/site-packages/click/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..f141a832e1ab678709998c3bbafcdea6561b9661 --- /dev/null +++ b/venv/Lib/site-packages/click/exceptions.py @@ -0,0 +1,308 @@ +from __future__ import annotations + +import collections.abc as cabc +import typing as t +from gettext import gettext as _ +from gettext import ngettext + +from ._compat import get_text_stderr +from .globals import resolve_color_default +from .utils import echo +from .utils import format_filename + +if t.TYPE_CHECKING: + from .core import Command + from .core import Context + from .core import Parameter + + +def _join_param_hints(param_hint: cabc.Sequence[str] | str | None) -> str | None: + if param_hint is not None and not isinstance(param_hint, str): + return " / ".join(repr(x) for x in param_hint) + + return param_hint + + +class ClickException(Exception): + """An exception that Click can handle and show to the user.""" + + #: The exit code for this exception. + exit_code = 1 + + def __init__(self, message: str) -> None: + super().__init__(message) + # The context will be removed by the time we print the message, so cache + # the color settings here to be used later on (in `show`) + self.show_color: bool | None = resolve_color_default() + self.message = message + + def format_message(self) -> str: + return self.message + + def __str__(self) -> str: + return self.message + + def show(self, file: t.IO[t.Any] | None = None) -> None: + if file is None: + file = get_text_stderr() + + echo( + _("Error: {message}").format(message=self.format_message()), + file=file, + color=self.show_color, + ) + + +class UsageError(ClickException): + """An internal exception that signals a usage error. This typically + aborts any further handling. + + :param message: the error message to display. + :param ctx: optionally the context that caused this error. Click will + fill in the context automatically in some situations. + """ + + exit_code = 2 + + def __init__(self, message: str, ctx: Context | None = None) -> None: + super().__init__(message) + self.ctx = ctx + self.cmd: Command | None = self.ctx.command if self.ctx else None + + def show(self, file: t.IO[t.Any] | None = None) -> None: + if file is None: + file = get_text_stderr() + color = None + hint = "" + if ( + self.ctx is not None + and self.ctx.command.get_help_option(self.ctx) is not None + ): + hint = _("Try '{command} {option}' for help.").format( + command=self.ctx.command_path, option=self.ctx.help_option_names[0] + ) + hint = f"{hint}\n" + if self.ctx is not None: + color = self.ctx.color + echo(f"{self.ctx.get_usage()}\n{hint}", file=file, color=color) + echo( + _("Error: {message}").format(message=self.format_message()), + file=file, + color=color, + ) + + +class BadParameter(UsageError): + """An exception that formats out a standardized error message for a + bad parameter. This is useful when thrown from a callback or type as + Click will attach contextual information to it (for instance, which + parameter it is). + + .. versionadded:: 2.0 + + :param param: the parameter object that caused this error. This can + be left out, and Click will attach this info itself + if possible. + :param param_hint: a string that shows up as parameter name. This + can be used as alternative to `param` in cases + where custom validation should happen. If it is + a string it's used as such, if it's a list then + each item is quoted and separated. + """ + + def __init__( + self, + message: str, + ctx: Context | None = None, + param: Parameter | None = None, + param_hint: str | None = None, + ) -> None: + super().__init__(message, ctx) + self.param = param + self.param_hint = param_hint + + def format_message(self) -> str: + if self.param_hint is not None: + param_hint = self.param_hint + elif self.param is not None: + param_hint = self.param.get_error_hint(self.ctx) # type: ignore + else: + return _("Invalid value: {message}").format(message=self.message) + + return _("Invalid value for {param_hint}: {message}").format( + param_hint=_join_param_hints(param_hint), message=self.message + ) + + +class MissingParameter(BadParameter): + """Raised if click required an option or argument but it was not + provided when invoking the script. + + .. versionadded:: 4.0 + + :param param_type: a string that indicates the type of the parameter. + The default is to inherit the parameter type from + the given `param`. Valid values are ``'parameter'``, + ``'option'`` or ``'argument'``. + """ + + def __init__( + self, + message: str | None = None, + ctx: Context | None = None, + param: Parameter | None = None, + param_hint: str | None = None, + param_type: str | None = None, + ) -> None: + super().__init__(message or "", ctx, param, param_hint) + self.param_type = param_type + + def format_message(self) -> str: + if self.param_hint is not None: + param_hint: str | None = self.param_hint + elif self.param is not None: + param_hint = self.param.get_error_hint(self.ctx) # type: ignore + else: + param_hint = None + + param_hint = _join_param_hints(param_hint) + param_hint = f" {param_hint}" if param_hint else "" + + param_type = self.param_type + if param_type is None and self.param is not None: + param_type = self.param.param_type_name + + msg = self.message + if self.param is not None: + msg_extra = self.param.type.get_missing_message( + param=self.param, ctx=self.ctx + ) + if msg_extra: + if msg: + msg += f". {msg_extra}" + else: + msg = msg_extra + + msg = f" {msg}" if msg else "" + + # Translate param_type for known types. + if param_type == "argument": + missing = _("Missing argument") + elif param_type == "option": + missing = _("Missing option") + elif param_type == "parameter": + missing = _("Missing parameter") + else: + missing = _("Missing {param_type}").format(param_type=param_type) + + return f"{missing}{param_hint}.{msg}" + + def __str__(self) -> str: + if not self.message: + param_name = self.param.name if self.param else None + return _("Missing parameter: {param_name}").format(param_name=param_name) + else: + return self.message + + +class NoSuchOption(UsageError): + """Raised if click attempted to handle an option that does not + exist. + + .. versionadded:: 4.0 + """ + + def __init__( + self, + option_name: str, + message: str | None = None, + possibilities: cabc.Sequence[str] | None = None, + ctx: Context | None = None, + ) -> None: + if message is None: + message = _("No such option: {name}").format(name=option_name) + + super().__init__(message, ctx) + self.option_name = option_name + self.possibilities = possibilities + + def format_message(self) -> str: + if not self.possibilities: + return self.message + + possibility_str = ", ".join(sorted(self.possibilities)) + suggest = ngettext( + "Did you mean {possibility}?", + "(Possible options: {possibilities})", + len(self.possibilities), + ).format(possibility=possibility_str, possibilities=possibility_str) + return f"{self.message} {suggest}" + + +class BadOptionUsage(UsageError): + """Raised if an option is generally supplied but the use of the option + was incorrect. This is for instance raised if the number of arguments + for an option is not correct. + + .. versionadded:: 4.0 + + :param option_name: the name of the option being used incorrectly. + """ + + def __init__( + self, option_name: str, message: str, ctx: Context | None = None + ) -> None: + super().__init__(message, ctx) + self.option_name = option_name + + +class BadArgumentUsage(UsageError): + """Raised if an argument is generally supplied but the use of the argument + was incorrect. This is for instance raised if the number of values + for an argument is not correct. + + .. versionadded:: 6.0 + """ + + +class NoArgsIsHelpError(UsageError): + def __init__(self, ctx: Context) -> None: + self.ctx: Context + super().__init__(ctx.get_help(), ctx=ctx) + + def show(self, file: t.IO[t.Any] | None = None) -> None: + echo(self.format_message(), file=file, err=True, color=self.ctx.color) + + +class FileError(ClickException): + """Raised if a file cannot be opened.""" + + def __init__(self, filename: str, hint: str | None = None) -> None: + if hint is None: + hint = _("unknown error") + + super().__init__(hint) + self.ui_filename: str = format_filename(filename) + self.filename = filename + + def format_message(self) -> str: + return _("Could not open file {filename!r}: {message}").format( + filename=self.ui_filename, message=self.message + ) + + +class Abort(RuntimeError): + """An internal signalling exception that signals Click to abort.""" + + +class Exit(RuntimeError): + """An exception that indicates that the application should exit with some + status code. + + :param code: the status code to exit with. + """ + + __slots__ = ("exit_code",) + + def __init__(self, code: int = 0) -> None: + self.exit_code: int = code diff --git a/venv/Lib/site-packages/click/formatting.py b/venv/Lib/site-packages/click/formatting.py new file mode 100644 index 0000000000000000000000000000000000000000..9891f8809feff24a529ce47a860589c129835322 --- /dev/null +++ b/venv/Lib/site-packages/click/formatting.py @@ -0,0 +1,301 @@ +from __future__ import annotations + +import collections.abc as cabc +from contextlib import contextmanager +from gettext import gettext as _ + +from ._compat import term_len +from .parser import _split_opt + +# Can force a width. This is used by the test system +FORCED_WIDTH: int | None = None + + +def measure_table(rows: cabc.Iterable[tuple[str, str]]) -> tuple[int, ...]: + widths: dict[int, int] = {} + + for row in rows: + for idx, col in enumerate(row): + widths[idx] = max(widths.get(idx, 0), term_len(col)) + + return tuple(y for x, y in sorted(widths.items())) + + +def iter_rows( + rows: cabc.Iterable[tuple[str, str]], col_count: int +) -> cabc.Iterator[tuple[str, ...]]: + for row in rows: + yield row + ("",) * (col_count - len(row)) + + +def wrap_text( + text: str, + width: int = 78, + initial_indent: str = "", + subsequent_indent: str = "", + preserve_paragraphs: bool = False, +) -> str: + """A helper function that intelligently wraps text. By default, it + assumes that it operates on a single paragraph of text but if the + `preserve_paragraphs` parameter is provided it will intelligently + handle paragraphs (defined by two empty lines). + + If paragraphs are handled, a paragraph can be prefixed with an empty + line containing the ``\\b`` character (``\\x08``) to indicate that + no rewrapping should happen in that block. + + :param text: the text that should be rewrapped. + :param width: the maximum width for the text. + :param initial_indent: the initial indent that should be placed on the + first line as a string. + :param subsequent_indent: the indent string that should be placed on + each consecutive line. + :param preserve_paragraphs: if this flag is set then the wrapping will + intelligently handle paragraphs. + """ + from ._textwrap import TextWrapper + + text = text.expandtabs() + wrapper = TextWrapper( + width, + initial_indent=initial_indent, + subsequent_indent=subsequent_indent, + replace_whitespace=False, + ) + if not preserve_paragraphs: + return wrapper.fill(text) + + p: list[tuple[int, bool, str]] = [] + buf: list[str] = [] + indent = None + + def _flush_par() -> None: + if not buf: + return + if buf[0].strip() == "\b": + p.append((indent or 0, True, "\n".join(buf[1:]))) + else: + p.append((indent or 0, False, " ".join(buf))) + del buf[:] + + for line in text.splitlines(): + if not line: + _flush_par() + indent = None + else: + if indent is None: + orig_len = term_len(line) + line = line.lstrip() + indent = orig_len - term_len(line) + buf.append(line) + _flush_par() + + rv = [] + for indent, raw, text in p: + with wrapper.extra_indent(" " * indent): + if raw: + rv.append(wrapper.indent_only(text)) + else: + rv.append(wrapper.fill(text)) + + return "\n\n".join(rv) + + +class HelpFormatter: + """This class helps with formatting text-based help pages. It's + usually just needed for very special internal cases, but it's also + exposed so that developers can write their own fancy outputs. + + At present, it always writes into memory. + + :param indent_increment: the additional increment for each level. + :param width: the width for the text. This defaults to the terminal + width clamped to a maximum of 78. + """ + + def __init__( + self, + indent_increment: int = 2, + width: int | None = None, + max_width: int | None = None, + ) -> None: + import shutil + + self.indent_increment = indent_increment + if max_width is None: + max_width = 80 + if width is None: + width = FORCED_WIDTH + if width is None: + width = max(min(shutil.get_terminal_size().columns, max_width) - 2, 50) + self.width = width + self.current_indent: int = 0 + self.buffer: list[str] = [] + + def write(self, string: str) -> None: + """Writes a unicode string into the internal buffer.""" + self.buffer.append(string) + + def indent(self) -> None: + """Increases the indentation.""" + self.current_indent += self.indent_increment + + def dedent(self) -> None: + """Decreases the indentation.""" + self.current_indent -= self.indent_increment + + def write_usage(self, prog: str, args: str = "", prefix: str | None = None) -> None: + """Writes a usage line into the buffer. + + :param prog: the program name. + :param args: whitespace separated list of arguments. + :param prefix: The prefix for the first line. Defaults to + ``"Usage: "``. + """ + if prefix is None: + prefix = f"{_('Usage:')} " + + usage_prefix = f"{prefix:>{self.current_indent}}{prog} " + text_width = self.width - self.current_indent + + if text_width >= (term_len(usage_prefix) + 20): + # The arguments will fit to the right of the prefix. + indent = " " * term_len(usage_prefix) + self.write( + wrap_text( + args, + text_width, + initial_indent=usage_prefix, + subsequent_indent=indent, + ) + ) + else: + # The prefix is too long, put the arguments on the next line. + self.write(usage_prefix) + self.write("\n") + indent = " " * (max(self.current_indent, term_len(prefix)) + 4) + self.write( + wrap_text( + args, text_width, initial_indent=indent, subsequent_indent=indent + ) + ) + + self.write("\n") + + def write_heading(self, heading: str) -> None: + """Writes a heading into the buffer.""" + self.write(f"{'':>{self.current_indent}}{heading}:\n") + + def write_paragraph(self) -> None: + """Writes a paragraph into the buffer.""" + if self.buffer: + self.write("\n") + + def write_text(self, text: str) -> None: + """Writes re-indented text into the buffer. This rewraps and + preserves paragraphs. + """ + indent = " " * self.current_indent + self.write( + wrap_text( + text, + self.width, + initial_indent=indent, + subsequent_indent=indent, + preserve_paragraphs=True, + ) + ) + self.write("\n") + + def write_dl( + self, + rows: cabc.Sequence[tuple[str, str]], + col_max: int = 30, + col_spacing: int = 2, + ) -> None: + """Writes a definition list into the buffer. This is how options + and commands are usually formatted. + + :param rows: a list of two item tuples for the terms and values. + :param col_max: the maximum width of the first column. + :param col_spacing: the number of spaces between the first and + second column. + """ + rows = list(rows) + widths = measure_table(rows) + if len(widths) != 2: + raise TypeError("Expected two columns for definition list") + + first_col = min(widths[0], col_max) + col_spacing + + for first, second in iter_rows(rows, len(widths)): + self.write(f"{'':>{self.current_indent}}{first}") + if not second: + self.write("\n") + continue + if term_len(first) <= first_col - col_spacing: + self.write(" " * (first_col - term_len(first))) + else: + self.write("\n") + self.write(" " * (first_col + self.current_indent)) + + text_width = max(self.width - first_col - 2, 10) + wrapped_text = wrap_text(second, text_width, preserve_paragraphs=True) + lines = wrapped_text.splitlines() + + if lines: + self.write(f"{lines[0]}\n") + + for line in lines[1:]: + self.write(f"{'':>{first_col + self.current_indent}}{line}\n") + else: + self.write("\n") + + @contextmanager + def section(self, name: str) -> cabc.Iterator[None]: + """Helpful context manager that writes a paragraph, a heading, + and the indents. + + :param name: the section name that is written as heading. + """ + self.write_paragraph() + self.write_heading(name) + self.indent() + try: + yield + finally: + self.dedent() + + @contextmanager + def indentation(self) -> cabc.Iterator[None]: + """A context manager that increases the indentation.""" + self.indent() + try: + yield + finally: + self.dedent() + + def getvalue(self) -> str: + """Returns the buffer contents.""" + return "".join(self.buffer) + + +def join_options(options: cabc.Sequence[str]) -> tuple[str, bool]: + """Given a list of option strings this joins them in the most appropriate + way and returns them in the form ``(formatted_string, + any_prefix_is_slash)`` where the second item in the tuple is a flag that + indicates if any of the option prefixes was a slash. + """ + rv = [] + any_prefix_is_slash = False + + for opt in options: + prefix = _split_opt(opt)[0] + + if prefix == "/": + any_prefix_is_slash = True + + rv.append((len(prefix), opt)) + + rv.sort(key=lambda x: x[0]) + return ", ".join(x[1] for x in rv), any_prefix_is_slash diff --git a/venv/Lib/site-packages/click/globals.py b/venv/Lib/site-packages/click/globals.py new file mode 100644 index 0000000000000000000000000000000000000000..a2f91723d21cefdf658be327174e1f8ccdc20fcd --- /dev/null +++ b/venv/Lib/site-packages/click/globals.py @@ -0,0 +1,67 @@ +from __future__ import annotations + +import typing as t +from threading import local + +if t.TYPE_CHECKING: + from .core import Context + +_local = local() + + +@t.overload +def get_current_context(silent: t.Literal[False] = False) -> Context: ... + + +@t.overload +def get_current_context(silent: bool = ...) -> Context | None: ... + + +def get_current_context(silent: bool = False) -> Context | None: + """Returns the current click context. This can be used as a way to + access the current context object from anywhere. This is a more implicit + alternative to the :func:`pass_context` decorator. This function is + primarily useful for helpers such as :func:`echo` which might be + interested in changing its behavior based on the current context. + + To push the current context, :meth:`Context.scope` can be used. + + .. versionadded:: 5.0 + + :param silent: if set to `True` the return value is `None` if no context + is available. The default behavior is to raise a + :exc:`RuntimeError`. + """ + try: + return t.cast("Context", _local.stack[-1]) + except (AttributeError, IndexError) as e: + if not silent: + raise RuntimeError("There is no active click context.") from e + + return None + + +def push_context(ctx: Context) -> None: + """Pushes a new context to the current stack.""" + _local.__dict__.setdefault("stack", []).append(ctx) + + +def pop_context() -> None: + """Removes the top level from the stack.""" + _local.stack.pop() + + +def resolve_color_default(color: bool | None = None) -> bool | None: + """Internal helper to get the default value of the color flag. If a + value is passed it's returned unchanged, otherwise it's looked up from + the current context. + """ + if color is not None: + return color + + ctx = get_current_context(silent=True) + + if ctx is not None: + return ctx.color + + return None diff --git a/venv/Lib/site-packages/click/parser.py b/venv/Lib/site-packages/click/parser.py new file mode 100644 index 0000000000000000000000000000000000000000..a8b7d2634a89df3c9e0b7a1f85dfd4bace60a608 --- /dev/null +++ b/venv/Lib/site-packages/click/parser.py @@ -0,0 +1,532 @@ +""" +This module started out as largely a copy paste from the stdlib's +optparse module with the features removed that we do not need from +optparse because we implement them in Click on a higher level (for +instance type handling, help formatting and a lot more). + +The plan is to remove more and more from here over time. + +The reason this is a different module and not optparse from the stdlib +is that there are differences in 2.x and 3.x about the error messages +generated and optparse in the stdlib uses gettext for no good reason +and might cause us issues. + +Click uses parts of optparse written by Gregory P. Ward and maintained +by the Python Software Foundation. This is limited to code in parser.py. + +Copyright 2001-2006 Gregory P. Ward. All rights reserved. +Copyright 2002-2006 Python Software Foundation. All rights reserved. +""" + +# This code uses parts of optparse written by Gregory P. Ward and +# maintained by the Python Software Foundation. +# Copyright 2001-2006 Gregory P. Ward +# Copyright 2002-2006 Python Software Foundation +from __future__ import annotations + +import collections.abc as cabc +import typing as t +from collections import deque +from gettext import gettext as _ +from gettext import ngettext + +from .exceptions import BadArgumentUsage +from .exceptions import BadOptionUsage +from .exceptions import NoSuchOption +from .exceptions import UsageError + +if t.TYPE_CHECKING: + from .core import Argument as CoreArgument + from .core import Context + from .core import Option as CoreOption + from .core import Parameter as CoreParameter + +V = t.TypeVar("V") + +# Sentinel value that indicates an option was passed as a flag without a +# value but is not a flag option. Option.consume_value uses this to +# prompt or use the flag_value. +_flag_needs_value = object() + + +def _unpack_args( + args: cabc.Sequence[str], nargs_spec: cabc.Sequence[int] +) -> tuple[cabc.Sequence[str | cabc.Sequence[str | None] | None], list[str]]: + """Given an iterable of arguments and an iterable of nargs specifications, + it returns a tuple with all the unpacked arguments at the first index + and all remaining arguments as the second. + + The nargs specification is the number of arguments that should be consumed + or `-1` to indicate that this position should eat up all the remainders. + + Missing items are filled with `None`. + """ + args = deque(args) + nargs_spec = deque(nargs_spec) + rv: list[str | tuple[str | None, ...] | None] = [] + spos: int | None = None + + def _fetch(c: deque[V]) -> V | None: + try: + if spos is None: + return c.popleft() + else: + return c.pop() + except IndexError: + return None + + while nargs_spec: + nargs = _fetch(nargs_spec) + + if nargs is None: + continue + + if nargs == 1: + rv.append(_fetch(args)) + elif nargs > 1: + x = [_fetch(args) for _ in range(nargs)] + + # If we're reversed, we're pulling in the arguments in reverse, + # so we need to turn them around. + if spos is not None: + x.reverse() + + rv.append(tuple(x)) + elif nargs < 0: + if spos is not None: + raise TypeError("Cannot have two nargs < 0") + + spos = len(rv) + rv.append(None) + + # spos is the position of the wildcard (star). If it's not `None`, + # we fill it with the remainder. + if spos is not None: + rv[spos] = tuple(args) + args = [] + rv[spos + 1 :] = reversed(rv[spos + 1 :]) + + return tuple(rv), list(args) + + +def _split_opt(opt: str) -> tuple[str, str]: + first = opt[:1] + if first.isalnum(): + return "", opt + if opt[1:2] == first: + return opt[:2], opt[2:] + return first, opt[1:] + + +def _normalize_opt(opt: str, ctx: Context | None) -> str: + if ctx is None or ctx.token_normalize_func is None: + return opt + prefix, opt = _split_opt(opt) + return f"{prefix}{ctx.token_normalize_func(opt)}" + + +class _Option: + def __init__( + self, + obj: CoreOption, + opts: cabc.Sequence[str], + dest: str | None, + action: str | None = None, + nargs: int = 1, + const: t.Any | None = None, + ): + self._short_opts = [] + self._long_opts = [] + self.prefixes: set[str] = set() + + for opt in opts: + prefix, value = _split_opt(opt) + if not prefix: + raise ValueError(f"Invalid start character for option ({opt})") + self.prefixes.add(prefix[0]) + if len(prefix) == 1 and len(value) == 1: + self._short_opts.append(opt) + else: + self._long_opts.append(opt) + self.prefixes.add(prefix) + + if action is None: + action = "store" + + self.dest = dest + self.action = action + self.nargs = nargs + self.const = const + self.obj = obj + + @property + def takes_value(self) -> bool: + return self.action in ("store", "append") + + def process(self, value: t.Any, state: _ParsingState) -> None: + if self.action == "store": + state.opts[self.dest] = value # type: ignore + elif self.action == "store_const": + state.opts[self.dest] = self.const # type: ignore + elif self.action == "append": + state.opts.setdefault(self.dest, []).append(value) # type: ignore + elif self.action == "append_const": + state.opts.setdefault(self.dest, []).append(self.const) # type: ignore + elif self.action == "count": + state.opts[self.dest] = state.opts.get(self.dest, 0) + 1 # type: ignore + else: + raise ValueError(f"unknown action '{self.action}'") + state.order.append(self.obj) + + +class _Argument: + def __init__(self, obj: CoreArgument, dest: str | None, nargs: int = 1): + self.dest = dest + self.nargs = nargs + self.obj = obj + + def process( + self, + value: str | cabc.Sequence[str | None] | None, + state: _ParsingState, + ) -> None: + if self.nargs > 1: + assert value is not None + holes = sum(1 for x in value if x is None) + if holes == len(value): + value = None + elif holes != 0: + raise BadArgumentUsage( + _("Argument {name!r} takes {nargs} values.").format( + name=self.dest, nargs=self.nargs + ) + ) + + if self.nargs == -1 and self.obj.envvar is not None and value == (): + # Replace empty tuple with None so that a value from the + # environment may be tried. + value = None + + state.opts[self.dest] = value # type: ignore + state.order.append(self.obj) + + +class _ParsingState: + def __init__(self, rargs: list[str]) -> None: + self.opts: dict[str, t.Any] = {} + self.largs: list[str] = [] + self.rargs = rargs + self.order: list[CoreParameter] = [] + + +class _OptionParser: + """The option parser is an internal class that is ultimately used to + parse options and arguments. It's modelled after optparse and brings + a similar but vastly simplified API. It should generally not be used + directly as the high level Click classes wrap it for you. + + It's not nearly as extensible as optparse or argparse as it does not + implement features that are implemented on a higher level (such as + types or defaults). + + :param ctx: optionally the :class:`~click.Context` where this parser + should go with. + + .. deprecated:: 8.2 + Will be removed in Click 9.0. + """ + + def __init__(self, ctx: Context | None = None) -> None: + #: The :class:`~click.Context` for this parser. This might be + #: `None` for some advanced use cases. + self.ctx = ctx + #: This controls how the parser deals with interspersed arguments. + #: If this is set to `False`, the parser will stop on the first + #: non-option. Click uses this to implement nested subcommands + #: safely. + self.allow_interspersed_args: bool = True + #: This tells the parser how to deal with unknown options. By + #: default it will error out (which is sensible), but there is a + #: second mode where it will ignore it and continue processing + #: after shifting all the unknown options into the resulting args. + self.ignore_unknown_options: bool = False + + if ctx is not None: + self.allow_interspersed_args = ctx.allow_interspersed_args + self.ignore_unknown_options = ctx.ignore_unknown_options + + self._short_opt: dict[str, _Option] = {} + self._long_opt: dict[str, _Option] = {} + self._opt_prefixes = {"-", "--"} + self._args: list[_Argument] = [] + + def add_option( + self, + obj: CoreOption, + opts: cabc.Sequence[str], + dest: str | None, + action: str | None = None, + nargs: int = 1, + const: t.Any | None = None, + ) -> None: + """Adds a new option named `dest` to the parser. The destination + is not inferred (unlike with optparse) and needs to be explicitly + provided. Action can be any of ``store``, ``store_const``, + ``append``, ``append_const`` or ``count``. + + The `obj` can be used to identify the option in the order list + that is returned from the parser. + """ + opts = [_normalize_opt(opt, self.ctx) for opt in opts] + option = _Option(obj, opts, dest, action=action, nargs=nargs, const=const) + self._opt_prefixes.update(option.prefixes) + for opt in option._short_opts: + self._short_opt[opt] = option + for opt in option._long_opts: + self._long_opt[opt] = option + + def add_argument(self, obj: CoreArgument, dest: str | None, nargs: int = 1) -> None: + """Adds a positional argument named `dest` to the parser. + + The `obj` can be used to identify the option in the order list + that is returned from the parser. + """ + self._args.append(_Argument(obj, dest=dest, nargs=nargs)) + + def parse_args( + self, args: list[str] + ) -> tuple[dict[str, t.Any], list[str], list[CoreParameter]]: + """Parses positional arguments and returns ``(values, args, order)`` + for the parsed options and arguments as well as the leftover + arguments if there are any. The order is a list of objects as they + appear on the command line. If arguments appear multiple times they + will be memorized multiple times as well. + """ + state = _ParsingState(args) + try: + self._process_args_for_options(state) + self._process_args_for_args(state) + except UsageError: + if self.ctx is None or not self.ctx.resilient_parsing: + raise + return state.opts, state.largs, state.order + + def _process_args_for_args(self, state: _ParsingState) -> None: + pargs, args = _unpack_args( + state.largs + state.rargs, [x.nargs for x in self._args] + ) + + for idx, arg in enumerate(self._args): + arg.process(pargs[idx], state) + + state.largs = args + state.rargs = [] + + def _process_args_for_options(self, state: _ParsingState) -> None: + while state.rargs: + arg = state.rargs.pop(0) + arglen = len(arg) + # Double dashes always handled explicitly regardless of what + # prefixes are valid. + if arg == "--": + return + elif arg[:1] in self._opt_prefixes and arglen > 1: + self._process_opts(arg, state) + elif self.allow_interspersed_args: + state.largs.append(arg) + else: + state.rargs.insert(0, arg) + return + + # Say this is the original argument list: + # [arg0, arg1, ..., arg(i-1), arg(i), arg(i+1), ..., arg(N-1)] + # ^ + # (we are about to process arg(i)). + # + # Then rargs is [arg(i), ..., arg(N-1)] and largs is a *subset* of + # [arg0, ..., arg(i-1)] (any options and their arguments will have + # been removed from largs). + # + # The while loop will usually consume 1 or more arguments per pass. + # If it consumes 1 (eg. arg is an option that takes no arguments), + # then after _process_arg() is done the situation is: + # + # largs = subset of [arg0, ..., arg(i)] + # rargs = [arg(i+1), ..., arg(N-1)] + # + # If allow_interspersed_args is false, largs will always be + # *empty* -- still a subset of [arg0, ..., arg(i-1)], but + # not a very interesting subset! + + def _match_long_opt( + self, opt: str, explicit_value: str | None, state: _ParsingState + ) -> None: + if opt not in self._long_opt: + from difflib import get_close_matches + + possibilities = get_close_matches(opt, self._long_opt) + raise NoSuchOption(opt, possibilities=possibilities, ctx=self.ctx) + + option = self._long_opt[opt] + if option.takes_value: + # At this point it's safe to modify rargs by injecting the + # explicit value, because no exception is raised in this + # branch. This means that the inserted value will be fully + # consumed. + if explicit_value is not None: + state.rargs.insert(0, explicit_value) + + value = self._get_value_from_state(opt, option, state) + + elif explicit_value is not None: + raise BadOptionUsage( + opt, _("Option {name!r} does not take a value.").format(name=opt) + ) + + else: + value = None + + option.process(value, state) + + def _match_short_opt(self, arg: str, state: _ParsingState) -> None: + stop = False + i = 1 + prefix = arg[0] + unknown_options = [] + + for ch in arg[1:]: + opt = _normalize_opt(f"{prefix}{ch}", self.ctx) + option = self._short_opt.get(opt) + i += 1 + + if not option: + if self.ignore_unknown_options: + unknown_options.append(ch) + continue + raise NoSuchOption(opt, ctx=self.ctx) + if option.takes_value: + # Any characters left in arg? Pretend they're the + # next arg, and stop consuming characters of arg. + if i < len(arg): + state.rargs.insert(0, arg[i:]) + stop = True + + value = self._get_value_from_state(opt, option, state) + + else: + value = None + + option.process(value, state) + + if stop: + break + + # If we got any unknown options we recombine the string of the + # remaining options and re-attach the prefix, then report that + # to the state as new larg. This way there is basic combinatorics + # that can be achieved while still ignoring unknown arguments. + if self.ignore_unknown_options and unknown_options: + state.largs.append(f"{prefix}{''.join(unknown_options)}") + + def _get_value_from_state( + self, option_name: str, option: _Option, state: _ParsingState + ) -> t.Any: + nargs = option.nargs + + if len(state.rargs) < nargs: + if option.obj._flag_needs_value: + # Option allows omitting the value. + value = _flag_needs_value + else: + raise BadOptionUsage( + option_name, + ngettext( + "Option {name!r} requires an argument.", + "Option {name!r} requires {nargs} arguments.", + nargs, + ).format(name=option_name, nargs=nargs), + ) + elif nargs == 1: + next_rarg = state.rargs[0] + + if ( + option.obj._flag_needs_value + and isinstance(next_rarg, str) + and next_rarg[:1] in self._opt_prefixes + and len(next_rarg) > 1 + ): + # The next arg looks like the start of an option, don't + # use it as the value if omitting the value is allowed. + value = _flag_needs_value + else: + value = state.rargs.pop(0) + else: + value = tuple(state.rargs[:nargs]) + del state.rargs[:nargs] + + return value + + def _process_opts(self, arg: str, state: _ParsingState) -> None: + explicit_value = None + # Long option handling happens in two parts. The first part is + # supporting explicitly attached values. In any case, we will try + # to long match the option first. + if "=" in arg: + long_opt, explicit_value = arg.split("=", 1) + else: + long_opt = arg + norm_long_opt = _normalize_opt(long_opt, self.ctx) + + # At this point we will match the (assumed) long option through + # the long option matching code. Note that this allows options + # like "-foo" to be matched as long options. + try: + self._match_long_opt(norm_long_opt, explicit_value, state) + except NoSuchOption: + # At this point the long option matching failed, and we need + # to try with short options. However there is a special rule + # which says, that if we have a two character options prefix + # (applies to "--foo" for instance), we do not dispatch to the + # short option code and will instead raise the no option + # error. + if arg[:2] not in self._opt_prefixes: + self._match_short_opt(arg, state) + return + + if not self.ignore_unknown_options: + raise + + state.largs.append(arg) + + +def __getattr__(name: str) -> object: + import warnings + + if name in { + "OptionParser", + "Argument", + "Option", + "split_opt", + "normalize_opt", + "ParsingState", + }: + warnings.warn( + f"'parser.{name}' is deprecated and will be removed in Click 9.0." + " The old parser is available in 'optparse'.", + DeprecationWarning, + stacklevel=2, + ) + return globals()[f"_{name}"] + + if name == "split_arg_string": + from .shell_completion import split_arg_string + + warnings.warn( + "Importing 'parser.split_arg_string' is deprecated, it will only be" + " available in 'shell_completion' in Click 9.0.", + DeprecationWarning, + stacklevel=2, + ) + return split_arg_string + + raise AttributeError(name) diff --git a/venv/Lib/site-packages/click/py.typed b/venv/Lib/site-packages/click/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/venv/Lib/site-packages/click/shell_completion.py b/venv/Lib/site-packages/click/shell_completion.py new file mode 100644 index 0000000000000000000000000000000000000000..6c39d5eb3889000b499d37262cc5f7de8b7a443e --- /dev/null +++ b/venv/Lib/site-packages/click/shell_completion.py @@ -0,0 +1,644 @@ +from __future__ import annotations + +import collections.abc as cabc +import os +import re +import typing as t +from gettext import gettext as _ + +from .core import Argument +from .core import Command +from .core import Context +from .core import Group +from .core import Option +from .core import Parameter +from .core import ParameterSource +from .utils import echo + + +def shell_complete( + cli: Command, + ctx_args: cabc.MutableMapping[str, t.Any], + prog_name: str, + complete_var: str, + instruction: str, +) -> int: + """Perform shell completion for the given CLI program. + + :param cli: Command being called. + :param ctx_args: Extra arguments to pass to + ``cli.make_context``. + :param prog_name: Name of the executable in the shell. + :param complete_var: Name of the environment variable that holds + the completion instruction. + :param instruction: Value of ``complete_var`` with the completion + instruction and shell, in the form ``instruction_shell``. + :return: Status code to exit with. + """ + shell, _, instruction = instruction.partition("_") + comp_cls = get_completion_class(shell) + + if comp_cls is None: + return 1 + + comp = comp_cls(cli, ctx_args, prog_name, complete_var) + + if instruction == "source": + echo(comp.source()) + return 0 + + if instruction == "complete": + echo(comp.complete()) + return 0 + + return 1 + + +class CompletionItem: + """Represents a completion value and metadata about the value. The + default metadata is ``type`` to indicate special shell handling, + and ``help`` if a shell supports showing a help string next to the + value. + + Arbitrary parameters can be passed when creating the object, and + accessed using ``item.attr``. If an attribute wasn't passed, + accessing it returns ``None``. + + :param value: The completion suggestion. + :param type: Tells the shell script to provide special completion + support for the type. Click uses ``"dir"`` and ``"file"``. + :param help: String shown next to the value if supported. + :param kwargs: Arbitrary metadata. The built-in implementations + don't use this, but custom type completions paired with custom + shell support could use it. + """ + + __slots__ = ("value", "type", "help", "_info") + + def __init__( + self, + value: t.Any, + type: str = "plain", + help: str | None = None, + **kwargs: t.Any, + ) -> None: + self.value: t.Any = value + self.type: str = type + self.help: str | None = help + self._info = kwargs + + def __getattr__(self, name: str) -> t.Any: + return self._info.get(name) + + +# Only Bash >= 4.4 has the nosort option. +_SOURCE_BASH = """\ +%(complete_func)s() { + local IFS=$'\\n' + local response + + response=$(env COMP_WORDS="${COMP_WORDS[*]}" COMP_CWORD=$COMP_CWORD \ +%(complete_var)s=bash_complete $1) + + for completion in $response; do + IFS=',' read type value <<< "$completion" + + if [[ $type == 'dir' ]]; then + COMPREPLY=() + compopt -o dirnames + elif [[ $type == 'file' ]]; then + COMPREPLY=() + compopt -o default + elif [[ $type == 'plain' ]]; then + COMPREPLY+=($value) + fi + done + + return 0 +} + +%(complete_func)s_setup() { + complete -o nosort -F %(complete_func)s %(prog_name)s +} + +%(complete_func)s_setup; +""" + +_SOURCE_ZSH = """\ +#compdef %(prog_name)s + +%(complete_func)s() { + local -a completions + local -a completions_with_descriptions + local -a response + (( ! $+commands[%(prog_name)s] )) && return 1 + + response=("${(@f)$(env COMP_WORDS="${words[*]}" COMP_CWORD=$((CURRENT-1)) \ +%(complete_var)s=zsh_complete %(prog_name)s)}") + + for type key descr in ${response}; do + if [[ "$type" == "plain" ]]; then + if [[ "$descr" == "_" ]]; then + completions+=("$key") + else + completions_with_descriptions+=("$key":"$descr") + fi + elif [[ "$type" == "dir" ]]; then + _path_files -/ + elif [[ "$type" == "file" ]]; then + _path_files -f + fi + done + + if [ -n "$completions_with_descriptions" ]; then + _describe -V unsorted completions_with_descriptions -U + fi + + if [ -n "$completions" ]; then + compadd -U -V unsorted -a completions + fi +} + +if [[ $zsh_eval_context[-1] == loadautofunc ]]; then + # autoload from fpath, call function directly + %(complete_func)s "$@" +else + # eval/source/. command, register function for later + compdef %(complete_func)s %(prog_name)s +fi +""" + +_SOURCE_FISH = """\ +function %(complete_func)s; + set -l response (env %(complete_var)s=fish_complete COMP_WORDS=(commandline -cp) \ +COMP_CWORD=(commandline -t) %(prog_name)s); + + for completion in $response; + set -l metadata (string split "," $completion); + + if test $metadata[1] = "dir"; + __fish_complete_directories $metadata[2]; + else if test $metadata[1] = "file"; + __fish_complete_path $metadata[2]; + else if test $metadata[1] = "plain"; + echo $metadata[2]; + end; + end; +end; + +complete --no-files --command %(prog_name)s --arguments \ +"(%(complete_func)s)"; +""" + + +class ShellComplete: + """Base class for providing shell completion support. A subclass for + a given shell will override attributes and methods to implement the + completion instructions (``source`` and ``complete``). + + :param cli: Command being called. + :param prog_name: Name of the executable in the shell. + :param complete_var: Name of the environment variable that holds + the completion instruction. + + .. versionadded:: 8.0 + """ + + name: t.ClassVar[str] + """Name to register the shell as with :func:`add_completion_class`. + This is used in completion instructions (``{name}_source`` and + ``{name}_complete``). + """ + + source_template: t.ClassVar[str] + """Completion script template formatted by :meth:`source`. This must + be provided by subclasses. + """ + + def __init__( + self, + cli: Command, + ctx_args: cabc.MutableMapping[str, t.Any], + prog_name: str, + complete_var: str, + ) -> None: + self.cli = cli + self.ctx_args = ctx_args + self.prog_name = prog_name + self.complete_var = complete_var + + @property + def func_name(self) -> str: + """The name of the shell function defined by the completion + script. + """ + safe_name = re.sub(r"\W*", "", self.prog_name.replace("-", "_"), flags=re.ASCII) + return f"_{safe_name}_completion" + + def source_vars(self) -> dict[str, t.Any]: + """Vars for formatting :attr:`source_template`. + + By default this provides ``complete_func``, ``complete_var``, + and ``prog_name``. + """ + return { + "complete_func": self.func_name, + "complete_var": self.complete_var, + "prog_name": self.prog_name, + } + + def source(self) -> str: + """Produce the shell script that defines the completion + function. By default this ``%``-style formats + :attr:`source_template` with the dict returned by + :meth:`source_vars`. + """ + return self.source_template % self.source_vars() + + def get_completion_args(self) -> tuple[list[str], str]: + """Use the env vars defined by the shell script to return a + tuple of ``args, incomplete``. This must be implemented by + subclasses. + """ + raise NotImplementedError + + def get_completions(self, args: list[str], incomplete: str) -> list[CompletionItem]: + """Determine the context and last complete command or parameter + from the complete args. Call that object's ``shell_complete`` + method to get the completions for the incomplete value. + + :param args: List of complete args before the incomplete value. + :param incomplete: Value being completed. May be empty. + """ + ctx = _resolve_context(self.cli, self.ctx_args, self.prog_name, args) + obj, incomplete = _resolve_incomplete(ctx, args, incomplete) + return obj.shell_complete(ctx, incomplete) + + def format_completion(self, item: CompletionItem) -> str: + """Format a completion item into the form recognized by the + shell script. This must be implemented by subclasses. + + :param item: Completion item to format. + """ + raise NotImplementedError + + def complete(self) -> str: + """Produce the completion data to send back to the shell. + + By default this calls :meth:`get_completion_args`, gets the + completions, then calls :meth:`format_completion` for each + completion. + """ + args, incomplete = self.get_completion_args() + completions = self.get_completions(args, incomplete) + out = [self.format_completion(item) for item in completions] + return "\n".join(out) + + +class BashComplete(ShellComplete): + """Shell completion for Bash.""" + + name = "bash" + source_template = _SOURCE_BASH + + @staticmethod + def _check_version() -> None: + import shutil + import subprocess + + bash_exe = shutil.which("bash") + + if bash_exe is None: + match = None + else: + output = subprocess.run( + [bash_exe, "--norc", "-c", 'echo "${BASH_VERSION}"'], + stdout=subprocess.PIPE, + ) + match = re.search(r"^(\d+)\.(\d+)\.\d+", output.stdout.decode()) + + if match is not None: + major, minor = match.groups() + + if major < "4" or major == "4" and minor < "4": + echo( + _( + "Shell completion is not supported for Bash" + " versions older than 4.4." + ), + err=True, + ) + else: + echo( + _("Couldn't detect Bash version, shell completion is not supported."), + err=True, + ) + + def source(self) -> str: + self._check_version() + return super().source() + + def get_completion_args(self) -> tuple[list[str], str]: + cwords = split_arg_string(os.environ["COMP_WORDS"]) + cword = int(os.environ["COMP_CWORD"]) + args = cwords[1:cword] + + try: + incomplete = cwords[cword] + except IndexError: + incomplete = "" + + return args, incomplete + + def format_completion(self, item: CompletionItem) -> str: + return f"{item.type},{item.value}" + + +class ZshComplete(ShellComplete): + """Shell completion for Zsh.""" + + name = "zsh" + source_template = _SOURCE_ZSH + + def get_completion_args(self) -> tuple[list[str], str]: + cwords = split_arg_string(os.environ["COMP_WORDS"]) + cword = int(os.environ["COMP_CWORD"]) + args = cwords[1:cword] + + try: + incomplete = cwords[cword] + except IndexError: + incomplete = "" + + return args, incomplete + + def format_completion(self, item: CompletionItem) -> str: + return f"{item.type}\n{item.value}\n{item.help if item.help else '_'}" + + +class FishComplete(ShellComplete): + """Shell completion for Fish.""" + + name = "fish" + source_template = _SOURCE_FISH + + def get_completion_args(self) -> tuple[list[str], str]: + cwords = split_arg_string(os.environ["COMP_WORDS"]) + incomplete = os.environ["COMP_CWORD"] + args = cwords[1:] + + # Fish stores the partial word in both COMP_WORDS and + # COMP_CWORD, remove it from complete args. + if incomplete and args and args[-1] == incomplete: + args.pop() + + return args, incomplete + + def format_completion(self, item: CompletionItem) -> str: + if item.help: + return f"{item.type},{item.value}\t{item.help}" + + return f"{item.type},{item.value}" + + +ShellCompleteType = t.TypeVar("ShellCompleteType", bound="type[ShellComplete]") + + +_available_shells: dict[str, type[ShellComplete]] = { + "bash": BashComplete, + "fish": FishComplete, + "zsh": ZshComplete, +} + + +def add_completion_class( + cls: ShellCompleteType, name: str | None = None +) -> ShellCompleteType: + """Register a :class:`ShellComplete` subclass under the given name. + The name will be provided by the completion instruction environment + variable during completion. + + :param cls: The completion class that will handle completion for the + shell. + :param name: Name to register the class under. Defaults to the + class's ``name`` attribute. + """ + if name is None: + name = cls.name + + _available_shells[name] = cls + + return cls + + +def get_completion_class(shell: str) -> type[ShellComplete] | None: + """Look up a registered :class:`ShellComplete` subclass by the name + provided by the completion instruction environment variable. If the + name isn't registered, returns ``None``. + + :param shell: Name the class is registered under. + """ + return _available_shells.get(shell) + + +def split_arg_string(string: str) -> list[str]: + """Split an argument string as with :func:`shlex.split`, but don't + fail if the string is incomplete. Ignores a missing closing quote or + incomplete escape sequence and uses the partial token as-is. + + .. code-block:: python + + split_arg_string("example 'my file") + ["example", "my file"] + + split_arg_string("example my\\") + ["example", "my"] + + :param string: String to split. + + .. versionchanged:: 8.2 + Moved to ``shell_completion`` from ``parser``. + """ + import shlex + + lex = shlex.shlex(string, posix=True) + lex.whitespace_split = True + lex.commenters = "" + out = [] + + try: + for token in lex: + out.append(token) + except ValueError: + # Raised when end-of-string is reached in an invalid state. Use + # the partial token as-is. The quote or escape character is in + # lex.state, not lex.token. + out.append(lex.token) + + return out + + +def _is_incomplete_argument(ctx: Context, param: Parameter) -> bool: + """Determine if the given parameter is an argument that can still + accept values. + + :param ctx: Invocation context for the command represented by the + parsed complete args. + :param param: Argument object being checked. + """ + if not isinstance(param, Argument): + return False + + assert param.name is not None + # Will be None if expose_value is False. + value = ctx.params.get(param.name) + return ( + param.nargs == -1 + or ctx.get_parameter_source(param.name) is not ParameterSource.COMMANDLINE + or ( + param.nargs > 1 + and isinstance(value, (tuple, list)) + and len(value) < param.nargs + ) + ) + + +def _start_of_option(ctx: Context, value: str) -> bool: + """Check if the value looks like the start of an option.""" + if not value: + return False + + c = value[0] + return c in ctx._opt_prefixes + + +def _is_incomplete_option(ctx: Context, args: list[str], param: Parameter) -> bool: + """Determine if the given parameter is an option that needs a value. + + :param args: List of complete args before the incomplete value. + :param param: Option object being checked. + """ + if not isinstance(param, Option): + return False + + if param.is_flag or param.count: + return False + + last_option = None + + for index, arg in enumerate(reversed(args)): + if index + 1 > param.nargs: + break + + if _start_of_option(ctx, arg): + last_option = arg + + return last_option is not None and last_option in param.opts + + +def _resolve_context( + cli: Command, + ctx_args: cabc.MutableMapping[str, t.Any], + prog_name: str, + args: list[str], +) -> Context: + """Produce the context hierarchy starting with the command and + traversing the complete arguments. This only follows the commands, + it doesn't trigger input prompts or callbacks. + + :param cli: Command being called. + :param prog_name: Name of the executable in the shell. + :param args: List of complete args before the incomplete value. + """ + ctx_args["resilient_parsing"] = True + with cli.make_context(prog_name, args.copy(), **ctx_args) as ctx: + args = ctx._protected_args + ctx.args + + while args: + command = ctx.command + + if isinstance(command, Group): + if not command.chain: + name, cmd, args = command.resolve_command(ctx, args) + + if cmd is None: + return ctx + + with cmd.make_context( + name, args, parent=ctx, resilient_parsing=True + ) as sub_ctx: + ctx = sub_ctx + args = ctx._protected_args + ctx.args + else: + sub_ctx = ctx + + while args: + name, cmd, args = command.resolve_command(ctx, args) + + if cmd is None: + return ctx + + with cmd.make_context( + name, + args, + parent=ctx, + allow_extra_args=True, + allow_interspersed_args=False, + resilient_parsing=True, + ) as sub_sub_ctx: + sub_ctx = sub_sub_ctx + args = sub_ctx.args + + ctx = sub_ctx + args = [*sub_ctx._protected_args, *sub_ctx.args] + else: + break + + return ctx + + +def _resolve_incomplete( + ctx: Context, args: list[str], incomplete: str +) -> tuple[Command | Parameter, str]: + """Find the Click object that will handle the completion of the + incomplete value. Return the object and the incomplete value. + + :param ctx: Invocation context for the command represented by + the parsed complete args. + :param args: List of complete args before the incomplete value. + :param incomplete: Value being completed. May be empty. + """ + # Different shells treat an "=" between a long option name and + # value differently. Might keep the value joined, return the "=" + # as a separate item, or return the split name and value. Always + # split and discard the "=" to make completion easier. + if incomplete == "=": + incomplete = "" + elif "=" in incomplete and _start_of_option(ctx, incomplete): + name, _, incomplete = incomplete.partition("=") + args.append(name) + + # The "--" marker tells Click to stop treating values as options + # even if they start with the option character. If it hasn't been + # given and the incomplete arg looks like an option, the current + # command will provide option name completions. + if "--" not in args and _start_of_option(ctx, incomplete): + return ctx.command, incomplete + + params = ctx.command.get_params(ctx) + + # If the last complete arg is an option name with an incomplete + # value, the option will provide value completions. + for param in params: + if _is_incomplete_option(ctx, args, param): + return param, incomplete + + # It's not an option name or value. The first argument without a + # parsed value will provide value completions. + for param in params: + if _is_incomplete_argument(ctx, param): + return param, incomplete + + # There were no unparsed arguments, the command may be a group that + # will provide command name completions. + return ctx.command, incomplete diff --git a/venv/Lib/site-packages/click/termui.py b/venv/Lib/site-packages/click/termui.py new file mode 100644 index 0000000000000000000000000000000000000000..dcbb22216c4bac521eee02fbac97e3b67f302076 --- /dev/null +++ b/venv/Lib/site-packages/click/termui.py @@ -0,0 +1,877 @@ +from __future__ import annotations + +import collections.abc as cabc +import inspect +import io +import itertools +import sys +import typing as t +from contextlib import AbstractContextManager +from gettext import gettext as _ + +from ._compat import isatty +from ._compat import strip_ansi +from .exceptions import Abort +from .exceptions import UsageError +from .globals import resolve_color_default +from .types import Choice +from .types import convert_type +from .types import ParamType +from .utils import echo +from .utils import LazyFile + +if t.TYPE_CHECKING: + from ._termui_impl import ProgressBar + +V = t.TypeVar("V") + +# The prompt functions to use. The doc tools currently override these +# functions to customize how they work. +visible_prompt_func: t.Callable[[str], str] = input + +_ansi_colors = { + "black": 30, + "red": 31, + "green": 32, + "yellow": 33, + "blue": 34, + "magenta": 35, + "cyan": 36, + "white": 37, + "reset": 39, + "bright_black": 90, + "bright_red": 91, + "bright_green": 92, + "bright_yellow": 93, + "bright_blue": 94, + "bright_magenta": 95, + "bright_cyan": 96, + "bright_white": 97, +} +_ansi_reset_all = "\033[0m" + + +def hidden_prompt_func(prompt: str) -> str: + import getpass + + return getpass.getpass(prompt) + + +def _build_prompt( + text: str, + suffix: str, + show_default: bool = False, + default: t.Any | None = None, + show_choices: bool = True, + type: ParamType | None = None, +) -> str: + prompt = text + if type is not None and show_choices and isinstance(type, Choice): + prompt += f" ({', '.join(map(str, type.choices))})" + if default is not None and show_default: + prompt = f"{prompt} [{_format_default(default)}]" + return f"{prompt}{suffix}" + + +def _format_default(default: t.Any) -> t.Any: + if isinstance(default, (io.IOBase, LazyFile)) and hasattr(default, "name"): + return default.name + + return default + + +def prompt( + text: str, + default: t.Any | None = None, + hide_input: bool = False, + confirmation_prompt: bool | str = False, + type: ParamType | t.Any | None = None, + value_proc: t.Callable[[str], t.Any] | None = None, + prompt_suffix: str = ": ", + show_default: bool = True, + err: bool = False, + show_choices: bool = True, +) -> t.Any: + """Prompts a user for input. This is a convenience function that can + be used to prompt a user for input later. + + If the user aborts the input by sending an interrupt signal, this + function will catch it and raise a :exc:`Abort` exception. + + :param text: the text to show for the prompt. + :param default: the default value to use if no input happens. If this + is not given it will prompt until it's aborted. + :param hide_input: if this is set to true then the input value will + be hidden. + :param confirmation_prompt: Prompt a second time to confirm the + value. Can be set to a string instead of ``True`` to customize + the message. + :param type: the type to use to check the value against. + :param value_proc: if this parameter is provided it's a function that + is invoked instead of the type conversion to + convert a value. + :param prompt_suffix: a suffix that should be added to the prompt. + :param show_default: shows or hides the default value in the prompt. + :param err: if set to true the file defaults to ``stderr`` instead of + ``stdout``, the same as with echo. + :param show_choices: Show or hide choices if the passed type is a Choice. + For example if type is a Choice of either day or week, + show_choices is true and text is "Group by" then the + prompt will be "Group by (day, week): ". + + .. versionadded:: 8.0 + ``confirmation_prompt`` can be a custom string. + + .. versionadded:: 7.0 + Added the ``show_choices`` parameter. + + .. versionadded:: 6.0 + Added unicode support for cmd.exe on Windows. + + .. versionadded:: 4.0 + Added the `err` parameter. + + """ + + def prompt_func(text: str) -> str: + f = hidden_prompt_func if hide_input else visible_prompt_func + try: + # Write the prompt separately so that we get nice + # coloring through colorama on Windows + echo(text.rstrip(" "), nl=False, err=err) + # Echo a space to stdout to work around an issue where + # readline causes backspace to clear the whole line. + return f(" ") + except (KeyboardInterrupt, EOFError): + # getpass doesn't print a newline if the user aborts input with ^C. + # Allegedly this behavior is inherited from getpass(3). + # A doc bug has been filed at https://bugs.python.org/issue24711 + if hide_input: + echo(None, err=err) + raise Abort() from None + + if value_proc is None: + value_proc = convert_type(type, default) + + prompt = _build_prompt( + text, prompt_suffix, show_default, default, show_choices, type + ) + + if confirmation_prompt: + if confirmation_prompt is True: + confirmation_prompt = _("Repeat for confirmation") + + confirmation_prompt = _build_prompt(confirmation_prompt, prompt_suffix) + + while True: + while True: + value = prompt_func(prompt) + if value: + break + elif default is not None: + value = default + break + try: + result = value_proc(value) + except UsageError as e: + if hide_input: + echo(_("Error: The value you entered was invalid."), err=err) + else: + echo(_("Error: {e.message}").format(e=e), err=err) + continue + if not confirmation_prompt: + return result + while True: + value2 = prompt_func(confirmation_prompt) + is_empty = not value and not value2 + if value2 or is_empty: + break + if value == value2: + return result + echo(_("Error: The two entered values do not match."), err=err) + + +def confirm( + text: str, + default: bool | None = False, + abort: bool = False, + prompt_suffix: str = ": ", + show_default: bool = True, + err: bool = False, +) -> bool: + """Prompts for confirmation (yes/no question). + + If the user aborts the input by sending a interrupt signal this + function will catch it and raise a :exc:`Abort` exception. + + :param text: the question to ask. + :param default: The default value to use when no input is given. If + ``None``, repeat until input is given. + :param abort: if this is set to `True` a negative answer aborts the + exception by raising :exc:`Abort`. + :param prompt_suffix: a suffix that should be added to the prompt. + :param show_default: shows or hides the default value in the prompt. + :param err: if set to true the file defaults to ``stderr`` instead of + ``stdout``, the same as with echo. + + .. versionchanged:: 8.0 + Repeat until input is given if ``default`` is ``None``. + + .. versionadded:: 4.0 + Added the ``err`` parameter. + """ + prompt = _build_prompt( + text, + prompt_suffix, + show_default, + "y/n" if default is None else ("Y/n" if default else "y/N"), + ) + + while True: + try: + # Write the prompt separately so that we get nice + # coloring through colorama on Windows + echo(prompt.rstrip(" "), nl=False, err=err) + # Echo a space to stdout to work around an issue where + # readline causes backspace to clear the whole line. + value = visible_prompt_func(" ").lower().strip() + except (KeyboardInterrupt, EOFError): + raise Abort() from None + if value in ("y", "yes"): + rv = True + elif value in ("n", "no"): + rv = False + elif default is not None and value == "": + rv = default + else: + echo(_("Error: invalid input"), err=err) + continue + break + if abort and not rv: + raise Abort() + return rv + + +def echo_via_pager( + text_or_generator: cabc.Iterable[str] | t.Callable[[], cabc.Iterable[str]] | str, + color: bool | None = None, +) -> None: + """This function takes a text and shows it via an environment specific + pager on stdout. + + .. versionchanged:: 3.0 + Added the `color` flag. + + :param text_or_generator: the text to page, or alternatively, a + generator emitting the text to page. + :param color: controls if the pager supports ANSI colors or not. The + default is autodetection. + """ + color = resolve_color_default(color) + + if inspect.isgeneratorfunction(text_or_generator): + i = t.cast("t.Callable[[], cabc.Iterable[str]]", text_or_generator)() + elif isinstance(text_or_generator, str): + i = [text_or_generator] + else: + i = iter(t.cast("cabc.Iterable[str]", text_or_generator)) + + # convert every element of i to a text type if necessary + text_generator = (el if isinstance(el, str) else str(el) for el in i) + + from ._termui_impl import pager + + return pager(itertools.chain(text_generator, "\n"), color) + + +@t.overload +def progressbar( + *, + length: int, + label: str | None = None, + hidden: bool = False, + show_eta: bool = True, + show_percent: bool | None = None, + show_pos: bool = False, + fill_char: str = "#", + empty_char: str = "-", + bar_template: str = "%(label)s [%(bar)s] %(info)s", + info_sep: str = " ", + width: int = 36, + file: t.TextIO | None = None, + color: bool | None = None, + update_min_steps: int = 1, +) -> ProgressBar[int]: ... + + +@t.overload +def progressbar( + iterable: cabc.Iterable[V] | None = None, + length: int | None = None, + label: str | None = None, + hidden: bool = False, + show_eta: bool = True, + show_percent: bool | None = None, + show_pos: bool = False, + item_show_func: t.Callable[[V | None], str | None] | None = None, + fill_char: str = "#", + empty_char: str = "-", + bar_template: str = "%(label)s [%(bar)s] %(info)s", + info_sep: str = " ", + width: int = 36, + file: t.TextIO | None = None, + color: bool | None = None, + update_min_steps: int = 1, +) -> ProgressBar[V]: ... + + +def progressbar( + iterable: cabc.Iterable[V] | None = None, + length: int | None = None, + label: str | None = None, + hidden: bool = False, + show_eta: bool = True, + show_percent: bool | None = None, + show_pos: bool = False, + item_show_func: t.Callable[[V | None], str | None] | None = None, + fill_char: str = "#", + empty_char: str = "-", + bar_template: str = "%(label)s [%(bar)s] %(info)s", + info_sep: str = " ", + width: int = 36, + file: t.TextIO | None = None, + color: bool | None = None, + update_min_steps: int = 1, +) -> ProgressBar[V]: + """This function creates an iterable context manager that can be used + to iterate over something while showing a progress bar. It will + either iterate over the `iterable` or `length` items (that are counted + up). While iteration happens, this function will print a rendered + progress bar to the given `file` (defaults to stdout) and will attempt + to calculate remaining time and more. By default, this progress bar + will not be rendered if the file is not a terminal. + + The context manager creates the progress bar. When the context + manager is entered the progress bar is already created. With every + iteration over the progress bar, the iterable passed to the bar is + advanced and the bar is updated. When the context manager exits, + a newline is printed and the progress bar is finalized on screen. + + Note: The progress bar is currently designed for use cases where the + total progress can be expected to take at least several seconds. + Because of this, the ProgressBar class object won't display + progress that is considered too fast, and progress where the time + between steps is less than a second. + + No printing must happen or the progress bar will be unintentionally + destroyed. + + Example usage:: + + with progressbar(items) as bar: + for item in bar: + do_something_with(item) + + Alternatively, if no iterable is specified, one can manually update the + progress bar through the `update()` method instead of directly + iterating over the progress bar. The update method accepts the number + of steps to increment the bar with:: + + with progressbar(length=chunks.total_bytes) as bar: + for chunk in chunks: + process_chunk(chunk) + bar.update(chunks.bytes) + + The ``update()`` method also takes an optional value specifying the + ``current_item`` at the new position. This is useful when used + together with ``item_show_func`` to customize the output for each + manual step:: + + with click.progressbar( + length=total_size, + label='Unzipping archive', + item_show_func=lambda a: a.filename + ) as bar: + for archive in zip_file: + archive.extract() + bar.update(archive.size, archive) + + :param iterable: an iterable to iterate over. If not provided the length + is required. + :param length: the number of items to iterate over. By default the + progressbar will attempt to ask the iterator about its + length, which might or might not work. If an iterable is + also provided this parameter can be used to override the + length. If an iterable is not provided the progress bar + will iterate over a range of that length. + :param label: the label to show next to the progress bar. + :param hidden: hide the progressbar. Defaults to ``False``. When no tty is + detected, it will only print the progressbar label. Setting this to + ``False`` also disables that. + :param show_eta: enables or disables the estimated time display. This is + automatically disabled if the length cannot be + determined. + :param show_percent: enables or disables the percentage display. The + default is `True` if the iterable has a length or + `False` if not. + :param show_pos: enables or disables the absolute position display. The + default is `False`. + :param item_show_func: A function called with the current item which + can return a string to show next to the progress bar. If the + function returns ``None`` nothing is shown. The current item can + be ``None``, such as when entering and exiting the bar. + :param fill_char: the character to use to show the filled part of the + progress bar. + :param empty_char: the character to use to show the non-filled part of + the progress bar. + :param bar_template: the format string to use as template for the bar. + The parameters in it are ``label`` for the label, + ``bar`` for the progress bar and ``info`` for the + info section. + :param info_sep: the separator between multiple info items (eta etc.) + :param width: the width of the progress bar in characters, 0 means full + terminal width + :param file: The file to write to. If this is not a terminal then + only the label is printed. + :param color: controls if the terminal supports ANSI colors or not. The + default is autodetection. This is only needed if ANSI + codes are included anywhere in the progress bar output + which is not the case by default. + :param update_min_steps: Render only when this many updates have + completed. This allows tuning for very fast iterators. + + .. versionadded:: 8.2 + The ``hidden`` argument. + + .. versionchanged:: 8.0 + Output is shown even if execution time is less than 0.5 seconds. + + .. versionchanged:: 8.0 + ``item_show_func`` shows the current item, not the previous one. + + .. versionchanged:: 8.0 + Labels are echoed if the output is not a TTY. Reverts a change + in 7.0 that removed all output. + + .. versionadded:: 8.0 + The ``update_min_steps`` parameter. + + .. versionadded:: 4.0 + The ``color`` parameter and ``update`` method. + + .. versionadded:: 2.0 + """ + from ._termui_impl import ProgressBar + + color = resolve_color_default(color) + return ProgressBar( + iterable=iterable, + length=length, + hidden=hidden, + show_eta=show_eta, + show_percent=show_percent, + show_pos=show_pos, + item_show_func=item_show_func, + fill_char=fill_char, + empty_char=empty_char, + bar_template=bar_template, + info_sep=info_sep, + file=file, + label=label, + width=width, + color=color, + update_min_steps=update_min_steps, + ) + + +def clear() -> None: + """Clears the terminal screen. This will have the effect of clearing + the whole visible space of the terminal and moving the cursor to the + top left. This does not do anything if not connected to a terminal. + + .. versionadded:: 2.0 + """ + if not isatty(sys.stdout): + return + + # ANSI escape \033[2J clears the screen, \033[1;1H moves the cursor + echo("\033[2J\033[1;1H", nl=False) + + +def _interpret_color(color: int | tuple[int, int, int] | str, offset: int = 0) -> str: + if isinstance(color, int): + return f"{38 + offset};5;{color:d}" + + if isinstance(color, (tuple, list)): + r, g, b = color + return f"{38 + offset};2;{r:d};{g:d};{b:d}" + + return str(_ansi_colors[color] + offset) + + +def style( + text: t.Any, + fg: int | tuple[int, int, int] | str | None = None, + bg: int | tuple[int, int, int] | str | None = None, + bold: bool | None = None, + dim: bool | None = None, + underline: bool | None = None, + overline: bool | None = None, + italic: bool | None = None, + blink: bool | None = None, + reverse: bool | None = None, + strikethrough: bool | None = None, + reset: bool = True, +) -> str: + """Styles a text with ANSI styles and returns the new string. By + default the styling is self contained which means that at the end + of the string a reset code is issued. This can be prevented by + passing ``reset=False``. + + Examples:: + + click.echo(click.style('Hello World!', fg='green')) + click.echo(click.style('ATTENTION!', blink=True)) + click.echo(click.style('Some things', reverse=True, fg='cyan')) + click.echo(click.style('More colors', fg=(255, 12, 128), bg=117)) + + Supported color names: + + * ``black`` (might be a gray) + * ``red`` + * ``green`` + * ``yellow`` (might be an orange) + * ``blue`` + * ``magenta`` + * ``cyan`` + * ``white`` (might be light gray) + * ``bright_black`` + * ``bright_red`` + * ``bright_green`` + * ``bright_yellow`` + * ``bright_blue`` + * ``bright_magenta`` + * ``bright_cyan`` + * ``bright_white`` + * ``reset`` (reset the color code only) + + If the terminal supports it, color may also be specified as: + + - An integer in the interval [0, 255]. The terminal must support + 8-bit/256-color mode. + - An RGB tuple of three integers in [0, 255]. The terminal must + support 24-bit/true-color mode. + + See https://en.wikipedia.org/wiki/ANSI_color and + https://gist.github.com/XVilka/8346728 for more information. + + :param text: the string to style with ansi codes. + :param fg: if provided this will become the foreground color. + :param bg: if provided this will become the background color. + :param bold: if provided this will enable or disable bold mode. + :param dim: if provided this will enable or disable dim mode. This is + badly supported. + :param underline: if provided this will enable or disable underline. + :param overline: if provided this will enable or disable overline. + :param italic: if provided this will enable or disable italic. + :param blink: if provided this will enable or disable blinking. + :param reverse: if provided this will enable or disable inverse + rendering (foreground becomes background and the + other way round). + :param strikethrough: if provided this will enable or disable + striking through text. + :param reset: by default a reset-all code is added at the end of the + string which means that styles do not carry over. This + can be disabled to compose styles. + + .. versionchanged:: 8.0 + A non-string ``message`` is converted to a string. + + .. versionchanged:: 8.0 + Added support for 256 and RGB color codes. + + .. versionchanged:: 8.0 + Added the ``strikethrough``, ``italic``, and ``overline`` + parameters. + + .. versionchanged:: 7.0 + Added support for bright colors. + + .. versionadded:: 2.0 + """ + if not isinstance(text, str): + text = str(text) + + bits = [] + + if fg: + try: + bits.append(f"\033[{_interpret_color(fg)}m") + except KeyError: + raise TypeError(f"Unknown color {fg!r}") from None + + if bg: + try: + bits.append(f"\033[{_interpret_color(bg, 10)}m") + except KeyError: + raise TypeError(f"Unknown color {bg!r}") from None + + if bold is not None: + bits.append(f"\033[{1 if bold else 22}m") + if dim is not None: + bits.append(f"\033[{2 if dim else 22}m") + if underline is not None: + bits.append(f"\033[{4 if underline else 24}m") + if overline is not None: + bits.append(f"\033[{53 if overline else 55}m") + if italic is not None: + bits.append(f"\033[{3 if italic else 23}m") + if blink is not None: + bits.append(f"\033[{5 if blink else 25}m") + if reverse is not None: + bits.append(f"\033[{7 if reverse else 27}m") + if strikethrough is not None: + bits.append(f"\033[{9 if strikethrough else 29}m") + bits.append(text) + if reset: + bits.append(_ansi_reset_all) + return "".join(bits) + + +def unstyle(text: str) -> str: + """Removes ANSI styling information from a string. Usually it's not + necessary to use this function as Click's echo function will + automatically remove styling if necessary. + + .. versionadded:: 2.0 + + :param text: the text to remove style information from. + """ + return strip_ansi(text) + + +def secho( + message: t.Any | None = None, + file: t.IO[t.AnyStr] | None = None, + nl: bool = True, + err: bool = False, + color: bool | None = None, + **styles: t.Any, +) -> None: + """This function combines :func:`echo` and :func:`style` into one + call. As such the following two calls are the same:: + + click.secho('Hello World!', fg='green') + click.echo(click.style('Hello World!', fg='green')) + + All keyword arguments are forwarded to the underlying functions + depending on which one they go with. + + Non-string types will be converted to :class:`str`. However, + :class:`bytes` are passed directly to :meth:`echo` without applying + style. If you want to style bytes that represent text, call + :meth:`bytes.decode` first. + + .. versionchanged:: 8.0 + A non-string ``message`` is converted to a string. Bytes are + passed through without style applied. + + .. versionadded:: 2.0 + """ + if message is not None and not isinstance(message, (bytes, bytearray)): + message = style(message, **styles) + + return echo(message, file=file, nl=nl, err=err, color=color) + + +@t.overload +def edit( + text: bytes | bytearray, + editor: str | None = None, + env: cabc.Mapping[str, str] | None = None, + require_save: bool = False, + extension: str = ".txt", +) -> bytes | None: ... + + +@t.overload +def edit( + text: str, + editor: str | None = None, + env: cabc.Mapping[str, str] | None = None, + require_save: bool = True, + extension: str = ".txt", +) -> str | None: ... + + +@t.overload +def edit( + text: None = None, + editor: str | None = None, + env: cabc.Mapping[str, str] | None = None, + require_save: bool = True, + extension: str = ".txt", + filename: str | cabc.Iterable[str] | None = None, +) -> None: ... + + +def edit( + text: str | bytes | bytearray | None = None, + editor: str | None = None, + env: cabc.Mapping[str, str] | None = None, + require_save: bool = True, + extension: str = ".txt", + filename: str | cabc.Iterable[str] | None = None, +) -> str | bytes | bytearray | None: + r"""Edits the given text in the defined editor. If an editor is given + (should be the full path to the executable but the regular operating + system search path is used for finding the executable) it overrides + the detected editor. Optionally, some environment variables can be + used. If the editor is closed without changes, `None` is returned. In + case a file is edited directly the return value is always `None` and + `require_save` and `extension` are ignored. + + If the editor cannot be opened a :exc:`UsageError` is raised. + + Note for Windows: to simplify cross-platform usage, the newlines are + automatically converted from POSIX to Windows and vice versa. As such, + the message here will have ``\n`` as newline markers. + + :param text: the text to edit. + :param editor: optionally the editor to use. Defaults to automatic + detection. + :param env: environment variables to forward to the editor. + :param require_save: if this is true, then not saving in the editor + will make the return value become `None`. + :param extension: the extension to tell the editor about. This defaults + to `.txt` but changing this might change syntax + highlighting. + :param filename: if provided it will edit this file instead of the + provided text contents. It will not use a temporary + file as an indirection in that case. If the editor supports + editing multiple files at once, a sequence of files may be + passed as well. Invoke `click.file` once per file instead + if multiple files cannot be managed at once or editing the + files serially is desired. + + .. versionchanged:: 8.2.0 + ``filename`` now accepts any ``Iterable[str]`` in addition to a ``str`` + if the ``editor`` supports editing multiple files at once. + + """ + from ._termui_impl import Editor + + ed = Editor(editor=editor, env=env, require_save=require_save, extension=extension) + + if filename is None: + return ed.edit(text) + + if isinstance(filename, str): + filename = (filename,) + + ed.edit_files(filenames=filename) + return None + + +def launch(url: str, wait: bool = False, locate: bool = False) -> int: + """This function launches the given URL (or filename) in the default + viewer application for this file type. If this is an executable, it + might launch the executable in a new session. The return value is + the exit code of the launched application. Usually, ``0`` indicates + success. + + Examples:: + + click.launch('https://click.palletsprojects.com/') + click.launch('/my/downloaded/file', locate=True) + + .. versionadded:: 2.0 + + :param url: URL or filename of the thing to launch. + :param wait: Wait for the program to exit before returning. This + only works if the launched program blocks. In particular, + ``xdg-open`` on Linux does not block. + :param locate: if this is set to `True` then instead of launching the + application associated with the URL it will attempt to + launch a file manager with the file located. This + might have weird effects if the URL does not point to + the filesystem. + """ + from ._termui_impl import open_url + + return open_url(url, wait=wait, locate=locate) + + +# If this is provided, getchar() calls into this instead. This is used +# for unittesting purposes. +_getchar: t.Callable[[bool], str] | None = None + + +def getchar(echo: bool = False) -> str: + """Fetches a single character from the terminal and returns it. This + will always return a unicode character and under certain rare + circumstances this might return more than one character. The + situations which more than one character is returned is when for + whatever reason multiple characters end up in the terminal buffer or + standard input was not actually a terminal. + + Note that this will always read from the terminal, even if something + is piped into the standard input. + + Note for Windows: in rare cases when typing non-ASCII characters, this + function might wait for a second character and then return both at once. + This is because certain Unicode characters look like special-key markers. + + .. versionadded:: 2.0 + + :param echo: if set to `True`, the character read will also show up on + the terminal. The default is to not show it. + """ + global _getchar + + if _getchar is None: + from ._termui_impl import getchar as f + + _getchar = f + + return _getchar(echo) + + +def raw_terminal() -> AbstractContextManager[int]: + from ._termui_impl import raw_terminal as f + + return f() + + +def pause(info: str | None = None, err: bool = False) -> None: + """This command stops execution and waits for the user to press any + key to continue. This is similar to the Windows batch "pause" + command. If the program is not run through a terminal, this command + will instead do nothing. + + .. versionadded:: 2.0 + + .. versionadded:: 4.0 + Added the `err` parameter. + + :param info: The message to print before pausing. Defaults to + ``"Press any key to continue..."``. + :param err: if set to message goes to ``stderr`` instead of + ``stdout``, the same as with echo. + """ + if not isatty(sys.stdin) or not isatty(sys.stdout): + return + + if info is None: + info = _("Press any key to continue...") + + try: + if info: + echo(info, nl=False, err=err) + try: + getchar() + except (KeyboardInterrupt, EOFError): + pass + finally: + if info: + echo(err=err) diff --git a/venv/Lib/site-packages/click/testing.py b/venv/Lib/site-packages/click/testing.py new file mode 100644 index 0000000000000000000000000000000000000000..7c0e8741e2d07f54294a82792c776d08c639add4 --- /dev/null +++ b/venv/Lib/site-packages/click/testing.py @@ -0,0 +1,565 @@ +from __future__ import annotations + +import collections.abc as cabc +import contextlib +import io +import os +import shlex +import shutil +import sys +import tempfile +import typing as t +from types import TracebackType + +from . import _compat +from . import formatting +from . import termui +from . import utils +from ._compat import _find_binary_reader + +if t.TYPE_CHECKING: + from _typeshed import ReadableBuffer + + from .core import Command + + +class EchoingStdin: + def __init__(self, input: t.BinaryIO, output: t.BinaryIO) -> None: + self._input = input + self._output = output + self._paused = False + + def __getattr__(self, x: str) -> t.Any: + return getattr(self._input, x) + + def _echo(self, rv: bytes) -> bytes: + if not self._paused: + self._output.write(rv) + + return rv + + def read(self, n: int = -1) -> bytes: + return self._echo(self._input.read(n)) + + def read1(self, n: int = -1) -> bytes: + return self._echo(self._input.read1(n)) # type: ignore + + def readline(self, n: int = -1) -> bytes: + return self._echo(self._input.readline(n)) + + def readlines(self) -> list[bytes]: + return [self._echo(x) for x in self._input.readlines()] + + def __iter__(self) -> cabc.Iterator[bytes]: + return iter(self._echo(x) for x in self._input) + + def __repr__(self) -> str: + return repr(self._input) + + +@contextlib.contextmanager +def _pause_echo(stream: EchoingStdin | None) -> cabc.Iterator[None]: + if stream is None: + yield + else: + stream._paused = True + yield + stream._paused = False + + +class BytesIOCopy(io.BytesIO): + """Patch ``io.BytesIO`` to let the written stream be copied to another. + + .. versionadded:: 8.2 + """ + + def __init__(self, copy_to: io.BytesIO) -> None: + super().__init__() + self.copy_to = copy_to + + def flush(self) -> None: + super().flush() + self.copy_to.flush() + + def write(self, b: ReadableBuffer) -> int: + self.copy_to.write(b) + return super().write(b) + + +class StreamMixer: + """Mixes `` and `` streams. + + The result is available in the ``output`` attribute. + + .. versionadded:: 8.2 + """ + + def __init__(self) -> None: + self.output: io.BytesIO = io.BytesIO() + self.stdout: io.BytesIO = BytesIOCopy(copy_to=self.output) + self.stderr: io.BytesIO = BytesIOCopy(copy_to=self.output) + + +class _NamedTextIOWrapper(io.TextIOWrapper): + def __init__( + self, buffer: t.BinaryIO, name: str, mode: str, **kwargs: t.Any + ) -> None: + super().__init__(buffer, **kwargs) + self._name = name + self._mode = mode + + @property + def name(self) -> str: + return self._name + + @property + def mode(self) -> str: + return self._mode + + def __next__(self) -> str: # type: ignore + try: + line = super().__next__() + except StopIteration as e: + raise EOFError() from e + return line + + +def make_input_stream( + input: str | bytes | t.IO[t.Any] | None, charset: str +) -> t.BinaryIO: + # Is already an input stream. + if hasattr(input, "read"): + rv = _find_binary_reader(t.cast("t.IO[t.Any]", input)) + + if rv is not None: + return rv + + raise TypeError("Could not find binary reader for input stream.") + + if input is None: + input = b"" + elif isinstance(input, str): + input = input.encode(charset) + + return io.BytesIO(input) + + +class Result: + """Holds the captured result of an invoked CLI script. + + :param runner: The runner that created the result + :param stdout_bytes: The standard output as bytes. + :param stderr_bytes: The standard error as bytes. + :param output_bytes: A mix of ``stdout_bytes`` and ``stderr_bytes``, as the + user would see it in its terminal. + :param return_value: The value returned from the invoked command. + :param exit_code: The exit code as integer. + :param exception: The exception that happened if one did. + :param exc_info: Exception information (exception type, exception instance, + traceback type). + + .. versionchanged:: 8.2 + ``stderr_bytes`` no longer optional, ``output_bytes`` introduced and + ``mix_stderr`` has been removed. + + .. versionadded:: 8.0 + Added ``return_value``. + """ + + def __init__( + self, + runner: CliRunner, + stdout_bytes: bytes, + stderr_bytes: bytes, + output_bytes: bytes, + return_value: t.Any, + exit_code: int, + exception: BaseException | None, + exc_info: tuple[type[BaseException], BaseException, TracebackType] + | None = None, + ): + self.runner = runner + self.stdout_bytes = stdout_bytes + self.stderr_bytes = stderr_bytes + self.output_bytes = output_bytes + self.return_value = return_value + self.exit_code = exit_code + self.exception = exception + self.exc_info = exc_info + + @property + def output(self) -> str: + """The terminal output as unicode string, as the user would see it. + + .. versionchanged:: 8.2 + No longer a proxy for ``self.stdout``. Now has its own independent stream + that is mixing `` and ``, in the order they were written. + """ + return self.output_bytes.decode(self.runner.charset, "replace").replace( + "\r\n", "\n" + ) + + @property + def stdout(self) -> str: + """The standard output as unicode string.""" + return self.stdout_bytes.decode(self.runner.charset, "replace").replace( + "\r\n", "\n" + ) + + @property + def stderr(self) -> str: + """The standard error as unicode string. + + .. versionchanged:: 8.2 + No longer raise an exception, always returns the `` string. + """ + return self.stderr_bytes.decode(self.runner.charset, "replace").replace( + "\r\n", "\n" + ) + + def __repr__(self) -> str: + exc_str = repr(self.exception) if self.exception else "okay" + return f"<{type(self).__name__} {exc_str}>" + + +class CliRunner: + """The CLI runner provides functionality to invoke a Click command line + script for unittesting purposes in a isolated environment. This only + works in single-threaded systems without any concurrency as it changes the + global interpreter state. + + :param charset: the character set for the input and output data. + :param env: a dictionary with environment variables for overriding. + :param echo_stdin: if this is set to `True`, then reading from `` writes + to ``. This is useful for showing examples in + some circumstances. Note that regular prompts + will automatically echo the input. + :param catch_exceptions: Whether to catch any exceptions other than + ``SystemExit`` when running :meth:`~CliRunner.invoke`. + + .. versionchanged:: 8.2 + Added the ``catch_exceptions`` parameter. + + .. versionchanged:: 8.2 + ``mix_stderr`` parameter has been removed. + """ + + def __init__( + self, + charset: str = "utf-8", + env: cabc.Mapping[str, str | None] | None = None, + echo_stdin: bool = False, + catch_exceptions: bool = True, + ) -> None: + self.charset = charset + self.env: cabc.Mapping[str, str | None] = env or {} + self.echo_stdin = echo_stdin + self.catch_exceptions = catch_exceptions + + def get_default_prog_name(self, cli: Command) -> str: + """Given a command object it will return the default program name + for it. The default is the `name` attribute or ``"root"`` if not + set. + """ + return cli.name or "root" + + def make_env( + self, overrides: cabc.Mapping[str, str | None] | None = None + ) -> cabc.Mapping[str, str | None]: + """Returns the environment overrides for invoking a script.""" + rv = dict(self.env) + if overrides: + rv.update(overrides) + return rv + + @contextlib.contextmanager + def isolation( + self, + input: str | bytes | t.IO[t.Any] | None = None, + env: cabc.Mapping[str, str | None] | None = None, + color: bool = False, + ) -> cabc.Iterator[tuple[io.BytesIO, io.BytesIO, io.BytesIO]]: + """A context manager that sets up the isolation for invoking of a + command line tool. This sets up `` with the given input data + and `os.environ` with the overrides from the given dictionary. + This also rebinds some internals in Click to be mocked (like the + prompt functionality). + + This is automatically done in the :meth:`invoke` method. + + :param input: the input stream to put into `sys.stdin`. + :param env: the environment overrides as dictionary. + :param color: whether the output should contain color codes. The + application can still override this explicitly. + + .. versionadded:: 8.2 + An additional output stream is returned, which is a mix of + `` and `` streams. + + .. versionchanged:: 8.2 + Always returns the `` stream. + + .. versionchanged:: 8.0 + `` is opened with ``errors="backslashreplace"`` + instead of the default ``"strict"``. + + .. versionchanged:: 4.0 + Added the ``color`` parameter. + """ + bytes_input = make_input_stream(input, self.charset) + echo_input = None + + old_stdin = sys.stdin + old_stdout = sys.stdout + old_stderr = sys.stderr + old_forced_width = formatting.FORCED_WIDTH + formatting.FORCED_WIDTH = 80 + + env = self.make_env(env) + + stream_mixer = StreamMixer() + + if self.echo_stdin: + bytes_input = echo_input = t.cast( + t.BinaryIO, EchoingStdin(bytes_input, stream_mixer.stdout) + ) + + sys.stdin = text_input = _NamedTextIOWrapper( + bytes_input, encoding=self.charset, name="", mode="r" + ) + + if self.echo_stdin: + # Force unbuffered reads, otherwise TextIOWrapper reads a + # large chunk which is echoed early. + text_input._CHUNK_SIZE = 1 # type: ignore + + sys.stdout = _NamedTextIOWrapper( + stream_mixer.stdout, encoding=self.charset, name="", mode="w" + ) + + sys.stderr = _NamedTextIOWrapper( + stream_mixer.stderr, + encoding=self.charset, + name="", + mode="w", + errors="backslashreplace", + ) + + @_pause_echo(echo_input) # type: ignore + def visible_input(prompt: str | None = None) -> str: + sys.stdout.write(prompt or "") + val = next(text_input).rstrip("\r\n") + sys.stdout.write(f"{val}\n") + sys.stdout.flush() + return val + + @_pause_echo(echo_input) # type: ignore + def hidden_input(prompt: str | None = None) -> str: + sys.stdout.write(f"{prompt or ''}\n") + sys.stdout.flush() + return next(text_input).rstrip("\r\n") + + @_pause_echo(echo_input) # type: ignore + def _getchar(echo: bool) -> str: + char = sys.stdin.read(1) + + if echo: + sys.stdout.write(char) + + sys.stdout.flush() + return char + + default_color = color + + def should_strip_ansi( + stream: t.IO[t.Any] | None = None, color: bool | None = None + ) -> bool: + if color is None: + return not default_color + return not color + + old_visible_prompt_func = termui.visible_prompt_func + old_hidden_prompt_func = termui.hidden_prompt_func + old__getchar_func = termui._getchar + old_should_strip_ansi = utils.should_strip_ansi # type: ignore + old__compat_should_strip_ansi = _compat.should_strip_ansi + termui.visible_prompt_func = visible_input + termui.hidden_prompt_func = hidden_input + termui._getchar = _getchar + utils.should_strip_ansi = should_strip_ansi # type: ignore + _compat.should_strip_ansi = should_strip_ansi + + old_env = {} + try: + for key, value in env.items(): + old_env[key] = os.environ.get(key) + if value is None: + try: + del os.environ[key] + except Exception: + pass + else: + os.environ[key] = value + yield (stream_mixer.stdout, stream_mixer.stderr, stream_mixer.output) + finally: + for key, value in old_env.items(): + if value is None: + try: + del os.environ[key] + except Exception: + pass + else: + os.environ[key] = value + sys.stdout = old_stdout + sys.stderr = old_stderr + sys.stdin = old_stdin + termui.visible_prompt_func = old_visible_prompt_func + termui.hidden_prompt_func = old_hidden_prompt_func + termui._getchar = old__getchar_func + utils.should_strip_ansi = old_should_strip_ansi # type: ignore + _compat.should_strip_ansi = old__compat_should_strip_ansi + formatting.FORCED_WIDTH = old_forced_width + + def invoke( + self, + cli: Command, + args: str | cabc.Sequence[str] | None = None, + input: str | bytes | t.IO[t.Any] | None = None, + env: cabc.Mapping[str, str | None] | None = None, + catch_exceptions: bool | None = None, + color: bool = False, + **extra: t.Any, + ) -> Result: + """Invokes a command in an isolated environment. The arguments are + forwarded directly to the command line script, the `extra` keyword + arguments are passed to the :meth:`~clickpkg.Command.main` function of + the command. + + This returns a :class:`Result` object. + + :param cli: the command to invoke + :param args: the arguments to invoke. It may be given as an iterable + or a string. When given as string it will be interpreted + as a Unix shell command. More details at + :func:`shlex.split`. + :param input: the input data for `sys.stdin`. + :param env: the environment overrides. + :param catch_exceptions: Whether to catch any other exceptions than + ``SystemExit``. If :data:`None`, the value + from :class:`CliRunner` is used. + :param extra: the keyword arguments to pass to :meth:`main`. + :param color: whether the output should contain color codes. The + application can still override this explicitly. + + .. versionadded:: 8.2 + The result object has the ``output_bytes`` attribute with + the mix of ``stdout_bytes`` and ``stderr_bytes``, as the user would + see it in its terminal. + + .. versionchanged:: 8.2 + The result object always returns the ``stderr_bytes`` stream. + + .. versionchanged:: 8.0 + The result object has the ``return_value`` attribute with + the value returned from the invoked command. + + .. versionchanged:: 4.0 + Added the ``color`` parameter. + + .. versionchanged:: 3.0 + Added the ``catch_exceptions`` parameter. + + .. versionchanged:: 3.0 + The result object has the ``exc_info`` attribute with the + traceback if available. + """ + exc_info = None + if catch_exceptions is None: + catch_exceptions = self.catch_exceptions + + with self.isolation(input=input, env=env, color=color) as outstreams: + return_value = None + exception: BaseException | None = None + exit_code = 0 + + if isinstance(args, str): + args = shlex.split(args) + + try: + prog_name = extra.pop("prog_name") + except KeyError: + prog_name = self.get_default_prog_name(cli) + + try: + return_value = cli.main(args=args or (), prog_name=prog_name, **extra) + except SystemExit as e: + exc_info = sys.exc_info() + e_code = t.cast("int | t.Any | None", e.code) + + if e_code is None: + e_code = 0 + + if e_code != 0: + exception = e + + if not isinstance(e_code, int): + sys.stdout.write(str(e_code)) + sys.stdout.write("\n") + e_code = 1 + + exit_code = e_code + + except Exception as e: + if not catch_exceptions: + raise + exception = e + exit_code = 1 + exc_info = sys.exc_info() + finally: + sys.stdout.flush() + sys.stderr.flush() + stdout = outstreams[0].getvalue() + stderr = outstreams[1].getvalue() + output = outstreams[2].getvalue() + + return Result( + runner=self, + stdout_bytes=stdout, + stderr_bytes=stderr, + output_bytes=output, + return_value=return_value, + exit_code=exit_code, + exception=exception, + exc_info=exc_info, # type: ignore + ) + + @contextlib.contextmanager + def isolated_filesystem( + self, temp_dir: str | os.PathLike[str] | None = None + ) -> cabc.Iterator[str]: + """A context manager that creates a temporary directory and + changes the current working directory to it. This isolates tests + that affect the contents of the CWD to prevent them from + interfering with each other. + + :param temp_dir: Create the temporary directory under this + directory. If given, the created directory is not removed + when exiting. + + .. versionchanged:: 8.0 + Added the ``temp_dir`` parameter. + """ + cwd = os.getcwd() + dt = tempfile.mkdtemp(dir=temp_dir) + os.chdir(dt) + + try: + yield dt + finally: + os.chdir(cwd) + + if temp_dir is None: + try: + shutil.rmtree(dt) + except OSError: + pass diff --git a/venv/Lib/site-packages/click/types.py b/venv/Lib/site-packages/click/types.py new file mode 100644 index 0000000000000000000000000000000000000000..684cb3b1e6107bada194d18968de69a7f383a2a0 --- /dev/null +++ b/venv/Lib/site-packages/click/types.py @@ -0,0 +1,1165 @@ +from __future__ import annotations + +import collections.abc as cabc +import enum +import os +import stat +import sys +import typing as t +from datetime import datetime +from gettext import gettext as _ +from gettext import ngettext + +from ._compat import _get_argv_encoding +from ._compat import open_stream +from .exceptions import BadParameter +from .utils import format_filename +from .utils import LazyFile +from .utils import safecall + +if t.TYPE_CHECKING: + import typing_extensions as te + + from .core import Context + from .core import Parameter + from .shell_completion import CompletionItem + +ParamTypeValue = t.TypeVar("ParamTypeValue") + + +class ParamType: + """Represents the type of a parameter. Validates and converts values + from the command line or Python into the correct type. + + To implement a custom type, subclass and implement at least the + following: + + - The :attr:`name` class attribute must be set. + - Calling an instance of the type with ``None`` must return + ``None``. This is already implemented by default. + - :meth:`convert` must convert string values to the correct type. + - :meth:`convert` must accept values that are already the correct + type. + - It must be able to convert a value if the ``ctx`` and ``param`` + arguments are ``None``. This can occur when converting prompt + input. + """ + + is_composite: t.ClassVar[bool] = False + arity: t.ClassVar[int] = 1 + + #: the descriptive name of this type + name: str + + #: if a list of this type is expected and the value is pulled from a + #: string environment variable, this is what splits it up. `None` + #: means any whitespace. For all parameters the general rule is that + #: whitespace splits them up. The exception are paths and files which + #: are split by ``os.path.pathsep`` by default (":" on Unix and ";" on + #: Windows). + envvar_list_splitter: t.ClassVar[str | None] = None + + def to_info_dict(self) -> dict[str, t.Any]: + """Gather information that could be useful for a tool generating + user-facing documentation. + + Use :meth:`click.Context.to_info_dict` to traverse the entire + CLI structure. + + .. versionadded:: 8.0 + """ + # The class name without the "ParamType" suffix. + param_type = type(self).__name__.partition("ParamType")[0] + param_type = param_type.partition("ParameterType")[0] + + # Custom subclasses might not remember to set a name. + if hasattr(self, "name"): + name = self.name + else: + name = param_type + + return {"param_type": param_type, "name": name} + + def __call__( + self, + value: t.Any, + param: Parameter | None = None, + ctx: Context | None = None, + ) -> t.Any: + if value is not None: + return self.convert(value, param, ctx) + + def get_metavar(self, param: Parameter, ctx: Context) -> str | None: + """Returns the metavar default for this param if it provides one.""" + + def get_missing_message(self, param: Parameter, ctx: Context | None) -> str | None: + """Optionally might return extra information about a missing + parameter. + + .. versionadded:: 2.0 + """ + + def convert( + self, value: t.Any, param: Parameter | None, ctx: Context | None + ) -> t.Any: + """Convert the value to the correct type. This is not called if + the value is ``None`` (the missing value). + + This must accept string values from the command line, as well as + values that are already the correct type. It may also convert + other compatible types. + + The ``param`` and ``ctx`` arguments may be ``None`` in certain + situations, such as when converting prompt input. + + If the value cannot be converted, call :meth:`fail` with a + descriptive message. + + :param value: The value to convert. + :param param: The parameter that is using this type to convert + its value. May be ``None``. + :param ctx: The current context that arrived at this value. May + be ``None``. + """ + return value + + def split_envvar_value(self, rv: str) -> cabc.Sequence[str]: + """Given a value from an environment variable this splits it up + into small chunks depending on the defined envvar list splitter. + + If the splitter is set to `None`, which means that whitespace splits, + then leading and trailing whitespace is ignored. Otherwise, leading + and trailing splitters usually lead to empty items being included. + """ + return (rv or "").split(self.envvar_list_splitter) + + def fail( + self, + message: str, + param: Parameter | None = None, + ctx: Context | None = None, + ) -> t.NoReturn: + """Helper method to fail with an invalid value message.""" + raise BadParameter(message, ctx=ctx, param=param) + + def shell_complete( + self, ctx: Context, param: Parameter, incomplete: str + ) -> list[CompletionItem]: + """Return a list of + :class:`~click.shell_completion.CompletionItem` objects for the + incomplete value. Most types do not provide completions, but + some do, and this allows custom types to provide custom + completions as well. + + :param ctx: Invocation context for this command. + :param param: The parameter that is requesting completion. + :param incomplete: Value being completed. May be empty. + + .. versionadded:: 8.0 + """ + return [] + + +class CompositeParamType(ParamType): + is_composite = True + + @property + def arity(self) -> int: # type: ignore + raise NotImplementedError() + + +class FuncParamType(ParamType): + def __init__(self, func: t.Callable[[t.Any], t.Any]) -> None: + self.name: str = func.__name__ + self.func = func + + def to_info_dict(self) -> dict[str, t.Any]: + info_dict = super().to_info_dict() + info_dict["func"] = self.func + return info_dict + + def convert( + self, value: t.Any, param: Parameter | None, ctx: Context | None + ) -> t.Any: + try: + return self.func(value) + except ValueError: + try: + value = str(value) + except UnicodeError: + value = value.decode("utf-8", "replace") + + self.fail(value, param, ctx) + + +class UnprocessedParamType(ParamType): + name = "text" + + def convert( + self, value: t.Any, param: Parameter | None, ctx: Context | None + ) -> t.Any: + return value + + def __repr__(self) -> str: + return "UNPROCESSED" + + +class StringParamType(ParamType): + name = "text" + + def convert( + self, value: t.Any, param: Parameter | None, ctx: Context | None + ) -> t.Any: + if isinstance(value, bytes): + enc = _get_argv_encoding() + try: + value = value.decode(enc) + except UnicodeError: + fs_enc = sys.getfilesystemencoding() + if fs_enc != enc: + try: + value = value.decode(fs_enc) + except UnicodeError: + value = value.decode("utf-8", "replace") + else: + value = value.decode("utf-8", "replace") + return value + return str(value) + + def __repr__(self) -> str: + return "STRING" + + +class Choice(ParamType, t.Generic[ParamTypeValue]): + """The choice type allows a value to be checked against a fixed set + of supported values. + + You may pass any iterable value which will be converted to a tuple + and thus will only be iterated once. + + The resulting value will always be one of the originally passed choices. + See :meth:`normalize_choice` for more info on the mapping of strings + to choices. See :ref:`choice-opts` for an example. + + :param case_sensitive: Set to false to make choices case + insensitive. Defaults to true. + + .. versionchanged:: 8.2.0 + Non-``str`` ``choices`` are now supported. It can additionally be any + iterable. Before you were not recommended to pass anything but a list or + tuple. + + .. versionadded:: 8.2.0 + Choice normalization can be overridden via :meth:`normalize_choice`. + """ + + name = "choice" + + def __init__( + self, choices: cabc.Iterable[ParamTypeValue], case_sensitive: bool = True + ) -> None: + self.choices: cabc.Sequence[ParamTypeValue] = tuple(choices) + self.case_sensitive = case_sensitive + + def to_info_dict(self) -> dict[str, t.Any]: + info_dict = super().to_info_dict() + info_dict["choices"] = self.choices + info_dict["case_sensitive"] = self.case_sensitive + return info_dict + + def _normalized_mapping( + self, ctx: Context | None = None + ) -> cabc.Mapping[ParamTypeValue, str]: + """ + Returns mapping where keys are the original choices and the values are + the normalized values that are accepted via the command line. + + This is a simple wrapper around :meth:`normalize_choice`, use that + instead which is supported. + """ + return { + choice: self.normalize_choice( + choice=choice, + ctx=ctx, + ) + for choice in self.choices + } + + def normalize_choice(self, choice: ParamTypeValue, ctx: Context | None) -> str: + """ + Normalize a choice value, used to map a passed string to a choice. + Each choice must have a unique normalized value. + + By default uses :meth:`Context.token_normalize_func` and if not case + sensitive, convert it to a casefolded value. + + .. versionadded:: 8.2.0 + """ + normed_value = choice.name if isinstance(choice, enum.Enum) else str(choice) + + if ctx is not None and ctx.token_normalize_func is not None: + normed_value = ctx.token_normalize_func(normed_value) + + if not self.case_sensitive: + normed_value = normed_value.casefold() + + return normed_value + + def get_metavar(self, param: Parameter, ctx: Context) -> str | None: + if param.param_type_name == "option" and not param.show_choices: # type: ignore + choice_metavars = [ + convert_type(type(choice)).name.upper() for choice in self.choices + ] + choices_str = "|".join([*dict.fromkeys(choice_metavars)]) + else: + choices_str = "|".join( + [str(i) for i in self._normalized_mapping(ctx=ctx).values()] + ) + + # Use curly braces to indicate a required argument. + if param.required and param.param_type_name == "argument": + return f"{{{choices_str}}}" + + # Use square braces to indicate an option or optional argument. + return f"[{choices_str}]" + + def get_missing_message(self, param: Parameter, ctx: Context | None) -> str: + """ + Message shown when no choice is passed. + + .. versionchanged:: 8.2.0 Added ``ctx`` argument. + """ + return _("Choose from:\n\t{choices}").format( + choices=",\n\t".join(self._normalized_mapping(ctx=ctx).values()) + ) + + def convert( + self, value: t.Any, param: Parameter | None, ctx: Context | None + ) -> ParamTypeValue: + """ + For a given value from the parser, normalize it and find its + matching normalized value in the list of choices. Then return the + matched "original" choice. + """ + normed_value = self.normalize_choice(choice=value, ctx=ctx) + normalized_mapping = self._normalized_mapping(ctx=ctx) + + try: + return next( + original + for original, normalized in normalized_mapping.items() + if normalized == normed_value + ) + except StopIteration: + self.fail( + self.get_invalid_choice_message(value=value, ctx=ctx), + param=param, + ctx=ctx, + ) + + def get_invalid_choice_message(self, value: t.Any, ctx: Context | None) -> str: + """Get the error message when the given choice is invalid. + + :param value: The invalid value. + + .. versionadded:: 8.2 + """ + choices_str = ", ".join(map(repr, self._normalized_mapping(ctx=ctx).values())) + return ngettext( + "{value!r} is not {choice}.", + "{value!r} is not one of {choices}.", + len(self.choices), + ).format(value=value, choice=choices_str, choices=choices_str) + + def __repr__(self) -> str: + return f"Choice({list(self.choices)})" + + def shell_complete( + self, ctx: Context, param: Parameter, incomplete: str + ) -> list[CompletionItem]: + """Complete choices that start with the incomplete value. + + :param ctx: Invocation context for this command. + :param param: The parameter that is requesting completion. + :param incomplete: Value being completed. May be empty. + + .. versionadded:: 8.0 + """ + from click.shell_completion import CompletionItem + + str_choices = map(str, self.choices) + + if self.case_sensitive: + matched = (c for c in str_choices if c.startswith(incomplete)) + else: + incomplete = incomplete.lower() + matched = (c for c in str_choices if c.lower().startswith(incomplete)) + + return [CompletionItem(c) for c in matched] + + +class DateTime(ParamType): + """The DateTime type converts date strings into `datetime` objects. + + The format strings which are checked are configurable, but default to some + common (non-timezone aware) ISO 8601 formats. + + When specifying *DateTime* formats, you should only pass a list or a tuple. + Other iterables, like generators, may lead to surprising results. + + The format strings are processed using ``datetime.strptime``, and this + consequently defines the format strings which are allowed. + + Parsing is tried using each format, in order, and the first format which + parses successfully is used. + + :param formats: A list or tuple of date format strings, in the order in + which they should be tried. Defaults to + ``'%Y-%m-%d'``, ``'%Y-%m-%dT%H:%M:%S'``, + ``'%Y-%m-%d %H:%M:%S'``. + """ + + name = "datetime" + + def __init__(self, formats: cabc.Sequence[str] | None = None): + self.formats: cabc.Sequence[str] = formats or [ + "%Y-%m-%d", + "%Y-%m-%dT%H:%M:%S", + "%Y-%m-%d %H:%M:%S", + ] + + def to_info_dict(self) -> dict[str, t.Any]: + info_dict = super().to_info_dict() + info_dict["formats"] = self.formats + return info_dict + + def get_metavar(self, param: Parameter, ctx: Context) -> str | None: + return f"[{'|'.join(self.formats)}]" + + def _try_to_convert_date(self, value: t.Any, format: str) -> datetime | None: + try: + return datetime.strptime(value, format) + except ValueError: + return None + + def convert( + self, value: t.Any, param: Parameter | None, ctx: Context | None + ) -> t.Any: + if isinstance(value, datetime): + return value + + for format in self.formats: + converted = self._try_to_convert_date(value, format) + + if converted is not None: + return converted + + formats_str = ", ".join(map(repr, self.formats)) + self.fail( + ngettext( + "{value!r} does not match the format {format}.", + "{value!r} does not match the formats {formats}.", + len(self.formats), + ).format(value=value, format=formats_str, formats=formats_str), + param, + ctx, + ) + + def __repr__(self) -> str: + return "DateTime" + + +class _NumberParamTypeBase(ParamType): + _number_class: t.ClassVar[type[t.Any]] + + def convert( + self, value: t.Any, param: Parameter | None, ctx: Context | None + ) -> t.Any: + try: + return self._number_class(value) + except ValueError: + self.fail( + _("{value!r} is not a valid {number_type}.").format( + value=value, number_type=self.name + ), + param, + ctx, + ) + + +class _NumberRangeBase(_NumberParamTypeBase): + def __init__( + self, + min: float | None = None, + max: float | None = None, + min_open: bool = False, + max_open: bool = False, + clamp: bool = False, + ) -> None: + self.min = min + self.max = max + self.min_open = min_open + self.max_open = max_open + self.clamp = clamp + + def to_info_dict(self) -> dict[str, t.Any]: + info_dict = super().to_info_dict() + info_dict.update( + min=self.min, + max=self.max, + min_open=self.min_open, + max_open=self.max_open, + clamp=self.clamp, + ) + return info_dict + + def convert( + self, value: t.Any, param: Parameter | None, ctx: Context | None + ) -> t.Any: + import operator + + rv = super().convert(value, param, ctx) + lt_min: bool = self.min is not None and ( + operator.le if self.min_open else operator.lt + )(rv, self.min) + gt_max: bool = self.max is not None and ( + operator.ge if self.max_open else operator.gt + )(rv, self.max) + + if self.clamp: + if lt_min: + return self._clamp(self.min, 1, self.min_open) # type: ignore + + if gt_max: + return self._clamp(self.max, -1, self.max_open) # type: ignore + + if lt_min or gt_max: + self.fail( + _("{value} is not in the range {range}.").format( + value=rv, range=self._describe_range() + ), + param, + ctx, + ) + + return rv + + def _clamp(self, bound: float, dir: t.Literal[1, -1], open: bool) -> float: + """Find the valid value to clamp to bound in the given + direction. + + :param bound: The boundary value. + :param dir: 1 or -1 indicating the direction to move. + :param open: If true, the range does not include the bound. + """ + raise NotImplementedError + + def _describe_range(self) -> str: + """Describe the range for use in help text.""" + if self.min is None: + op = "<" if self.max_open else "<=" + return f"x{op}{self.max}" + + if self.max is None: + op = ">" if self.min_open else ">=" + return f"x{op}{self.min}" + + lop = "<" if self.min_open else "<=" + rop = "<" if self.max_open else "<=" + return f"{self.min}{lop}x{rop}{self.max}" + + def __repr__(self) -> str: + clamp = " clamped" if self.clamp else "" + return f"<{type(self).__name__} {self._describe_range()}{clamp}>" + + +class IntParamType(_NumberParamTypeBase): + name = "integer" + _number_class = int + + def __repr__(self) -> str: + return "INT" + + +class IntRange(_NumberRangeBase, IntParamType): + """Restrict an :data:`click.INT` value to a range of accepted + values. See :ref:`ranges`. + + If ``min`` or ``max`` are not passed, any value is accepted in that + direction. If ``min_open`` or ``max_open`` are enabled, the + corresponding boundary is not included in the range. + + If ``clamp`` is enabled, a value outside the range is clamped to the + boundary instead of failing. + + .. versionchanged:: 8.0 + Added the ``min_open`` and ``max_open`` parameters. + """ + + name = "integer range" + + def _clamp( # type: ignore + self, bound: int, dir: t.Literal[1, -1], open: bool + ) -> int: + if not open: + return bound + + return bound + dir + + +class FloatParamType(_NumberParamTypeBase): + name = "float" + _number_class = float + + def __repr__(self) -> str: + return "FLOAT" + + +class FloatRange(_NumberRangeBase, FloatParamType): + """Restrict a :data:`click.FLOAT` value to a range of accepted + values. See :ref:`ranges`. + + If ``min`` or ``max`` are not passed, any value is accepted in that + direction. If ``min_open`` or ``max_open`` are enabled, the + corresponding boundary is not included in the range. + + If ``clamp`` is enabled, a value outside the range is clamped to the + boundary instead of failing. This is not supported if either + boundary is marked ``open``. + + .. versionchanged:: 8.0 + Added the ``min_open`` and ``max_open`` parameters. + """ + + name = "float range" + + def __init__( + self, + min: float | None = None, + max: float | None = None, + min_open: bool = False, + max_open: bool = False, + clamp: bool = False, + ) -> None: + super().__init__( + min=min, max=max, min_open=min_open, max_open=max_open, clamp=clamp + ) + + if (min_open or max_open) and clamp: + raise TypeError("Clamping is not supported for open bounds.") + + def _clamp(self, bound: float, dir: t.Literal[1, -1], open: bool) -> float: + if not open: + return bound + + # Could use math.nextafter here, but clamping an + # open float range doesn't seem to be particularly useful. It's + # left up to the user to write a callback to do it if needed. + raise RuntimeError("Clamping is not supported for open bounds.") + + +class BoolParamType(ParamType): + name = "boolean" + + def convert( + self, value: t.Any, param: Parameter | None, ctx: Context | None + ) -> t.Any: + if value in {False, True}: + return bool(value) + + norm = value.strip().lower() + + if norm in {"1", "true", "t", "yes", "y", "on"}: + return True + + if norm in {"0", "false", "f", "no", "n", "off"}: + return False + + self.fail( + _("{value!r} is not a valid boolean.").format(value=value), param, ctx + ) + + def __repr__(self) -> str: + return "BOOL" + + +class UUIDParameterType(ParamType): + name = "uuid" + + def convert( + self, value: t.Any, param: Parameter | None, ctx: Context | None + ) -> t.Any: + import uuid + + if isinstance(value, uuid.UUID): + return value + + value = value.strip() + + try: + return uuid.UUID(value) + except ValueError: + self.fail( + _("{value!r} is not a valid UUID.").format(value=value), param, ctx + ) + + def __repr__(self) -> str: + return "UUID" + + +class File(ParamType): + """Declares a parameter to be a file for reading or writing. The file + is automatically closed once the context tears down (after the command + finished working). + + Files can be opened for reading or writing. The special value ``-`` + indicates stdin or stdout depending on the mode. + + By default, the file is opened for reading text data, but it can also be + opened in binary mode or for writing. The encoding parameter can be used + to force a specific encoding. + + The `lazy` flag controls if the file should be opened immediately or upon + first IO. The default is to be non-lazy for standard input and output + streams as well as files opened for reading, `lazy` otherwise. When opening a + file lazily for reading, it is still opened temporarily for validation, but + will not be held open until first IO. lazy is mainly useful when opening + for writing to avoid creating the file until it is needed. + + Files can also be opened atomically in which case all writes go into a + separate file in the same folder and upon completion the file will + be moved over to the original location. This is useful if a file + regularly read by other users is modified. + + See :ref:`file-args` for more information. + + .. versionchanged:: 2.0 + Added the ``atomic`` parameter. + """ + + name = "filename" + envvar_list_splitter: t.ClassVar[str] = os.path.pathsep + + def __init__( + self, + mode: str = "r", + encoding: str | None = None, + errors: str | None = "strict", + lazy: bool | None = None, + atomic: bool = False, + ) -> None: + self.mode = mode + self.encoding = encoding + self.errors = errors + self.lazy = lazy + self.atomic = atomic + + def to_info_dict(self) -> dict[str, t.Any]: + info_dict = super().to_info_dict() + info_dict.update(mode=self.mode, encoding=self.encoding) + return info_dict + + def resolve_lazy_flag(self, value: str | os.PathLike[str]) -> bool: + if self.lazy is not None: + return self.lazy + if os.fspath(value) == "-": + return False + elif "w" in self.mode: + return True + return False + + def convert( + self, + value: str | os.PathLike[str] | t.IO[t.Any], + param: Parameter | None, + ctx: Context | None, + ) -> t.IO[t.Any]: + if _is_file_like(value): + return value + + value = t.cast("str | os.PathLike[str]", value) + + try: + lazy = self.resolve_lazy_flag(value) + + if lazy: + lf = LazyFile( + value, self.mode, self.encoding, self.errors, atomic=self.atomic + ) + + if ctx is not None: + ctx.call_on_close(lf.close_intelligently) + + return t.cast("t.IO[t.Any]", lf) + + f, should_close = open_stream( + value, self.mode, self.encoding, self.errors, atomic=self.atomic + ) + + # If a context is provided, we automatically close the file + # at the end of the context execution (or flush out). If a + # context does not exist, it's the caller's responsibility to + # properly close the file. This for instance happens when the + # type is used with prompts. + if ctx is not None: + if should_close: + ctx.call_on_close(safecall(f.close)) + else: + ctx.call_on_close(safecall(f.flush)) + + return f + except OSError as e: + self.fail(f"'{format_filename(value)}': {e.strerror}", param, ctx) + + def shell_complete( + self, ctx: Context, param: Parameter, incomplete: str + ) -> list[CompletionItem]: + """Return a special completion marker that tells the completion + system to use the shell to provide file path completions. + + :param ctx: Invocation context for this command. + :param param: The parameter that is requesting completion. + :param incomplete: Value being completed. May be empty. + + .. versionadded:: 8.0 + """ + from click.shell_completion import CompletionItem + + return [CompletionItem(incomplete, type="file")] + + +def _is_file_like(value: t.Any) -> te.TypeGuard[t.IO[t.Any]]: + return hasattr(value, "read") or hasattr(value, "write") + + +class Path(ParamType): + """The ``Path`` type is similar to the :class:`File` type, but + returns the filename instead of an open file. Various checks can be + enabled to validate the type of file and permissions. + + :param exists: The file or directory needs to exist for the value to + be valid. If this is not set to ``True``, and the file does not + exist, then all further checks are silently skipped. + :param file_okay: Allow a file as a value. + :param dir_okay: Allow a directory as a value. + :param readable: if true, a readable check is performed. + :param writable: if true, a writable check is performed. + :param executable: if true, an executable check is performed. + :param resolve_path: Make the value absolute and resolve any + symlinks. A ``~`` is not expanded, as this is supposed to be + done by the shell only. + :param allow_dash: Allow a single dash as a value, which indicates + a standard stream (but does not open it). Use + :func:`~click.open_file` to handle opening this value. + :param path_type: Convert the incoming path value to this type. If + ``None``, keep Python's default, which is ``str``. Useful to + convert to :class:`pathlib.Path`. + + .. versionchanged:: 8.1 + Added the ``executable`` parameter. + + .. versionchanged:: 8.0 + Allow passing ``path_type=pathlib.Path``. + + .. versionchanged:: 6.0 + Added the ``allow_dash`` parameter. + """ + + envvar_list_splitter: t.ClassVar[str] = os.path.pathsep + + def __init__( + self, + exists: bool = False, + file_okay: bool = True, + dir_okay: bool = True, + writable: bool = False, + readable: bool = True, + resolve_path: bool = False, + allow_dash: bool = False, + path_type: type[t.Any] | None = None, + executable: bool = False, + ): + self.exists = exists + self.file_okay = file_okay + self.dir_okay = dir_okay + self.readable = readable + self.writable = writable + self.executable = executable + self.resolve_path = resolve_path + self.allow_dash = allow_dash + self.type = path_type + + if self.file_okay and not self.dir_okay: + self.name: str = _("file") + elif self.dir_okay and not self.file_okay: + self.name = _("directory") + else: + self.name = _("path") + + def to_info_dict(self) -> dict[str, t.Any]: + info_dict = super().to_info_dict() + info_dict.update( + exists=self.exists, + file_okay=self.file_okay, + dir_okay=self.dir_okay, + writable=self.writable, + readable=self.readable, + allow_dash=self.allow_dash, + ) + return info_dict + + def coerce_path_result( + self, value: str | os.PathLike[str] + ) -> str | bytes | os.PathLike[str]: + if self.type is not None and not isinstance(value, self.type): + if self.type is str: + return os.fsdecode(value) + elif self.type is bytes: + return os.fsencode(value) + else: + return t.cast("os.PathLike[str]", self.type(value)) + + return value + + def convert( + self, + value: str | os.PathLike[str], + param: Parameter | None, + ctx: Context | None, + ) -> str | bytes | os.PathLike[str]: + rv = value + + is_dash = self.file_okay and self.allow_dash and rv in (b"-", "-") + + if not is_dash: + if self.resolve_path: + rv = os.path.realpath(rv) + + try: + st = os.stat(rv) + except OSError: + if not self.exists: + return self.coerce_path_result(rv) + self.fail( + _("{name} {filename!r} does not exist.").format( + name=self.name.title(), filename=format_filename(value) + ), + param, + ctx, + ) + + if not self.file_okay and stat.S_ISREG(st.st_mode): + self.fail( + _("{name} {filename!r} is a file.").format( + name=self.name.title(), filename=format_filename(value) + ), + param, + ctx, + ) + if not self.dir_okay and stat.S_ISDIR(st.st_mode): + self.fail( + _("{name} {filename!r} is a directory.").format( + name=self.name.title(), filename=format_filename(value) + ), + param, + ctx, + ) + + if self.readable and not os.access(rv, os.R_OK): + self.fail( + _("{name} {filename!r} is not readable.").format( + name=self.name.title(), filename=format_filename(value) + ), + param, + ctx, + ) + + if self.writable and not os.access(rv, os.W_OK): + self.fail( + _("{name} {filename!r} is not writable.").format( + name=self.name.title(), filename=format_filename(value) + ), + param, + ctx, + ) + + if self.executable and not os.access(value, os.X_OK): + self.fail( + _("{name} {filename!r} is not executable.").format( + name=self.name.title(), filename=format_filename(value) + ), + param, + ctx, + ) + + return self.coerce_path_result(rv) + + def shell_complete( + self, ctx: Context, param: Parameter, incomplete: str + ) -> list[CompletionItem]: + """Return a special completion marker that tells the completion + system to use the shell to provide path completions for only + directories or any paths. + + :param ctx: Invocation context for this command. + :param param: The parameter that is requesting completion. + :param incomplete: Value being completed. May be empty. + + .. versionadded:: 8.0 + """ + from click.shell_completion import CompletionItem + + type = "dir" if self.dir_okay and not self.file_okay else "file" + return [CompletionItem(incomplete, type=type)] + + +class Tuple(CompositeParamType): + """The default behavior of Click is to apply a type on a value directly. + This works well in most cases, except for when `nargs` is set to a fixed + count and different types should be used for different items. In this + case the :class:`Tuple` type can be used. This type can only be used + if `nargs` is set to a fixed number. + + For more information see :ref:`tuple-type`. + + This can be selected by using a Python tuple literal as a type. + + :param types: a list of types that should be used for the tuple items. + """ + + def __init__(self, types: cabc.Sequence[type[t.Any] | ParamType]) -> None: + self.types: cabc.Sequence[ParamType] = [convert_type(ty) for ty in types] + + def to_info_dict(self) -> dict[str, t.Any]: + info_dict = super().to_info_dict() + info_dict["types"] = [t.to_info_dict() for t in self.types] + return info_dict + + @property + def name(self) -> str: # type: ignore + return f"<{' '.join(ty.name for ty in self.types)}>" + + @property + def arity(self) -> int: # type: ignore + return len(self.types) + + def convert( + self, value: t.Any, param: Parameter | None, ctx: Context | None + ) -> t.Any: + len_type = len(self.types) + len_value = len(value) + + if len_value != len_type: + self.fail( + ngettext( + "{len_type} values are required, but {len_value} was given.", + "{len_type} values are required, but {len_value} were given.", + len_value, + ).format(len_type=len_type, len_value=len_value), + param=param, + ctx=ctx, + ) + + return tuple( + ty(x, param, ctx) for ty, x in zip(self.types, value, strict=False) + ) + + +def convert_type(ty: t.Any | None, default: t.Any | None = None) -> ParamType: + """Find the most appropriate :class:`ParamType` for the given Python + type. If the type isn't provided, it can be inferred from a default + value. + """ + guessed_type = False + + if ty is None and default is not None: + if isinstance(default, (tuple, list)): + # If the default is empty, ty will remain None and will + # return STRING. + if default: + item = default[0] + + # A tuple of tuples needs to detect the inner types. + # Can't call convert recursively because that would + # incorrectly unwind the tuple to a single type. + if isinstance(item, (tuple, list)): + ty = tuple(map(type, item)) + else: + ty = type(item) + else: + ty = type(default) + + guessed_type = True + + if isinstance(ty, tuple): + return Tuple(ty) + + if isinstance(ty, ParamType): + return ty + + if ty is str or ty is None: + return STRING + + if ty is int: + return INT + + if ty is float: + return FLOAT + + if ty is bool: + return BOOL + + if guessed_type: + return STRING + + if __debug__: + try: + if issubclass(ty, ParamType): + raise AssertionError( + f"Attempted to use an uninstantiated parameter type ({ty})." + ) + except TypeError: + # ty is an instance (correct), so issubclass fails. + pass + + return FuncParamType(ty) + + +#: A dummy parameter type that just does nothing. From a user's +#: perspective this appears to just be the same as `STRING` but +#: internally no string conversion takes place if the input was bytes. +#: This is usually useful when working with file paths as they can +#: appear in bytes and unicode. +#: +#: For path related uses the :class:`Path` type is a better choice but +#: there are situations where an unprocessed type is useful which is why +#: it is is provided. +#: +#: .. versionadded:: 4.0 +UNPROCESSED = UnprocessedParamType() + +#: A unicode string parameter type which is the implicit default. This +#: can also be selected by using ``str`` as type. +STRING = StringParamType() + +#: An integer parameter. This can also be selected by using ``int`` as +#: type. +INT = IntParamType() + +#: A floating point value parameter. This can also be selected by using +#: ``float`` as type. +FLOAT = FloatParamType() + +#: A boolean parameter. This is the default for boolean flags. This can +#: also be selected by using ``bool`` as a type. +BOOL = BoolParamType() + +#: A UUID parameter. +UUID = UUIDParameterType() + + +class OptionHelpExtra(t.TypedDict, total=False): + envvars: tuple[str, ...] + default: str + range: str + required: str diff --git a/venv/Lib/site-packages/click/utils.py b/venv/Lib/site-packages/click/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..ab2fe5889cee75d559092442696f9b23bf20ebfb --- /dev/null +++ b/venv/Lib/site-packages/click/utils.py @@ -0,0 +1,627 @@ +from __future__ import annotations + +import collections.abc as cabc +import os +import re +import sys +import typing as t +from functools import update_wrapper +from types import ModuleType +from types import TracebackType + +from ._compat import _default_text_stderr +from ._compat import _default_text_stdout +from ._compat import _find_binary_writer +from ._compat import auto_wrap_for_ansi +from ._compat import binary_streams +from ._compat import open_stream +from ._compat import should_strip_ansi +from ._compat import strip_ansi +from ._compat import text_streams +from ._compat import WIN +from .globals import resolve_color_default + +if t.TYPE_CHECKING: + import typing_extensions as te + + P = te.ParamSpec("P") + +R = t.TypeVar("R") + + +def _posixify(name: str) -> str: + return "-".join(name.split()).lower() + + +def safecall(func: t.Callable[P, R]) -> t.Callable[P, R | None]: + """Wraps a function so that it swallows exceptions.""" + + def wrapper(*args: P.args, **kwargs: P.kwargs) -> R | None: + try: + return func(*args, **kwargs) + except Exception: + pass + return None + + return update_wrapper(wrapper, func) + + +def make_str(value: t.Any) -> str: + """Converts a value into a valid string.""" + if isinstance(value, bytes): + try: + return value.decode(sys.getfilesystemencoding()) + except UnicodeError: + return value.decode("utf-8", "replace") + return str(value) + + +def make_default_short_help(help: str, max_length: int = 45) -> str: + """Returns a condensed version of help string.""" + # Consider only the first paragraph. + paragraph_end = help.find("\n\n") + + if paragraph_end != -1: + help = help[:paragraph_end] + + # Collapse newlines, tabs, and spaces. + words = help.split() + + if not words: + return "" + + # The first paragraph started with a "no rewrap" marker, ignore it. + if words[0] == "\b": + words = words[1:] + + total_length = 0 + last_index = len(words) - 1 + + for i, word in enumerate(words): + total_length += len(word) + (i > 0) + + if total_length > max_length: # too long, truncate + break + + if word[-1] == ".": # sentence end, truncate without "..." + return " ".join(words[: i + 1]) + + if total_length == max_length and i != last_index: + break # not at sentence end, truncate with "..." + else: + return " ".join(words) # no truncation needed + + # Account for the length of the suffix. + total_length += len("...") + + # remove words until the length is short enough + while i > 0: + total_length -= len(words[i]) + (i > 0) + + if total_length <= max_length: + break + + i -= 1 + + return " ".join(words[:i]) + "..." + + +class LazyFile: + """A lazy file works like a regular file but it does not fully open + the file but it does perform some basic checks early to see if the + filename parameter does make sense. This is useful for safely opening + files for writing. + """ + + def __init__( + self, + filename: str | os.PathLike[str], + mode: str = "r", + encoding: str | None = None, + errors: str | None = "strict", + atomic: bool = False, + ): + self.name: str = os.fspath(filename) + self.mode = mode + self.encoding = encoding + self.errors = errors + self.atomic = atomic + self._f: t.IO[t.Any] | None + self.should_close: bool + + if self.name == "-": + self._f, self.should_close = open_stream(filename, mode, encoding, errors) + else: + if "r" in mode: + # Open and close the file in case we're opening it for + # reading so that we can catch at least some errors in + # some cases early. + open(filename, mode).close() + self._f = None + self.should_close = True + + def __getattr__(self, name: str) -> t.Any: + return getattr(self.open(), name) + + def __repr__(self) -> str: + if self._f is not None: + return repr(self._f) + return f"" + + def open(self) -> t.IO[t.Any]: + """Opens the file if it's not yet open. This call might fail with + a :exc:`FileError`. Not handling this error will produce an error + that Click shows. + """ + if self._f is not None: + return self._f + try: + rv, self.should_close = open_stream( + self.name, self.mode, self.encoding, self.errors, atomic=self.atomic + ) + except OSError as e: + from .exceptions import FileError + + raise FileError(self.name, hint=e.strerror) from e + self._f = rv + return rv + + def close(self) -> None: + """Closes the underlying file, no matter what.""" + if self._f is not None: + self._f.close() + + def close_intelligently(self) -> None: + """This function only closes the file if it was opened by the lazy + file wrapper. For instance this will never close stdin. + """ + if self.should_close: + self.close() + + def __enter__(self) -> LazyFile: + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_value: BaseException | None, + tb: TracebackType | None, + ) -> None: + self.close_intelligently() + + def __iter__(self) -> cabc.Iterator[t.AnyStr]: + self.open() + return iter(self._f) # type: ignore + + +class KeepOpenFile: + def __init__(self, file: t.IO[t.Any]) -> None: + self._file: t.IO[t.Any] = file + + def __getattr__(self, name: str) -> t.Any: + return getattr(self._file, name) + + def __enter__(self) -> KeepOpenFile: + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_value: BaseException | None, + tb: TracebackType | None, + ) -> None: + pass + + def __repr__(self) -> str: + return repr(self._file) + + def __iter__(self) -> cabc.Iterator[t.AnyStr]: + return iter(self._file) + + +def echo( + message: t.Any | None = None, + file: t.IO[t.Any] | None = None, + nl: bool = True, + err: bool = False, + color: bool | None = None, +) -> None: + """Print a message and newline to stdout or a file. This should be + used instead of :func:`print` because it provides better support + for different data, files, and environments. + + Compared to :func:`print`, this does the following: + + - Ensures that the output encoding is not misconfigured on Linux. + - Supports Unicode in the Windows console. + - Supports writing to binary outputs, and supports writing bytes + to text outputs. + - Supports colors and styles on Windows. + - Removes ANSI color and style codes if the output does not look + like an interactive terminal. + - Always flushes the output. + + :param message: The string or bytes to output. Other objects are + converted to strings. + :param file: The file to write to. Defaults to ``stdout``. + :param err: Write to ``stderr`` instead of ``stdout``. + :param nl: Print a newline after the message. Enabled by default. + :param color: Force showing or hiding colors and other styles. By + default Click will remove color if the output does not look like + an interactive terminal. + + .. versionchanged:: 6.0 + Support Unicode output on the Windows console. Click does not + modify ``sys.stdout``, so ``sys.stdout.write()`` and ``print()`` + will still not support Unicode. + + .. versionchanged:: 4.0 + Added the ``color`` parameter. + + .. versionadded:: 3.0 + Added the ``err`` parameter. + + .. versionchanged:: 2.0 + Support colors on Windows if colorama is installed. + """ + if file is None: + if err: + file = _default_text_stderr() + else: + file = _default_text_stdout() + + # There are no standard streams attached to write to. For example, + # pythonw on Windows. + if file is None: + return + + # Convert non bytes/text into the native string type. + if message is not None and not isinstance(message, (str, bytes, bytearray)): + out: str | bytes | None = str(message) + else: + out = message + + if nl: + out = out or "" + if isinstance(out, str): + out += "\n" + else: + out += b"\n" + + if not out: + file.flush() + return + + # If there is a message and the value looks like bytes, we manually + # need to find the binary stream and write the message in there. + # This is done separately so that most stream types will work as you + # would expect. Eg: you can write to StringIO for other cases. + if isinstance(out, (bytes, bytearray)): + binary_file = _find_binary_writer(file) + + if binary_file is not None: + file.flush() + binary_file.write(out) + binary_file.flush() + return + + # ANSI style code support. For no message or bytes, nothing happens. + # When outputting to a file instead of a terminal, strip codes. + else: + color = resolve_color_default(color) + + if should_strip_ansi(file, color): + out = strip_ansi(out) + elif WIN: + if auto_wrap_for_ansi is not None: + file = auto_wrap_for_ansi(file, color) # type: ignore + elif not color: + out = strip_ansi(out) + + file.write(out) # type: ignore + file.flush() + + +def get_binary_stream(name: t.Literal["stdin", "stdout", "stderr"]) -> t.BinaryIO: + """Returns a system stream for byte processing. + + :param name: the name of the stream to open. Valid names are ``'stdin'``, + ``'stdout'`` and ``'stderr'`` + """ + opener = binary_streams.get(name) + if opener is None: + raise TypeError(f"Unknown standard stream '{name}'") + return opener() + + +def get_text_stream( + name: t.Literal["stdin", "stdout", "stderr"], + encoding: str | None = None, + errors: str | None = "strict", +) -> t.TextIO: + """Returns a system stream for text processing. This usually returns + a wrapped stream around a binary stream returned from + :func:`get_binary_stream` but it also can take shortcuts for already + correctly configured streams. + + :param name: the name of the stream to open. Valid names are ``'stdin'``, + ``'stdout'`` and ``'stderr'`` + :param encoding: overrides the detected default encoding. + :param errors: overrides the default error mode. + """ + opener = text_streams.get(name) + if opener is None: + raise TypeError(f"Unknown standard stream '{name}'") + return opener(encoding, errors) + + +def open_file( + filename: str | os.PathLike[str], + mode: str = "r", + encoding: str | None = None, + errors: str | None = "strict", + lazy: bool = False, + atomic: bool = False, +) -> t.IO[t.Any]: + """Open a file, with extra behavior to handle ``'-'`` to indicate + a standard stream, lazy open on write, and atomic write. Similar to + the behavior of the :class:`~click.File` param type. + + If ``'-'`` is given to open ``stdout`` or ``stdin``, the stream is + wrapped so that using it in a context manager will not close it. + This makes it possible to use the function without accidentally + closing a standard stream: + + .. code-block:: python + + with open_file(filename) as f: + ... + + :param filename: The name or Path of the file to open, or ``'-'`` for + ``stdin``/``stdout``. + :param mode: The mode in which to open the file. + :param encoding: The encoding to decode or encode a file opened in + text mode. + :param errors: The error handling mode. + :param lazy: Wait to open the file until it is accessed. For read + mode, the file is temporarily opened to raise access errors + early, then closed until it is read again. + :param atomic: Write to a temporary file and replace the given file + on close. + + .. versionadded:: 3.0 + """ + if lazy: + return t.cast( + "t.IO[t.Any]", LazyFile(filename, mode, encoding, errors, atomic=atomic) + ) + + f, should_close = open_stream(filename, mode, encoding, errors, atomic=atomic) + + if not should_close: + f = t.cast("t.IO[t.Any]", KeepOpenFile(f)) + + return f + + +def format_filename( + filename: str | bytes | os.PathLike[str] | os.PathLike[bytes], + shorten: bool = False, +) -> str: + """Format a filename as a string for display. Ensures the filename can be + displayed by replacing any invalid bytes or surrogate escapes in the name + with the replacement character ``�``. + + Invalid bytes or surrogate escapes will raise an error when written to a + stream with ``errors="strict"``. This will typically happen with ``stdout`` + when the locale is something like ``en_GB.UTF-8``. + + Many scenarios *are* safe to write surrogates though, due to PEP 538 and + PEP 540, including: + + - Writing to ``stderr``, which uses ``errors="backslashreplace"``. + - The system has ``LANG=C.UTF-8``, ``C``, or ``POSIX``. Python opens + stdout and stderr with ``errors="surrogateescape"``. + - None of ``LANG/LC_*`` are set. Python assumes ``LANG=C.UTF-8``. + - Python is started in UTF-8 mode with ``PYTHONUTF8=1`` or ``-X utf8``. + Python opens stdout and stderr with ``errors="surrogateescape"``. + + :param filename: formats a filename for UI display. This will also convert + the filename into unicode without failing. + :param shorten: this optionally shortens the filename to strip of the + path that leads up to it. + """ + if shorten: + filename = os.path.basename(filename) + else: + filename = os.fspath(filename) + + if isinstance(filename, bytes): + filename = filename.decode(sys.getfilesystemencoding(), "replace") + else: + filename = filename.encode("utf-8", "surrogateescape").decode( + "utf-8", "replace" + ) + + return filename + + +def get_app_dir(app_name: str, roaming: bool = True, force_posix: bool = False) -> str: + r"""Returns the config folder for the application. The default behavior + is to return whatever is most appropriate for the operating system. + + To give you an idea, for an app called ``"Foo Bar"``, something like + the following folders could be returned: + + Mac OS X: + ``~/Library/Application Support/Foo Bar`` + Mac OS X (POSIX): + ``~/.foo-bar`` + Unix: + ``~/.config/foo-bar`` + Unix (POSIX): + ``~/.foo-bar`` + Windows (roaming): + ``C:\Users\\AppData\Roaming\Foo Bar`` + Windows (not roaming): + ``C:\Users\\AppData\Local\Foo Bar`` + + .. versionadded:: 2.0 + + :param app_name: the application name. This should be properly capitalized + and can contain whitespace. + :param roaming: controls if the folder should be roaming or not on Windows. + Has no effect otherwise. + :param force_posix: if this is set to `True` then on any POSIX system the + folder will be stored in the home folder with a leading + dot instead of the XDG config home or darwin's + application support folder. + """ + if WIN: + key = "APPDATA" if roaming else "LOCALAPPDATA" + folder = os.environ.get(key) + if folder is None: + folder = os.path.expanduser("~") + return os.path.join(folder, app_name) + if force_posix: + return os.path.join(os.path.expanduser(f"~/.{_posixify(app_name)}")) + if sys.platform == "darwin": + return os.path.join( + os.path.expanduser("~/Library/Application Support"), app_name + ) + return os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.path.expanduser("~/.config")), + _posixify(app_name), + ) + + +class PacifyFlushWrapper: + """This wrapper is used to catch and suppress BrokenPipeErrors resulting + from ``.flush()`` being called on broken pipe during the shutdown/final-GC + of the Python interpreter. Notably ``.flush()`` is always called on + ``sys.stdout`` and ``sys.stderr``. So as to have minimal impact on any + other cleanup code, and the case where the underlying file is not a broken + pipe, all calls and attributes are proxied. + """ + + def __init__(self, wrapped: t.IO[t.Any]) -> None: + self.wrapped = wrapped + + def flush(self) -> None: + try: + self.wrapped.flush() + except OSError as e: + import errno + + if e.errno != errno.EPIPE: + raise + + def __getattr__(self, attr: str) -> t.Any: + return getattr(self.wrapped, attr) + + +def _detect_program_name( + path: str | None = None, _main: ModuleType | None = None +) -> str: + """Determine the command used to run the program, for use in help + text. If a file or entry point was executed, the file name is + returned. If ``python -m`` was used to execute a module or package, + ``python -m name`` is returned. + + This doesn't try to be too precise, the goal is to give a concise + name for help text. Files are only shown as their name without the + path. ``python`` is only shown for modules, and the full path to + ``sys.executable`` is not shown. + + :param path: The Python file being executed. Python puts this in + ``sys.argv[0]``, which is used by default. + :param _main: The ``__main__`` module. This should only be passed + during internal testing. + + .. versionadded:: 8.0 + Based on command args detection in the Werkzeug reloader. + + :meta private: + """ + if _main is None: + _main = sys.modules["__main__"] + + if not path: + path = sys.argv[0] + + # The value of __package__ indicates how Python was called. It may + # not exist if a setuptools script is installed as an egg. It may be + # set incorrectly for entry points created with pip on Windows. + # It is set to "" inside a Shiv or PEX zipapp. + if getattr(_main, "__package__", None) in {None, ""} or ( + os.name == "nt" + and _main.__package__ == "" + and not os.path.exists(path) + and os.path.exists(f"{path}.exe") + ): + # Executed a file, like "python app.py". + return os.path.basename(path) + + # Executed a module, like "python -m example". + # Rewritten by Python from "-m script" to "/path/to/script.py". + # Need to look at main module to determine how it was executed. + py_module = t.cast(str, _main.__package__) + name = os.path.splitext(os.path.basename(path))[0] + + # A submodule like "example.cli". + if name != "__main__": + py_module = f"{py_module}.{name}" + + return f"python -m {py_module.lstrip('.')}" + + +def _expand_args( + args: cabc.Iterable[str], + *, + user: bool = True, + env: bool = True, + glob_recursive: bool = True, +) -> list[str]: + """Simulate Unix shell expansion with Python functions. + + See :func:`glob.glob`, :func:`os.path.expanduser`, and + :func:`os.path.expandvars`. + + This is intended for use on Windows, where the shell does not do any + expansion. It may not exactly match what a Unix shell would do. + + :param args: List of command line arguments to expand. + :param user: Expand user home directory. + :param env: Expand environment variables. + :param glob_recursive: ``**`` matches directories recursively. + + .. versionchanged:: 8.1 + Invalid glob patterns are treated as empty expansions rather + than raising an error. + + .. versionadded:: 8.0 + + :meta private: + """ + from glob import glob + + out = [] + + for arg in args: + if user: + arg = os.path.expanduser(arg) + + if env: + arg = os.path.expandvars(arg) + + try: + matches = glob(arg, recursive=glob_recursive) + except re.error: + matches = [] + + if not matches: + out.append(arg) + else: + out.extend(matches) + + return out diff --git a/venv/Lib/site-packages/colorama-0.4.6.dist-info/INSTALLER b/venv/Lib/site-packages/colorama-0.4.6.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/venv/Lib/site-packages/colorama-0.4.6.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/venv/Lib/site-packages/colorama-0.4.6.dist-info/METADATA b/venv/Lib/site-packages/colorama-0.4.6.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..a1b5c57543005b310ac2efb02243a6b6ab6d8932 --- /dev/null +++ b/venv/Lib/site-packages/colorama-0.4.6.dist-info/METADATA @@ -0,0 +1,441 @@ +Metadata-Version: 2.1 +Name: colorama +Version: 0.4.6 +Summary: Cross-platform colored terminal text. +Project-URL: Homepage, https://github.com/tartley/colorama +Author-email: Jonathan Hartley +License-File: LICENSE.txt +Keywords: ansi,color,colour,crossplatform,terminal,text,windows,xplatform +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Console +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Topic :: Terminals +Requires-Python: !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7 +Description-Content-Type: text/x-rst + +.. image:: https://img.shields.io/pypi/v/colorama.svg + :target: https://pypi.org/project/colorama/ + :alt: Latest Version + +.. image:: https://img.shields.io/pypi/pyversions/colorama.svg + :target: https://pypi.org/project/colorama/ + :alt: Supported Python versions + +.. image:: https://github.com/tartley/colorama/actions/workflows/test.yml/badge.svg + :target: https://github.com/tartley/colorama/actions/workflows/test.yml + :alt: Build Status + +Colorama +======== + +Makes ANSI escape character sequences (for producing colored terminal text and +cursor positioning) work under MS Windows. + +.. |donate| image:: https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif + :target: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=2MZ9D2GMLYCUJ&item_name=Colorama¤cy_code=USD + :alt: Donate with Paypal + +`PyPI for releases `_ | +`Github for source `_ | +`Colorama for enterprise on Tidelift `_ + +If you find Colorama useful, please |donate| to the authors. Thank you! + +Installation +------------ + +Tested on CPython 2.7, 3.7, 3.8, 3.9 and 3.10 and Pypy 2.7 and 3.8. + +No requirements other than the standard library. + +.. code-block:: bash + + pip install colorama + # or + conda install -c anaconda colorama + +Description +----------- + +ANSI escape character sequences have long been used to produce colored terminal +text and cursor positioning on Unix and Macs. Colorama makes this work on +Windows, too, by wrapping ``stdout``, stripping ANSI sequences it finds (which +would appear as gobbledygook in the output), and converting them into the +appropriate win32 calls to modify the state of the terminal. On other platforms, +Colorama does nothing. + +This has the upshot of providing a simple cross-platform API for printing +colored terminal text from Python, and has the happy side-effect that existing +applications or libraries which use ANSI sequences to produce colored output on +Linux or Macs can now also work on Windows, simply by calling +``colorama.just_fix_windows_console()`` (since v0.4.6) or ``colorama.init()`` +(all versions, but may have other side-effects – see below). + +An alternative approach is to install ``ansi.sys`` on Windows machines, which +provides the same behaviour for all applications running in terminals. Colorama +is intended for situations where that isn't easy (e.g., maybe your app doesn't +have an installer.) + +Demo scripts in the source code repository print some colored text using +ANSI sequences. Compare their output under Gnome-terminal's built in ANSI +handling, versus on Windows Command-Prompt using Colorama: + +.. image:: https://github.com/tartley/colorama/raw/master/screenshots/ubuntu-demo.png + :width: 661 + :height: 357 + :alt: ANSI sequences on Ubuntu under gnome-terminal. + +.. image:: https://github.com/tartley/colorama/raw/master/screenshots/windows-demo.png + :width: 668 + :height: 325 + :alt: Same ANSI sequences on Windows, using Colorama. + +These screenshots show that, on Windows, Colorama does not support ANSI 'dim +text'; it looks the same as 'normal text'. + +Usage +----- + +Initialisation +.............. + +If the only thing you want from Colorama is to get ANSI escapes to work on +Windows, then run: + +.. code-block:: python + + from colorama import just_fix_windows_console + just_fix_windows_console() + +If you're on a recent version of Windows 10 or better, and your stdout/stderr +are pointing to a Windows console, then this will flip the magic configuration +switch to enable Windows' built-in ANSI support. + +If you're on an older version of Windows, and your stdout/stderr are pointing to +a Windows console, then this will wrap ``sys.stdout`` and/or ``sys.stderr`` in a +magic file object that intercepts ANSI escape sequences and issues the +appropriate Win32 calls to emulate them. + +In all other circumstances, it does nothing whatsoever. Basically the idea is +that this makes Windows act like Unix with respect to ANSI escape handling. + +It's safe to call this function multiple times. It's safe to call this function +on non-Windows platforms, but it won't do anything. It's safe to call this +function when one or both of your stdout/stderr are redirected to a file – it +won't do anything to those streams. + +Alternatively, you can use the older interface with more features (but also more +potential footguns): + +.. code-block:: python + + from colorama import init + init() + +This does the same thing as ``just_fix_windows_console``, except for the +following differences: + +- It's not safe to call ``init`` multiple times; you can end up with multiple + layers of wrapping and broken ANSI support. + +- Colorama will apply a heuristic to guess whether stdout/stderr support ANSI, + and if it thinks they don't, then it will wrap ``sys.stdout`` and + ``sys.stderr`` in a magic file object that strips out ANSI escape sequences + before printing them. This happens on all platforms, and can be convenient if + you want to write your code to emit ANSI escape sequences unconditionally, and + let Colorama decide whether they should actually be output. But note that + Colorama's heuristic is not particularly clever. + +- ``init`` also accepts explicit keyword args to enable/disable various + functionality – see below. + +To stop using Colorama before your program exits, simply call ``deinit()``. +This will restore ``stdout`` and ``stderr`` to their original values, so that +Colorama is disabled. To resume using Colorama again, call ``reinit()``; it is +cheaper than calling ``init()`` again (but does the same thing). + +Most users should depend on ``colorama >= 0.4.6``, and use +``just_fix_windows_console``. The old ``init`` interface will be supported +indefinitely for backwards compatibility, but we don't plan to fix any issues +with it, also for backwards compatibility. + +Colored Output +.............. + +Cross-platform printing of colored text can then be done using Colorama's +constant shorthand for ANSI escape sequences. These are deliberately +rudimentary, see below. + +.. code-block:: python + + from colorama import Fore, Back, Style + print(Fore.RED + 'some red text') + print(Back.GREEN + 'and with a green background') + print(Style.DIM + 'and in dim text') + print(Style.RESET_ALL) + print('back to normal now') + +...or simply by manually printing ANSI sequences from your own code: + +.. code-block:: python + + print('\033[31m' + 'some red text') + print('\033[39m') # and reset to default color + +...or, Colorama can be used in conjunction with existing ANSI libraries +such as the venerable `Termcolor `_ +the fabulous `Blessings `_, +or the incredible `_Rich `_. + +If you wish Colorama's Fore, Back and Style constants were more capable, +then consider using one of the above highly capable libraries to generate +colors, etc, and use Colorama just for its primary purpose: to convert +those ANSI sequences to also work on Windows: + +SIMILARLY, do not send PRs adding the generation of new ANSI types to Colorama. +We are only interested in converting ANSI codes to win32 API calls, not +shortcuts like the above to generate ANSI characters. + +.. code-block:: python + + from colorama import just_fix_windows_console + from termcolor import colored + + # use Colorama to make Termcolor work on Windows too + just_fix_windows_console() + + # then use Termcolor for all colored text output + print(colored('Hello, World!', 'green', 'on_red')) + +Available formatting constants are:: + + Fore: BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, RESET. + Back: BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, RESET. + Style: DIM, NORMAL, BRIGHT, RESET_ALL + +``Style.RESET_ALL`` resets foreground, background, and brightness. Colorama will +perform this reset automatically on program exit. + +These are fairly well supported, but not part of the standard:: + + Fore: LIGHTBLACK_EX, LIGHTRED_EX, LIGHTGREEN_EX, LIGHTYELLOW_EX, LIGHTBLUE_EX, LIGHTMAGENTA_EX, LIGHTCYAN_EX, LIGHTWHITE_EX + Back: LIGHTBLACK_EX, LIGHTRED_EX, LIGHTGREEN_EX, LIGHTYELLOW_EX, LIGHTBLUE_EX, LIGHTMAGENTA_EX, LIGHTCYAN_EX, LIGHTWHITE_EX + +Cursor Positioning +.................. + +ANSI codes to reposition the cursor are supported. See ``demos/demo06.py`` for +an example of how to generate them. + +Init Keyword Args +................. + +``init()`` accepts some ``**kwargs`` to override default behaviour. + +init(autoreset=False): + If you find yourself repeatedly sending reset sequences to turn off color + changes at the end of every print, then ``init(autoreset=True)`` will + automate that: + + .. code-block:: python + + from colorama import init + init(autoreset=True) + print(Fore.RED + 'some red text') + print('automatically back to default color again') + +init(strip=None): + Pass ``True`` or ``False`` to override whether ANSI codes should be + stripped from the output. The default behaviour is to strip if on Windows + or if output is redirected (not a tty). + +init(convert=None): + Pass ``True`` or ``False`` to override whether to convert ANSI codes in the + output into win32 calls. The default behaviour is to convert if on Windows + and output is to a tty (terminal). + +init(wrap=True): + On Windows, Colorama works by replacing ``sys.stdout`` and ``sys.stderr`` + with proxy objects, which override the ``.write()`` method to do their work. + If this wrapping causes you problems, then this can be disabled by passing + ``init(wrap=False)``. The default behaviour is to wrap if ``autoreset`` or + ``strip`` or ``convert`` are True. + + When wrapping is disabled, colored printing on non-Windows platforms will + continue to work as normal. To do cross-platform colored output, you can + use Colorama's ``AnsiToWin32`` proxy directly: + + .. code-block:: python + + import sys + from colorama import init, AnsiToWin32 + init(wrap=False) + stream = AnsiToWin32(sys.stderr).stream + + # Python 2 + print >>stream, Fore.BLUE + 'blue text on stderr' + + # Python 3 + print(Fore.BLUE + 'blue text on stderr', file=stream) + +Recognised ANSI Sequences +......................... + +ANSI sequences generally take the form:: + + ESC [ ; ... + +Where ```` is an integer, and ```` is a single letter. Zero or +more params are passed to a ````. If no params are passed, it is +generally synonymous with passing a single zero. No spaces exist in the +sequence; they have been inserted here simply to read more easily. + +The only ANSI sequences that Colorama converts into win32 calls are:: + + ESC [ 0 m # reset all (colors and brightness) + ESC [ 1 m # bright + ESC [ 2 m # dim (looks same as normal brightness) + ESC [ 22 m # normal brightness + + # FOREGROUND: + ESC [ 30 m # black + ESC [ 31 m # red + ESC [ 32 m # green + ESC [ 33 m # yellow + ESC [ 34 m # blue + ESC [ 35 m # magenta + ESC [ 36 m # cyan + ESC [ 37 m # white + ESC [ 39 m # reset + + # BACKGROUND + ESC [ 40 m # black + ESC [ 41 m # red + ESC [ 42 m # green + ESC [ 43 m # yellow + ESC [ 44 m # blue + ESC [ 45 m # magenta + ESC [ 46 m # cyan + ESC [ 47 m # white + ESC [ 49 m # reset + + # cursor positioning + ESC [ y;x H # position cursor at x across, y down + ESC [ y;x f # position cursor at x across, y down + ESC [ n A # move cursor n lines up + ESC [ n B # move cursor n lines down + ESC [ n C # move cursor n characters forward + ESC [ n D # move cursor n characters backward + + # clear the screen + ESC [ mode J # clear the screen + + # clear the line + ESC [ mode K # clear the line + +Multiple numeric params to the ``'m'`` command can be combined into a single +sequence:: + + ESC [ 36 ; 45 ; 1 m # bright cyan text on magenta background + +All other ANSI sequences of the form ``ESC [ ; ... `` +are silently stripped from the output on Windows. + +Any other form of ANSI sequence, such as single-character codes or alternative +initial characters, are not recognised or stripped. It would be cool to add +them though. Let me know if it would be useful for you, via the Issues on +GitHub. + +Status & Known Problems +----------------------- + +I've personally only tested it on Windows XP (CMD, Console2), Ubuntu +(gnome-terminal, xterm), and OS X. + +Some valid ANSI sequences aren't recognised. + +If you're hacking on the code, see `README-hacking.md`_. ESPECIALLY, see the +explanation there of why we do not want PRs that allow Colorama to generate new +types of ANSI codes. + +See outstanding issues and wish-list: +https://github.com/tartley/colorama/issues + +If anything doesn't work for you, or doesn't do what you expected or hoped for, +I'd love to hear about it on that issues list, would be delighted by patches, +and would be happy to grant commit access to anyone who submits a working patch +or two. + +.. _README-hacking.md: README-hacking.md + +License +------- + +Copyright Jonathan Hartley & Arnon Yaari, 2013-2020. BSD 3-Clause license; see +LICENSE file. + +Professional support +-------------------- + +.. |tideliftlogo| image:: https://cdn2.hubspot.net/hubfs/4008838/website/logos/logos_for_download/Tidelift_primary-shorthand-logo.png + :alt: Tidelift + :target: https://tidelift.com/subscription/pkg/pypi-colorama?utm_source=pypi-colorama&utm_medium=referral&utm_campaign=readme + +.. list-table:: + :widths: 10 100 + + * - |tideliftlogo| + - Professional support for colorama is available as part of the + `Tidelift Subscription`_. + Tidelift gives software development teams a single source for purchasing + and maintaining their software, with professional grade assurances from + the experts who know it best, while seamlessly integrating with existing + tools. + +.. _Tidelift Subscription: https://tidelift.com/subscription/pkg/pypi-colorama?utm_source=pypi-colorama&utm_medium=referral&utm_campaign=readme + +Thanks +------ + +See the CHANGELOG for more thanks! + +* Marc Schlaich (schlamar) for a ``setup.py`` fix for Python2.5. +* Marc Abramowitz, reported & fixed a crash on exit with closed ``stdout``, + providing a solution to issue #7's setuptools/distutils debate, + and other fixes. +* User 'eryksun', for guidance on correctly instantiating ``ctypes.windll``. +* Matthew McCormick for politely pointing out a longstanding crash on non-Win. +* Ben Hoyt, for a magnificent fix under 64-bit Windows. +* Jesse at Empty Square for submitting a fix for examples in the README. +* User 'jamessp', an observant documentation fix for cursor positioning. +* User 'vaal1239', Dave Mckee & Lackner Kristof for a tiny but much-needed Win7 + fix. +* Julien Stuyck, for wisely suggesting Python3 compatible updates to README. +* Daniel Griffith for multiple fabulous patches. +* Oscar Lesta for a valuable fix to stop ANSI chars being sent to non-tty + output. +* Roger Binns, for many suggestions, valuable feedback, & bug reports. +* Tim Golden for thought and much appreciated feedback on the initial idea. +* User 'Zearin' for updates to the README file. +* John Szakmeister for adding support for light colors +* Charles Merriam for adding documentation to demos +* Jurko for a fix on 64-bit Windows CPython2.5 w/o ctypes +* Florian Bruhin for a fix when stdout or stderr are None +* Thomas Weininger for fixing ValueError on Windows +* Remi Rampin for better Github integration and fixes to the README file +* Simeon Visser for closing a file handle using 'with' and updating classifiers + to include Python 3.3 and 3.4 +* Andy Neff for fixing RESET of LIGHT_EX colors. +* Jonathan Hartley for the initial idea and implementation. diff --git a/venv/Lib/site-packages/colorama-0.4.6.dist-info/RECORD b/venv/Lib/site-packages/colorama-0.4.6.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..ace23fb2097c6faef4c16a0a5cda609cd9ced52f --- /dev/null +++ b/venv/Lib/site-packages/colorama-0.4.6.dist-info/RECORD @@ -0,0 +1,31 @@ +colorama-0.4.6.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +colorama-0.4.6.dist-info/METADATA,sha256=e67SnrUMOym9sz_4TjF3vxvAV4T3aF7NyqRHHH3YEMw,17158 +colorama-0.4.6.dist-info/RECORD,, +colorama-0.4.6.dist-info/WHEEL,sha256=cdcF4Fbd0FPtw2EMIOwH-3rSOTUdTCeOSXRMD1iLUb8,105 +colorama-0.4.6.dist-info/licenses/LICENSE.txt,sha256=ysNcAmhuXQSlpxQL-zs25zrtSWZW6JEQLkKIhteTAxg,1491 +colorama/__init__.py,sha256=wePQA4U20tKgYARySLEC047ucNX-g8pRLpYBuiHlLb8,266 +colorama/__pycache__/__init__.cpython-313.pyc,, +colorama/__pycache__/ansi.cpython-313.pyc,, +colorama/__pycache__/ansitowin32.cpython-313.pyc,, +colorama/__pycache__/initialise.cpython-313.pyc,, +colorama/__pycache__/win32.cpython-313.pyc,, +colorama/__pycache__/winterm.cpython-313.pyc,, +colorama/ansi.py,sha256=Top4EeEuaQdBWdteKMEcGOTeKeF19Q-Wo_6_Cj5kOzQ,2522 +colorama/ansitowin32.py,sha256=vPNYa3OZbxjbuFyaVo0Tmhmy1FZ1lKMWCnT7odXpItk,11128 +colorama/initialise.py,sha256=-hIny86ClXo39ixh5iSCfUIa2f_h_bgKRDW7gqs-KLU,3325 +colorama/tests/__init__.py,sha256=MkgPAEzGQd-Rq0w0PZXSX2LadRWhUECcisJY8lSrm4Q,75 +colorama/tests/__pycache__/__init__.cpython-313.pyc,, +colorama/tests/__pycache__/ansi_test.cpython-313.pyc,, +colorama/tests/__pycache__/ansitowin32_test.cpython-313.pyc,, +colorama/tests/__pycache__/initialise_test.cpython-313.pyc,, +colorama/tests/__pycache__/isatty_test.cpython-313.pyc,, +colorama/tests/__pycache__/utils.cpython-313.pyc,, +colorama/tests/__pycache__/winterm_test.cpython-313.pyc,, +colorama/tests/ansi_test.py,sha256=FeViDrUINIZcr505PAxvU4AjXz1asEiALs9GXMhwRaE,2839 +colorama/tests/ansitowin32_test.py,sha256=RN7AIhMJ5EqDsYaCjVo-o4u8JzDD4ukJbmevWKS70rY,10678 +colorama/tests/initialise_test.py,sha256=BbPy-XfyHwJ6zKozuQOvNvQZzsx9vdb_0bYXn7hsBTc,6741 +colorama/tests/isatty_test.py,sha256=Pg26LRpv0yQDB5Ac-sxgVXG7hsA1NYvapFgApZfYzZg,1866 +colorama/tests/utils.py,sha256=1IIRylG39z5-dzq09R_ngufxyPZxgldNbrxKxUGwGKE,1079 +colorama/tests/winterm_test.py,sha256=qoWFPEjym5gm2RuMwpf3pOis3a5r_PJZFCzK254JL8A,3709 +colorama/win32.py,sha256=YQOKwMTwtGBbsY4dL5HYTvwTeP9wIQra5MvPNddpxZs,6181 +colorama/winterm.py,sha256=XCQFDHjPi6AHYNdZwy0tA02H-Jh48Jp-HvCjeLeLp3U,7134 diff --git a/venv/Lib/site-packages/colorama-0.4.6.dist-info/WHEEL b/venv/Lib/site-packages/colorama-0.4.6.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..d79189fda3251187de18c3998f23ae6fec11b20f --- /dev/null +++ b/venv/Lib/site-packages/colorama-0.4.6.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: hatchling 1.11.1 +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any diff --git a/venv/Lib/site-packages/colorama-0.4.6.dist-info/licenses/LICENSE.txt b/venv/Lib/site-packages/colorama-0.4.6.dist-info/licenses/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..3105888ec149d10cad51c11d332779e94b548661 --- /dev/null +++ b/venv/Lib/site-packages/colorama-0.4.6.dist-info/licenses/LICENSE.txt @@ -0,0 +1,27 @@ +Copyright (c) 2010 Jonathan Hartley +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holders, nor those of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/venv/Lib/site-packages/colorama/__init__.py b/venv/Lib/site-packages/colorama/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..383101cdb38706c305449674044e9288b92b7d75 --- /dev/null +++ b/venv/Lib/site-packages/colorama/__init__.py @@ -0,0 +1,7 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. +from .initialise import init, deinit, reinit, colorama_text, just_fix_windows_console +from .ansi import Fore, Back, Style, Cursor +from .ansitowin32 import AnsiToWin32 + +__version__ = '0.4.6' + diff --git a/venv/Lib/site-packages/colorama/__pycache__/__init__.cpython-313.pyc b/venv/Lib/site-packages/colorama/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b09c358f21db07ab96173e05a6039de5c6da8d06 Binary files /dev/null and b/venv/Lib/site-packages/colorama/__pycache__/__init__.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/colorama/__pycache__/ansi.cpython-313.pyc b/venv/Lib/site-packages/colorama/__pycache__/ansi.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..acc85900fd853eac3ddedb0210ffd3cf9fbb03aa Binary files /dev/null and b/venv/Lib/site-packages/colorama/__pycache__/ansi.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/colorama/__pycache__/ansitowin32.cpython-313.pyc b/venv/Lib/site-packages/colorama/__pycache__/ansitowin32.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0ea7b7f5d4153c0a84010322376fa07ba6735db7 Binary files /dev/null and b/venv/Lib/site-packages/colorama/__pycache__/ansitowin32.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/colorama/__pycache__/initialise.cpython-313.pyc b/venv/Lib/site-packages/colorama/__pycache__/initialise.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2bc40667d16762632ea8b52e71aede5324c0f4a2 Binary files /dev/null and b/venv/Lib/site-packages/colorama/__pycache__/initialise.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/colorama/__pycache__/win32.cpython-313.pyc b/venv/Lib/site-packages/colorama/__pycache__/win32.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7574617d2bc94ac53a79a895a8946fc419ca1605 Binary files /dev/null and b/venv/Lib/site-packages/colorama/__pycache__/win32.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/colorama/__pycache__/winterm.cpython-313.pyc b/venv/Lib/site-packages/colorama/__pycache__/winterm.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2cc1aa205f20b7b4a72b9c01854c4faf56c9f08b Binary files /dev/null and b/venv/Lib/site-packages/colorama/__pycache__/winterm.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/colorama/ansi.py b/venv/Lib/site-packages/colorama/ansi.py new file mode 100644 index 0000000000000000000000000000000000000000..11ec695ff79627463a0282d25079527562de9e42 --- /dev/null +++ b/venv/Lib/site-packages/colorama/ansi.py @@ -0,0 +1,102 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. +''' +This module generates ANSI character codes to printing colors to terminals. +See: http://en.wikipedia.org/wiki/ANSI_escape_code +''' + +CSI = '\033[' +OSC = '\033]' +BEL = '\a' + + +def code_to_chars(code): + return CSI + str(code) + 'm' + +def set_title(title): + return OSC + '2;' + title + BEL + +def clear_screen(mode=2): + return CSI + str(mode) + 'J' + +def clear_line(mode=2): + return CSI + str(mode) + 'K' + + +class AnsiCodes(object): + def __init__(self): + # the subclasses declare class attributes which are numbers. + # Upon instantiation we define instance attributes, which are the same + # as the class attributes but wrapped with the ANSI escape sequence + for name in dir(self): + if not name.startswith('_'): + value = getattr(self, name) + setattr(self, name, code_to_chars(value)) + + +class AnsiCursor(object): + def UP(self, n=1): + return CSI + str(n) + 'A' + def DOWN(self, n=1): + return CSI + str(n) + 'B' + def FORWARD(self, n=1): + return CSI + str(n) + 'C' + def BACK(self, n=1): + return CSI + str(n) + 'D' + def POS(self, x=1, y=1): + return CSI + str(y) + ';' + str(x) + 'H' + + +class AnsiFore(AnsiCodes): + BLACK = 30 + RED = 31 + GREEN = 32 + YELLOW = 33 + BLUE = 34 + MAGENTA = 35 + CYAN = 36 + WHITE = 37 + RESET = 39 + + # These are fairly well supported, but not part of the standard. + LIGHTBLACK_EX = 90 + LIGHTRED_EX = 91 + LIGHTGREEN_EX = 92 + LIGHTYELLOW_EX = 93 + LIGHTBLUE_EX = 94 + LIGHTMAGENTA_EX = 95 + LIGHTCYAN_EX = 96 + LIGHTWHITE_EX = 97 + + +class AnsiBack(AnsiCodes): + BLACK = 40 + RED = 41 + GREEN = 42 + YELLOW = 43 + BLUE = 44 + MAGENTA = 45 + CYAN = 46 + WHITE = 47 + RESET = 49 + + # These are fairly well supported, but not part of the standard. + LIGHTBLACK_EX = 100 + LIGHTRED_EX = 101 + LIGHTGREEN_EX = 102 + LIGHTYELLOW_EX = 103 + LIGHTBLUE_EX = 104 + LIGHTMAGENTA_EX = 105 + LIGHTCYAN_EX = 106 + LIGHTWHITE_EX = 107 + + +class AnsiStyle(AnsiCodes): + BRIGHT = 1 + DIM = 2 + NORMAL = 22 + RESET_ALL = 0 + +Fore = AnsiFore() +Back = AnsiBack() +Style = AnsiStyle() +Cursor = AnsiCursor() diff --git a/venv/Lib/site-packages/colorama/ansitowin32.py b/venv/Lib/site-packages/colorama/ansitowin32.py new file mode 100644 index 0000000000000000000000000000000000000000..abf209e60c7c4a9b1ae57452e36b383969848c2e --- /dev/null +++ b/venv/Lib/site-packages/colorama/ansitowin32.py @@ -0,0 +1,277 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. +import re +import sys +import os + +from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style, BEL +from .winterm import enable_vt_processing, WinTerm, WinColor, WinStyle +from .win32 import windll, winapi_test + + +winterm = None +if windll is not None: + winterm = WinTerm() + + +class StreamWrapper(object): + ''' + Wraps a stream (such as stdout), acting as a transparent proxy for all + attribute access apart from method 'write()', which is delegated to our + Converter instance. + ''' + def __init__(self, wrapped, converter): + # double-underscore everything to prevent clashes with names of + # attributes on the wrapped stream object. + self.__wrapped = wrapped + self.__convertor = converter + + def __getattr__(self, name): + return getattr(self.__wrapped, name) + + def __enter__(self, *args, **kwargs): + # special method lookup bypasses __getattr__/__getattribute__, see + # https://stackoverflow.com/questions/12632894/why-doesnt-getattr-work-with-exit + # thus, contextlib magic methods are not proxied via __getattr__ + return self.__wrapped.__enter__(*args, **kwargs) + + def __exit__(self, *args, **kwargs): + return self.__wrapped.__exit__(*args, **kwargs) + + def __setstate__(self, state): + self.__dict__ = state + + def __getstate__(self): + return self.__dict__ + + def write(self, text): + self.__convertor.write(text) + + def isatty(self): + stream = self.__wrapped + if 'PYCHARM_HOSTED' in os.environ: + if stream is not None and (stream is sys.__stdout__ or stream is sys.__stderr__): + return True + try: + stream_isatty = stream.isatty + except AttributeError: + return False + else: + return stream_isatty() + + @property + def closed(self): + stream = self.__wrapped + try: + return stream.closed + # AttributeError in the case that the stream doesn't support being closed + # ValueError for the case that the stream has already been detached when atexit runs + except (AttributeError, ValueError): + return True + + +class AnsiToWin32(object): + ''' + Implements a 'write()' method which, on Windows, will strip ANSI character + sequences from the text, and if outputting to a tty, will convert them into + win32 function calls. + ''' + ANSI_CSI_RE = re.compile('\001?\033\\[((?:\\d|;)*)([a-zA-Z])\002?') # Control Sequence Introducer + ANSI_OSC_RE = re.compile('\001?\033\\]([^\a]*)(\a)\002?') # Operating System Command + + def __init__(self, wrapped, convert=None, strip=None, autoreset=False): + # The wrapped stream (normally sys.stdout or sys.stderr) + self.wrapped = wrapped + + # should we reset colors to defaults after every .write() + self.autoreset = autoreset + + # create the proxy wrapping our output stream + self.stream = StreamWrapper(wrapped, self) + + on_windows = os.name == 'nt' + # We test if the WinAPI works, because even if we are on Windows + # we may be using a terminal that doesn't support the WinAPI + # (e.g. Cygwin Terminal). In this case it's up to the terminal + # to support the ANSI codes. + conversion_supported = on_windows and winapi_test() + try: + fd = wrapped.fileno() + except Exception: + fd = -1 + system_has_native_ansi = not on_windows or enable_vt_processing(fd) + have_tty = not self.stream.closed and self.stream.isatty() + need_conversion = conversion_supported and not system_has_native_ansi + + # should we strip ANSI sequences from our output? + if strip is None: + strip = need_conversion or not have_tty + self.strip = strip + + # should we should convert ANSI sequences into win32 calls? + if convert is None: + convert = need_conversion and have_tty + self.convert = convert + + # dict of ansi codes to win32 functions and parameters + self.win32_calls = self.get_win32_calls() + + # are we wrapping stderr? + self.on_stderr = self.wrapped is sys.stderr + + def should_wrap(self): + ''' + True if this class is actually needed. If false, then the output + stream will not be affected, nor will win32 calls be issued, so + wrapping stdout is not actually required. This will generally be + False on non-Windows platforms, unless optional functionality like + autoreset has been requested using kwargs to init() + ''' + return self.convert or self.strip or self.autoreset + + def get_win32_calls(self): + if self.convert and winterm: + return { + AnsiStyle.RESET_ALL: (winterm.reset_all, ), + AnsiStyle.BRIGHT: (winterm.style, WinStyle.BRIGHT), + AnsiStyle.DIM: (winterm.style, WinStyle.NORMAL), + AnsiStyle.NORMAL: (winterm.style, WinStyle.NORMAL), + AnsiFore.BLACK: (winterm.fore, WinColor.BLACK), + AnsiFore.RED: (winterm.fore, WinColor.RED), + AnsiFore.GREEN: (winterm.fore, WinColor.GREEN), + AnsiFore.YELLOW: (winterm.fore, WinColor.YELLOW), + AnsiFore.BLUE: (winterm.fore, WinColor.BLUE), + AnsiFore.MAGENTA: (winterm.fore, WinColor.MAGENTA), + AnsiFore.CYAN: (winterm.fore, WinColor.CYAN), + AnsiFore.WHITE: (winterm.fore, WinColor.GREY), + AnsiFore.RESET: (winterm.fore, ), + AnsiFore.LIGHTBLACK_EX: (winterm.fore, WinColor.BLACK, True), + AnsiFore.LIGHTRED_EX: (winterm.fore, WinColor.RED, True), + AnsiFore.LIGHTGREEN_EX: (winterm.fore, WinColor.GREEN, True), + AnsiFore.LIGHTYELLOW_EX: (winterm.fore, WinColor.YELLOW, True), + AnsiFore.LIGHTBLUE_EX: (winterm.fore, WinColor.BLUE, True), + AnsiFore.LIGHTMAGENTA_EX: (winterm.fore, WinColor.MAGENTA, True), + AnsiFore.LIGHTCYAN_EX: (winterm.fore, WinColor.CYAN, True), + AnsiFore.LIGHTWHITE_EX: (winterm.fore, WinColor.GREY, True), + AnsiBack.BLACK: (winterm.back, WinColor.BLACK), + AnsiBack.RED: (winterm.back, WinColor.RED), + AnsiBack.GREEN: (winterm.back, WinColor.GREEN), + AnsiBack.YELLOW: (winterm.back, WinColor.YELLOW), + AnsiBack.BLUE: (winterm.back, WinColor.BLUE), + AnsiBack.MAGENTA: (winterm.back, WinColor.MAGENTA), + AnsiBack.CYAN: (winterm.back, WinColor.CYAN), + AnsiBack.WHITE: (winterm.back, WinColor.GREY), + AnsiBack.RESET: (winterm.back, ), + AnsiBack.LIGHTBLACK_EX: (winterm.back, WinColor.BLACK, True), + AnsiBack.LIGHTRED_EX: (winterm.back, WinColor.RED, True), + AnsiBack.LIGHTGREEN_EX: (winterm.back, WinColor.GREEN, True), + AnsiBack.LIGHTYELLOW_EX: (winterm.back, WinColor.YELLOW, True), + AnsiBack.LIGHTBLUE_EX: (winterm.back, WinColor.BLUE, True), + AnsiBack.LIGHTMAGENTA_EX: (winterm.back, WinColor.MAGENTA, True), + AnsiBack.LIGHTCYAN_EX: (winterm.back, WinColor.CYAN, True), + AnsiBack.LIGHTWHITE_EX: (winterm.back, WinColor.GREY, True), + } + return dict() + + def write(self, text): + if self.strip or self.convert: + self.write_and_convert(text) + else: + self.wrapped.write(text) + self.wrapped.flush() + if self.autoreset: + self.reset_all() + + + def reset_all(self): + if self.convert: + self.call_win32('m', (0,)) + elif not self.strip and not self.stream.closed: + self.wrapped.write(Style.RESET_ALL) + + + def write_and_convert(self, text): + ''' + Write the given text to our wrapped stream, stripping any ANSI + sequences from the text, and optionally converting them into win32 + calls. + ''' + cursor = 0 + text = self.convert_osc(text) + for match in self.ANSI_CSI_RE.finditer(text): + start, end = match.span() + self.write_plain_text(text, cursor, start) + self.convert_ansi(*match.groups()) + cursor = end + self.write_plain_text(text, cursor, len(text)) + + + def write_plain_text(self, text, start, end): + if start < end: + self.wrapped.write(text[start:end]) + self.wrapped.flush() + + + def convert_ansi(self, paramstring, command): + if self.convert: + params = self.extract_params(command, paramstring) + self.call_win32(command, params) + + + def extract_params(self, command, paramstring): + if command in 'Hf': + params = tuple(int(p) if len(p) != 0 else 1 for p in paramstring.split(';')) + while len(params) < 2: + # defaults: + params = params + (1,) + else: + params = tuple(int(p) for p in paramstring.split(';') if len(p) != 0) + if len(params) == 0: + # defaults: + if command in 'JKm': + params = (0,) + elif command in 'ABCD': + params = (1,) + + return params + + + def call_win32(self, command, params): + if command == 'm': + for param in params: + if param in self.win32_calls: + func_args = self.win32_calls[param] + func = func_args[0] + args = func_args[1:] + kwargs = dict(on_stderr=self.on_stderr) + func(*args, **kwargs) + elif command in 'J': + winterm.erase_screen(params[0], on_stderr=self.on_stderr) + elif command in 'K': + winterm.erase_line(params[0], on_stderr=self.on_stderr) + elif command in 'Hf': # cursor position - absolute + winterm.set_cursor_position(params, on_stderr=self.on_stderr) + elif command in 'ABCD': # cursor position - relative + n = params[0] + # A - up, B - down, C - forward, D - back + x, y = {'A': (0, -n), 'B': (0, n), 'C': (n, 0), 'D': (-n, 0)}[command] + winterm.cursor_adjust(x, y, on_stderr=self.on_stderr) + + + def convert_osc(self, text): + for match in self.ANSI_OSC_RE.finditer(text): + start, end = match.span() + text = text[:start] + text[end:] + paramstring, command = match.groups() + if command == BEL: + if paramstring.count(";") == 1: + params = paramstring.split(";") + # 0 - change title and icon (we will only change title) + # 1 - change icon (we don't support this) + # 2 - change title + if params[0] in '02': + winterm.set_title(params[1]) + return text + + + def flush(self): + self.wrapped.flush() diff --git a/venv/Lib/site-packages/colorama/initialise.py b/venv/Lib/site-packages/colorama/initialise.py new file mode 100644 index 0000000000000000000000000000000000000000..d5fd4b71fed1bb4871717f978f0c470280f099c1 --- /dev/null +++ b/venv/Lib/site-packages/colorama/initialise.py @@ -0,0 +1,121 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. +import atexit +import contextlib +import sys + +from .ansitowin32 import AnsiToWin32 + + +def _wipe_internal_state_for_tests(): + global orig_stdout, orig_stderr + orig_stdout = None + orig_stderr = None + + global wrapped_stdout, wrapped_stderr + wrapped_stdout = None + wrapped_stderr = None + + global atexit_done + atexit_done = False + + global fixed_windows_console + fixed_windows_console = False + + try: + # no-op if it wasn't registered + atexit.unregister(reset_all) + except AttributeError: + # python 2: no atexit.unregister. Oh well, we did our best. + pass + + +def reset_all(): + if AnsiToWin32 is not None: # Issue #74: objects might become None at exit + AnsiToWin32(orig_stdout).reset_all() + + +def init(autoreset=False, convert=None, strip=None, wrap=True): + + if not wrap and any([autoreset, convert, strip]): + raise ValueError('wrap=False conflicts with any other arg=True') + + global wrapped_stdout, wrapped_stderr + global orig_stdout, orig_stderr + + orig_stdout = sys.stdout + orig_stderr = sys.stderr + + if sys.stdout is None: + wrapped_stdout = None + else: + sys.stdout = wrapped_stdout = \ + wrap_stream(orig_stdout, convert, strip, autoreset, wrap) + if sys.stderr is None: + wrapped_stderr = None + else: + sys.stderr = wrapped_stderr = \ + wrap_stream(orig_stderr, convert, strip, autoreset, wrap) + + global atexit_done + if not atexit_done: + atexit.register(reset_all) + atexit_done = True + + +def deinit(): + if orig_stdout is not None: + sys.stdout = orig_stdout + if orig_stderr is not None: + sys.stderr = orig_stderr + + +def just_fix_windows_console(): + global fixed_windows_console + + if sys.platform != "win32": + return + if fixed_windows_console: + return + if wrapped_stdout is not None or wrapped_stderr is not None: + # Someone already ran init() and it did stuff, so we won't second-guess them + return + + # On newer versions of Windows, AnsiToWin32.__init__ will implicitly enable the + # native ANSI support in the console as a side-effect. We only need to actually + # replace sys.stdout/stderr if we're in the old-style conversion mode. + new_stdout = AnsiToWin32(sys.stdout, convert=None, strip=None, autoreset=False) + if new_stdout.convert: + sys.stdout = new_stdout + new_stderr = AnsiToWin32(sys.stderr, convert=None, strip=None, autoreset=False) + if new_stderr.convert: + sys.stderr = new_stderr + + fixed_windows_console = True + +@contextlib.contextmanager +def colorama_text(*args, **kwargs): + init(*args, **kwargs) + try: + yield + finally: + deinit() + + +def reinit(): + if wrapped_stdout is not None: + sys.stdout = wrapped_stdout + if wrapped_stderr is not None: + sys.stderr = wrapped_stderr + + +def wrap_stream(stream, convert, strip, autoreset, wrap): + if wrap: + wrapper = AnsiToWin32(stream, + convert=convert, strip=strip, autoreset=autoreset) + if wrapper.should_wrap(): + stream = wrapper.stream + return stream + + +# Use this for initial setup as well, to reduce code duplication +_wipe_internal_state_for_tests() diff --git a/venv/Lib/site-packages/colorama/tests/__init__.py b/venv/Lib/site-packages/colorama/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8c5661e93a205bf4fb22404d4fc50f902cc31369 --- /dev/null +++ b/venv/Lib/site-packages/colorama/tests/__init__.py @@ -0,0 +1 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. diff --git a/venv/Lib/site-packages/colorama/tests/__pycache__/__init__.cpython-313.pyc b/venv/Lib/site-packages/colorama/tests/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..345cca6b519fb3c2d458417e0f23b47cb95c0f9d Binary files /dev/null and b/venv/Lib/site-packages/colorama/tests/__pycache__/__init__.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/colorama/tests/__pycache__/ansi_test.cpython-313.pyc b/venv/Lib/site-packages/colorama/tests/__pycache__/ansi_test.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4e6adf6b7cc53c8c00f04ca564bad979bdc198b1 Binary files /dev/null and b/venv/Lib/site-packages/colorama/tests/__pycache__/ansi_test.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/colorama/tests/__pycache__/ansitowin32_test.cpython-313.pyc b/venv/Lib/site-packages/colorama/tests/__pycache__/ansitowin32_test.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cf59b643bed0cf7e79570c06bbe7cf476a0f4d39 Binary files /dev/null and b/venv/Lib/site-packages/colorama/tests/__pycache__/ansitowin32_test.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/colorama/tests/__pycache__/initialise_test.cpython-313.pyc b/venv/Lib/site-packages/colorama/tests/__pycache__/initialise_test.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dec6a52cdcdcfb1791344bc0a10ab256744e8547 Binary files /dev/null and b/venv/Lib/site-packages/colorama/tests/__pycache__/initialise_test.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/colorama/tests/__pycache__/isatty_test.cpython-313.pyc b/venv/Lib/site-packages/colorama/tests/__pycache__/isatty_test.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1ce51d7429b9430ea25dd0f61e0be8ef48d3de12 Binary files /dev/null and b/venv/Lib/site-packages/colorama/tests/__pycache__/isatty_test.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/colorama/tests/__pycache__/utils.cpython-313.pyc b/venv/Lib/site-packages/colorama/tests/__pycache__/utils.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7d9561414b3311b4447d7cbb2a6b47abf02a9a64 Binary files /dev/null and b/venv/Lib/site-packages/colorama/tests/__pycache__/utils.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/colorama/tests/__pycache__/winterm_test.cpython-313.pyc b/venv/Lib/site-packages/colorama/tests/__pycache__/winterm_test.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..235dc370f76664b7cdc789f85f4415af8b753017 Binary files /dev/null and b/venv/Lib/site-packages/colorama/tests/__pycache__/winterm_test.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/colorama/tests/ansi_test.py b/venv/Lib/site-packages/colorama/tests/ansi_test.py new file mode 100644 index 0000000000000000000000000000000000000000..0a20c80f882066e0e1323b0c7f61e22913c32e35 --- /dev/null +++ b/venv/Lib/site-packages/colorama/tests/ansi_test.py @@ -0,0 +1,76 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. +import sys +from unittest import TestCase, main + +from ..ansi import Back, Fore, Style +from ..ansitowin32 import AnsiToWin32 + +stdout_orig = sys.stdout +stderr_orig = sys.stderr + + +class AnsiTest(TestCase): + + def setUp(self): + # sanity check: stdout should be a file or StringIO object. + # It will only be AnsiToWin32 if init() has previously wrapped it + self.assertNotEqual(type(sys.stdout), AnsiToWin32) + self.assertNotEqual(type(sys.stderr), AnsiToWin32) + + def tearDown(self): + sys.stdout = stdout_orig + sys.stderr = stderr_orig + + + def testForeAttributes(self): + self.assertEqual(Fore.BLACK, '\033[30m') + self.assertEqual(Fore.RED, '\033[31m') + self.assertEqual(Fore.GREEN, '\033[32m') + self.assertEqual(Fore.YELLOW, '\033[33m') + self.assertEqual(Fore.BLUE, '\033[34m') + self.assertEqual(Fore.MAGENTA, '\033[35m') + self.assertEqual(Fore.CYAN, '\033[36m') + self.assertEqual(Fore.WHITE, '\033[37m') + self.assertEqual(Fore.RESET, '\033[39m') + + # Check the light, extended versions. + self.assertEqual(Fore.LIGHTBLACK_EX, '\033[90m') + self.assertEqual(Fore.LIGHTRED_EX, '\033[91m') + self.assertEqual(Fore.LIGHTGREEN_EX, '\033[92m') + self.assertEqual(Fore.LIGHTYELLOW_EX, '\033[93m') + self.assertEqual(Fore.LIGHTBLUE_EX, '\033[94m') + self.assertEqual(Fore.LIGHTMAGENTA_EX, '\033[95m') + self.assertEqual(Fore.LIGHTCYAN_EX, '\033[96m') + self.assertEqual(Fore.LIGHTWHITE_EX, '\033[97m') + + + def testBackAttributes(self): + self.assertEqual(Back.BLACK, '\033[40m') + self.assertEqual(Back.RED, '\033[41m') + self.assertEqual(Back.GREEN, '\033[42m') + self.assertEqual(Back.YELLOW, '\033[43m') + self.assertEqual(Back.BLUE, '\033[44m') + self.assertEqual(Back.MAGENTA, '\033[45m') + self.assertEqual(Back.CYAN, '\033[46m') + self.assertEqual(Back.WHITE, '\033[47m') + self.assertEqual(Back.RESET, '\033[49m') + + # Check the light, extended versions. + self.assertEqual(Back.LIGHTBLACK_EX, '\033[100m') + self.assertEqual(Back.LIGHTRED_EX, '\033[101m') + self.assertEqual(Back.LIGHTGREEN_EX, '\033[102m') + self.assertEqual(Back.LIGHTYELLOW_EX, '\033[103m') + self.assertEqual(Back.LIGHTBLUE_EX, '\033[104m') + self.assertEqual(Back.LIGHTMAGENTA_EX, '\033[105m') + self.assertEqual(Back.LIGHTCYAN_EX, '\033[106m') + self.assertEqual(Back.LIGHTWHITE_EX, '\033[107m') + + + def testStyleAttributes(self): + self.assertEqual(Style.DIM, '\033[2m') + self.assertEqual(Style.NORMAL, '\033[22m') + self.assertEqual(Style.BRIGHT, '\033[1m') + + +if __name__ == '__main__': + main() diff --git a/venv/Lib/site-packages/colorama/tests/ansitowin32_test.py b/venv/Lib/site-packages/colorama/tests/ansitowin32_test.py new file mode 100644 index 0000000000000000000000000000000000000000..91ca551f97b4576c680711e826a1855fb944c872 --- /dev/null +++ b/venv/Lib/site-packages/colorama/tests/ansitowin32_test.py @@ -0,0 +1,294 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. +from io import StringIO, TextIOWrapper +from unittest import TestCase, main +try: + from contextlib import ExitStack +except ImportError: + # python 2 + from contextlib2 import ExitStack + +try: + from unittest.mock import MagicMock, Mock, patch +except ImportError: + from mock import MagicMock, Mock, patch + +from ..ansitowin32 import AnsiToWin32, StreamWrapper +from ..win32 import ENABLE_VIRTUAL_TERMINAL_PROCESSING +from .utils import osname + + +class StreamWrapperTest(TestCase): + + def testIsAProxy(self): + mockStream = Mock() + wrapper = StreamWrapper(mockStream, None) + self.assertTrue( wrapper.random_attr is mockStream.random_attr ) + + def testDelegatesWrite(self): + mockStream = Mock() + mockConverter = Mock() + wrapper = StreamWrapper(mockStream, mockConverter) + wrapper.write('hello') + self.assertTrue(mockConverter.write.call_args, (('hello',), {})) + + def testDelegatesContext(self): + mockConverter = Mock() + s = StringIO() + with StreamWrapper(s, mockConverter) as fp: + fp.write(u'hello') + self.assertTrue(s.closed) + + def testProxyNoContextManager(self): + mockStream = MagicMock() + mockStream.__enter__.side_effect = AttributeError() + mockConverter = Mock() + with self.assertRaises(AttributeError) as excinfo: + with StreamWrapper(mockStream, mockConverter) as wrapper: + wrapper.write('hello') + + def test_closed_shouldnt_raise_on_closed_stream(self): + stream = StringIO() + stream.close() + wrapper = StreamWrapper(stream, None) + self.assertEqual(wrapper.closed, True) + + def test_closed_shouldnt_raise_on_detached_stream(self): + stream = TextIOWrapper(StringIO()) + stream.detach() + wrapper = StreamWrapper(stream, None) + self.assertEqual(wrapper.closed, True) + +class AnsiToWin32Test(TestCase): + + def testInit(self): + mockStdout = Mock() + auto = Mock() + stream = AnsiToWin32(mockStdout, autoreset=auto) + self.assertEqual(stream.wrapped, mockStdout) + self.assertEqual(stream.autoreset, auto) + + @patch('colorama.ansitowin32.winterm', None) + @patch('colorama.ansitowin32.winapi_test', lambda *_: True) + def testStripIsTrueOnWindows(self): + with osname('nt'): + mockStdout = Mock() + stream = AnsiToWin32(mockStdout) + self.assertTrue(stream.strip) + + def testStripIsFalseOffWindows(self): + with osname('posix'): + mockStdout = Mock(closed=False) + stream = AnsiToWin32(mockStdout) + self.assertFalse(stream.strip) + + def testWriteStripsAnsi(self): + mockStdout = Mock() + stream = AnsiToWin32(mockStdout) + stream.wrapped = Mock() + stream.write_and_convert = Mock() + stream.strip = True + + stream.write('abc') + + self.assertFalse(stream.wrapped.write.called) + self.assertEqual(stream.write_and_convert.call_args, (('abc',), {})) + + def testWriteDoesNotStripAnsi(self): + mockStdout = Mock() + stream = AnsiToWin32(mockStdout) + stream.wrapped = Mock() + stream.write_and_convert = Mock() + stream.strip = False + stream.convert = False + + stream.write('abc') + + self.assertFalse(stream.write_and_convert.called) + self.assertEqual(stream.wrapped.write.call_args, (('abc',), {})) + + def assert_autoresets(self, convert, autoreset=True): + stream = AnsiToWin32(Mock()) + stream.convert = convert + stream.reset_all = Mock() + stream.autoreset = autoreset + stream.winterm = Mock() + + stream.write('abc') + + self.assertEqual(stream.reset_all.called, autoreset) + + def testWriteAutoresets(self): + self.assert_autoresets(convert=True) + self.assert_autoresets(convert=False) + self.assert_autoresets(convert=True, autoreset=False) + self.assert_autoresets(convert=False, autoreset=False) + + def testWriteAndConvertWritesPlainText(self): + stream = AnsiToWin32(Mock()) + stream.write_and_convert( 'abc' ) + self.assertEqual( stream.wrapped.write.call_args, (('abc',), {}) ) + + def testWriteAndConvertStripsAllValidAnsi(self): + stream = AnsiToWin32(Mock()) + stream.call_win32 = Mock() + data = [ + 'abc\033[mdef', + 'abc\033[0mdef', + 'abc\033[2mdef', + 'abc\033[02mdef', + 'abc\033[002mdef', + 'abc\033[40mdef', + 'abc\033[040mdef', + 'abc\033[0;1mdef', + 'abc\033[40;50mdef', + 'abc\033[50;30;40mdef', + 'abc\033[Adef', + 'abc\033[0Gdef', + 'abc\033[1;20;128Hdef', + ] + for datum in data: + stream.wrapped.write.reset_mock() + stream.write_and_convert( datum ) + self.assertEqual( + [args[0] for args in stream.wrapped.write.call_args_list], + [ ('abc',), ('def',) ] + ) + + def testWriteAndConvertSkipsEmptySnippets(self): + stream = AnsiToWin32(Mock()) + stream.call_win32 = Mock() + stream.write_and_convert( '\033[40m\033[41m' ) + self.assertFalse( stream.wrapped.write.called ) + + def testWriteAndConvertCallsWin32WithParamsAndCommand(self): + stream = AnsiToWin32(Mock()) + stream.convert = True + stream.call_win32 = Mock() + stream.extract_params = Mock(return_value='params') + data = { + 'abc\033[adef': ('a', 'params'), + 'abc\033[;;bdef': ('b', 'params'), + 'abc\033[0cdef': ('c', 'params'), + 'abc\033[;;0;;Gdef': ('G', 'params'), + 'abc\033[1;20;128Hdef': ('H', 'params'), + } + for datum, expected in data.items(): + stream.call_win32.reset_mock() + stream.write_and_convert( datum ) + self.assertEqual( stream.call_win32.call_args[0], expected ) + + def test_reset_all_shouldnt_raise_on_closed_orig_stdout(self): + stream = StringIO() + converter = AnsiToWin32(stream) + stream.close() + + converter.reset_all() + + def test_wrap_shouldnt_raise_on_closed_orig_stdout(self): + stream = StringIO() + stream.close() + with \ + patch("colorama.ansitowin32.os.name", "nt"), \ + patch("colorama.ansitowin32.winapi_test", lambda: True): + converter = AnsiToWin32(stream) + self.assertTrue(converter.strip) + self.assertFalse(converter.convert) + + def test_wrap_shouldnt_raise_on_missing_closed_attr(self): + with \ + patch("colorama.ansitowin32.os.name", "nt"), \ + patch("colorama.ansitowin32.winapi_test", lambda: True): + converter = AnsiToWin32(object()) + self.assertTrue(converter.strip) + self.assertFalse(converter.convert) + + def testExtractParams(self): + stream = AnsiToWin32(Mock()) + data = { + '': (0,), + ';;': (0,), + '2': (2,), + ';;002;;': (2,), + '0;1': (0, 1), + ';;003;;456;;': (3, 456), + '11;22;33;44;55': (11, 22, 33, 44, 55), + } + for datum, expected in data.items(): + self.assertEqual(stream.extract_params('m', datum), expected) + + def testCallWin32UsesLookup(self): + listener = Mock() + stream = AnsiToWin32(listener) + stream.win32_calls = { + 1: (lambda *_, **__: listener(11),), + 2: (lambda *_, **__: listener(22),), + 3: (lambda *_, **__: listener(33),), + } + stream.call_win32('m', (3, 1, 99, 2)) + self.assertEqual( + [a[0][0] for a in listener.call_args_list], + [33, 11, 22] ) + + def test_osc_codes(self): + mockStdout = Mock() + stream = AnsiToWin32(mockStdout, convert=True) + with patch('colorama.ansitowin32.winterm') as winterm: + data = [ + '\033]0\x07', # missing arguments + '\033]0;foo\x08', # wrong OSC command + '\033]0;colorama_test_title\x07', # should work + '\033]1;colorama_test_title\x07', # wrong set command + '\033]2;colorama_test_title\x07', # should work + '\033]' + ';' * 64 + '\x08', # see issue #247 + ] + for code in data: + stream.write(code) + self.assertEqual(winterm.set_title.call_count, 2) + + def test_native_windows_ansi(self): + with ExitStack() as stack: + def p(a, b): + stack.enter_context(patch(a, b, create=True)) + # Pretend to be on Windows + p("colorama.ansitowin32.os.name", "nt") + p("colorama.ansitowin32.winapi_test", lambda: True) + p("colorama.win32.winapi_test", lambda: True) + p("colorama.winterm.win32.windll", "non-None") + p("colorama.winterm.get_osfhandle", lambda _: 1234) + + # Pretend that our mock stream has native ANSI support + p( + "colorama.winterm.win32.GetConsoleMode", + lambda _: ENABLE_VIRTUAL_TERMINAL_PROCESSING, + ) + SetConsoleMode = Mock() + p("colorama.winterm.win32.SetConsoleMode", SetConsoleMode) + + stdout = Mock() + stdout.closed = False + stdout.isatty.return_value = True + stdout.fileno.return_value = 1 + + # Our fake console says it has native vt support, so AnsiToWin32 should + # enable that support and do nothing else. + stream = AnsiToWin32(stdout) + SetConsoleMode.assert_called_with(1234, ENABLE_VIRTUAL_TERMINAL_PROCESSING) + self.assertFalse(stream.strip) + self.assertFalse(stream.convert) + self.assertFalse(stream.should_wrap()) + + # Now let's pretend we're on an old Windows console, that doesn't have + # native ANSI support. + p("colorama.winterm.win32.GetConsoleMode", lambda _: 0) + SetConsoleMode = Mock() + p("colorama.winterm.win32.SetConsoleMode", SetConsoleMode) + + stream = AnsiToWin32(stdout) + SetConsoleMode.assert_called_with(1234, ENABLE_VIRTUAL_TERMINAL_PROCESSING) + self.assertTrue(stream.strip) + self.assertTrue(stream.convert) + self.assertTrue(stream.should_wrap()) + + +if __name__ == '__main__': + main() diff --git a/venv/Lib/site-packages/colorama/tests/initialise_test.py b/venv/Lib/site-packages/colorama/tests/initialise_test.py new file mode 100644 index 0000000000000000000000000000000000000000..89f9b07511c8fee74686d9cc434bf66345a46d6d --- /dev/null +++ b/venv/Lib/site-packages/colorama/tests/initialise_test.py @@ -0,0 +1,189 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. +import sys +from unittest import TestCase, main, skipUnless + +try: + from unittest.mock import patch, Mock +except ImportError: + from mock import patch, Mock + +from ..ansitowin32 import StreamWrapper +from ..initialise import init, just_fix_windows_console, _wipe_internal_state_for_tests +from .utils import osname, replace_by + +orig_stdout = sys.stdout +orig_stderr = sys.stderr + + +class InitTest(TestCase): + + @skipUnless(sys.stdout.isatty(), "sys.stdout is not a tty") + def setUp(self): + # sanity check + self.assertNotWrapped() + + def tearDown(self): + _wipe_internal_state_for_tests() + sys.stdout = orig_stdout + sys.stderr = orig_stderr + + def assertWrapped(self): + self.assertIsNot(sys.stdout, orig_stdout, 'stdout should be wrapped') + self.assertIsNot(sys.stderr, orig_stderr, 'stderr should be wrapped') + self.assertTrue(isinstance(sys.stdout, StreamWrapper), + 'bad stdout wrapper') + self.assertTrue(isinstance(sys.stderr, StreamWrapper), + 'bad stderr wrapper') + + def assertNotWrapped(self): + self.assertIs(sys.stdout, orig_stdout, 'stdout should not be wrapped') + self.assertIs(sys.stderr, orig_stderr, 'stderr should not be wrapped') + + @patch('colorama.initialise.reset_all') + @patch('colorama.ansitowin32.winapi_test', lambda *_: True) + @patch('colorama.ansitowin32.enable_vt_processing', lambda *_: False) + def testInitWrapsOnWindows(self, _): + with osname("nt"): + init() + self.assertWrapped() + + @patch('colorama.initialise.reset_all') + @patch('colorama.ansitowin32.winapi_test', lambda *_: False) + def testInitDoesntWrapOnEmulatedWindows(self, _): + with osname("nt"): + init() + self.assertNotWrapped() + + def testInitDoesntWrapOnNonWindows(self): + with osname("posix"): + init() + self.assertNotWrapped() + + def testInitDoesntWrapIfNone(self): + with replace_by(None): + init() + # We can't use assertNotWrapped here because replace_by(None) + # changes stdout/stderr already. + self.assertIsNone(sys.stdout) + self.assertIsNone(sys.stderr) + + def testInitAutoresetOnWrapsOnAllPlatforms(self): + with osname("posix"): + init(autoreset=True) + self.assertWrapped() + + def testInitWrapOffDoesntWrapOnWindows(self): + with osname("nt"): + init(wrap=False) + self.assertNotWrapped() + + def testInitWrapOffIncompatibleWithAutoresetOn(self): + self.assertRaises(ValueError, lambda: init(autoreset=True, wrap=False)) + + @patch('colorama.win32.SetConsoleTextAttribute') + @patch('colorama.initialise.AnsiToWin32') + def testAutoResetPassedOn(self, mockATW32, _): + with osname("nt"): + init(autoreset=True) + self.assertEqual(len(mockATW32.call_args_list), 2) + self.assertEqual(mockATW32.call_args_list[1][1]['autoreset'], True) + self.assertEqual(mockATW32.call_args_list[0][1]['autoreset'], True) + + @patch('colorama.initialise.AnsiToWin32') + def testAutoResetChangeable(self, mockATW32): + with osname("nt"): + init() + + init(autoreset=True) + self.assertEqual(len(mockATW32.call_args_list), 4) + self.assertEqual(mockATW32.call_args_list[2][1]['autoreset'], True) + self.assertEqual(mockATW32.call_args_list[3][1]['autoreset'], True) + + init() + self.assertEqual(len(mockATW32.call_args_list), 6) + self.assertEqual( + mockATW32.call_args_list[4][1]['autoreset'], False) + self.assertEqual( + mockATW32.call_args_list[5][1]['autoreset'], False) + + + @patch('colorama.initialise.atexit.register') + def testAtexitRegisteredOnlyOnce(self, mockRegister): + init() + self.assertTrue(mockRegister.called) + mockRegister.reset_mock() + init() + self.assertFalse(mockRegister.called) + + +class JustFixWindowsConsoleTest(TestCase): + def _reset(self): + _wipe_internal_state_for_tests() + sys.stdout = orig_stdout + sys.stderr = orig_stderr + + def tearDown(self): + self._reset() + + @patch("colorama.ansitowin32.winapi_test", lambda: True) + def testJustFixWindowsConsole(self): + if sys.platform != "win32": + # just_fix_windows_console should be a no-op + just_fix_windows_console() + self.assertIs(sys.stdout, orig_stdout) + self.assertIs(sys.stderr, orig_stderr) + else: + def fake_std(): + # Emulate stdout=not a tty, stderr=tty + # to check that we handle both cases correctly + stdout = Mock() + stdout.closed = False + stdout.isatty.return_value = False + stdout.fileno.return_value = 1 + sys.stdout = stdout + + stderr = Mock() + stderr.closed = False + stderr.isatty.return_value = True + stderr.fileno.return_value = 2 + sys.stderr = stderr + + for native_ansi in [False, True]: + with patch( + 'colorama.ansitowin32.enable_vt_processing', + lambda *_: native_ansi + ): + self._reset() + fake_std() + + # Regular single-call test + prev_stdout = sys.stdout + prev_stderr = sys.stderr + just_fix_windows_console() + self.assertIs(sys.stdout, prev_stdout) + if native_ansi: + self.assertIs(sys.stderr, prev_stderr) + else: + self.assertIsNot(sys.stderr, prev_stderr) + + # second call without resetting is always a no-op + prev_stdout = sys.stdout + prev_stderr = sys.stderr + just_fix_windows_console() + self.assertIs(sys.stdout, prev_stdout) + self.assertIs(sys.stderr, prev_stderr) + + self._reset() + fake_std() + + # If init() runs first, just_fix_windows_console should be a no-op + init() + prev_stdout = sys.stdout + prev_stderr = sys.stderr + just_fix_windows_console() + self.assertIs(prev_stdout, sys.stdout) + self.assertIs(prev_stderr, sys.stderr) + + +if __name__ == '__main__': + main() diff --git a/venv/Lib/site-packages/colorama/tests/isatty_test.py b/venv/Lib/site-packages/colorama/tests/isatty_test.py new file mode 100644 index 0000000000000000000000000000000000000000..0f84e4befe550d4386d24264648abf1323e682ff --- /dev/null +++ b/venv/Lib/site-packages/colorama/tests/isatty_test.py @@ -0,0 +1,57 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. +import sys +from unittest import TestCase, main + +from ..ansitowin32 import StreamWrapper, AnsiToWin32 +from .utils import pycharm, replace_by, replace_original_by, StreamTTY, StreamNonTTY + + +def is_a_tty(stream): + return StreamWrapper(stream, None).isatty() + +class IsattyTest(TestCase): + + def test_TTY(self): + tty = StreamTTY() + self.assertTrue(is_a_tty(tty)) + with pycharm(): + self.assertTrue(is_a_tty(tty)) + + def test_nonTTY(self): + non_tty = StreamNonTTY() + self.assertFalse(is_a_tty(non_tty)) + with pycharm(): + self.assertFalse(is_a_tty(non_tty)) + + def test_withPycharm(self): + with pycharm(): + self.assertTrue(is_a_tty(sys.stderr)) + self.assertTrue(is_a_tty(sys.stdout)) + + def test_withPycharmTTYOverride(self): + tty = StreamTTY() + with pycharm(), replace_by(tty): + self.assertTrue(is_a_tty(tty)) + + def test_withPycharmNonTTYOverride(self): + non_tty = StreamNonTTY() + with pycharm(), replace_by(non_tty): + self.assertFalse(is_a_tty(non_tty)) + + def test_withPycharmNoneOverride(self): + with pycharm(): + with replace_by(None), replace_original_by(None): + self.assertFalse(is_a_tty(None)) + self.assertFalse(is_a_tty(StreamNonTTY())) + self.assertTrue(is_a_tty(StreamTTY())) + + def test_withPycharmStreamWrapped(self): + with pycharm(): + self.assertTrue(AnsiToWin32(StreamTTY()).stream.isatty()) + self.assertFalse(AnsiToWin32(StreamNonTTY()).stream.isatty()) + self.assertTrue(AnsiToWin32(sys.stdout).stream.isatty()) + self.assertTrue(AnsiToWin32(sys.stderr).stream.isatty()) + + +if __name__ == '__main__': + main() diff --git a/venv/Lib/site-packages/colorama/tests/utils.py b/venv/Lib/site-packages/colorama/tests/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..472fafb4403efb9673d5cc724dafd9cf764aac5b --- /dev/null +++ b/venv/Lib/site-packages/colorama/tests/utils.py @@ -0,0 +1,49 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. +from contextlib import contextmanager +from io import StringIO +import sys +import os + + +class StreamTTY(StringIO): + def isatty(self): + return True + +class StreamNonTTY(StringIO): + def isatty(self): + return False + +@contextmanager +def osname(name): + orig = os.name + os.name = name + yield + os.name = orig + +@contextmanager +def replace_by(stream): + orig_stdout = sys.stdout + orig_stderr = sys.stderr + sys.stdout = stream + sys.stderr = stream + yield + sys.stdout = orig_stdout + sys.stderr = orig_stderr + +@contextmanager +def replace_original_by(stream): + orig_stdout = sys.__stdout__ + orig_stderr = sys.__stderr__ + sys.__stdout__ = stream + sys.__stderr__ = stream + yield + sys.__stdout__ = orig_stdout + sys.__stderr__ = orig_stderr + +@contextmanager +def pycharm(): + os.environ["PYCHARM_HOSTED"] = "1" + non_tty = StreamNonTTY() + with replace_by(non_tty), replace_original_by(non_tty): + yield + del os.environ["PYCHARM_HOSTED"] diff --git a/venv/Lib/site-packages/colorama/tests/winterm_test.py b/venv/Lib/site-packages/colorama/tests/winterm_test.py new file mode 100644 index 0000000000000000000000000000000000000000..d0955f9e608377940f0d548576964f2fcf3caf48 --- /dev/null +++ b/venv/Lib/site-packages/colorama/tests/winterm_test.py @@ -0,0 +1,131 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. +import sys +from unittest import TestCase, main, skipUnless + +try: + from unittest.mock import Mock, patch +except ImportError: + from mock import Mock, patch + +from ..winterm import WinColor, WinStyle, WinTerm + + +class WinTermTest(TestCase): + + @patch('colorama.winterm.win32') + def testInit(self, mockWin32): + mockAttr = Mock() + mockAttr.wAttributes = 7 + 6 * 16 + 8 + mockWin32.GetConsoleScreenBufferInfo.return_value = mockAttr + term = WinTerm() + self.assertEqual(term._fore, 7) + self.assertEqual(term._back, 6) + self.assertEqual(term._style, 8) + + @skipUnless(sys.platform.startswith("win"), "requires Windows") + def testGetAttrs(self): + term = WinTerm() + + term._fore = 0 + term._back = 0 + term._style = 0 + self.assertEqual(term.get_attrs(), 0) + + term._fore = WinColor.YELLOW + self.assertEqual(term.get_attrs(), WinColor.YELLOW) + + term._back = WinColor.MAGENTA + self.assertEqual( + term.get_attrs(), + WinColor.YELLOW + WinColor.MAGENTA * 16) + + term._style = WinStyle.BRIGHT + self.assertEqual( + term.get_attrs(), + WinColor.YELLOW + WinColor.MAGENTA * 16 + WinStyle.BRIGHT) + + @patch('colorama.winterm.win32') + def testResetAll(self, mockWin32): + mockAttr = Mock() + mockAttr.wAttributes = 1 + 2 * 16 + 8 + mockWin32.GetConsoleScreenBufferInfo.return_value = mockAttr + term = WinTerm() + + term.set_console = Mock() + term._fore = -1 + term._back = -1 + term._style = -1 + + term.reset_all() + + self.assertEqual(term._fore, 1) + self.assertEqual(term._back, 2) + self.assertEqual(term._style, 8) + self.assertEqual(term.set_console.called, True) + + @skipUnless(sys.platform.startswith("win"), "requires Windows") + def testFore(self): + term = WinTerm() + term.set_console = Mock() + term._fore = 0 + + term.fore(5) + + self.assertEqual(term._fore, 5) + self.assertEqual(term.set_console.called, True) + + @skipUnless(sys.platform.startswith("win"), "requires Windows") + def testBack(self): + term = WinTerm() + term.set_console = Mock() + term._back = 0 + + term.back(5) + + self.assertEqual(term._back, 5) + self.assertEqual(term.set_console.called, True) + + @skipUnless(sys.platform.startswith("win"), "requires Windows") + def testStyle(self): + term = WinTerm() + term.set_console = Mock() + term._style = 0 + + term.style(22) + + self.assertEqual(term._style, 22) + self.assertEqual(term.set_console.called, True) + + @patch('colorama.winterm.win32') + def testSetConsole(self, mockWin32): + mockAttr = Mock() + mockAttr.wAttributes = 0 + mockWin32.GetConsoleScreenBufferInfo.return_value = mockAttr + term = WinTerm() + term.windll = Mock() + + term.set_console() + + self.assertEqual( + mockWin32.SetConsoleTextAttribute.call_args, + ((mockWin32.STDOUT, term.get_attrs()), {}) + ) + + @patch('colorama.winterm.win32') + def testSetConsoleOnStderr(self, mockWin32): + mockAttr = Mock() + mockAttr.wAttributes = 0 + mockWin32.GetConsoleScreenBufferInfo.return_value = mockAttr + term = WinTerm() + term.windll = Mock() + + term.set_console(on_stderr=True) + + self.assertEqual( + mockWin32.SetConsoleTextAttribute.call_args, + ((mockWin32.STDERR, term.get_attrs()), {}) + ) + + +if __name__ == '__main__': + main() diff --git a/venv/Lib/site-packages/colorama/win32.py b/venv/Lib/site-packages/colorama/win32.py new file mode 100644 index 0000000000000000000000000000000000000000..841b0e270a381cdfaca544a9be976d7276d83b1e --- /dev/null +++ b/venv/Lib/site-packages/colorama/win32.py @@ -0,0 +1,180 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. + +# from winbase.h +STDOUT = -11 +STDERR = -12 + +ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x0004 + +try: + import ctypes + from ctypes import LibraryLoader + windll = LibraryLoader(ctypes.WinDLL) + from ctypes import wintypes +except (AttributeError, ImportError): + windll = None + SetConsoleTextAttribute = lambda *_: None + winapi_test = lambda *_: None +else: + from ctypes import byref, Structure, c_char, POINTER + + COORD = wintypes._COORD + + class CONSOLE_SCREEN_BUFFER_INFO(Structure): + """struct in wincon.h.""" + _fields_ = [ + ("dwSize", COORD), + ("dwCursorPosition", COORD), + ("wAttributes", wintypes.WORD), + ("srWindow", wintypes.SMALL_RECT), + ("dwMaximumWindowSize", COORD), + ] + def __str__(self): + return '(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)' % ( + self.dwSize.Y, self.dwSize.X + , self.dwCursorPosition.Y, self.dwCursorPosition.X + , self.wAttributes + , self.srWindow.Top, self.srWindow.Left, self.srWindow.Bottom, self.srWindow.Right + , self.dwMaximumWindowSize.Y, self.dwMaximumWindowSize.X + ) + + _GetStdHandle = windll.kernel32.GetStdHandle + _GetStdHandle.argtypes = [ + wintypes.DWORD, + ] + _GetStdHandle.restype = wintypes.HANDLE + + _GetConsoleScreenBufferInfo = windll.kernel32.GetConsoleScreenBufferInfo + _GetConsoleScreenBufferInfo.argtypes = [ + wintypes.HANDLE, + POINTER(CONSOLE_SCREEN_BUFFER_INFO), + ] + _GetConsoleScreenBufferInfo.restype = wintypes.BOOL + + _SetConsoleTextAttribute = windll.kernel32.SetConsoleTextAttribute + _SetConsoleTextAttribute.argtypes = [ + wintypes.HANDLE, + wintypes.WORD, + ] + _SetConsoleTextAttribute.restype = wintypes.BOOL + + _SetConsoleCursorPosition = windll.kernel32.SetConsoleCursorPosition + _SetConsoleCursorPosition.argtypes = [ + wintypes.HANDLE, + COORD, + ] + _SetConsoleCursorPosition.restype = wintypes.BOOL + + _FillConsoleOutputCharacterA = windll.kernel32.FillConsoleOutputCharacterA + _FillConsoleOutputCharacterA.argtypes = [ + wintypes.HANDLE, + c_char, + wintypes.DWORD, + COORD, + POINTER(wintypes.DWORD), + ] + _FillConsoleOutputCharacterA.restype = wintypes.BOOL + + _FillConsoleOutputAttribute = windll.kernel32.FillConsoleOutputAttribute + _FillConsoleOutputAttribute.argtypes = [ + wintypes.HANDLE, + wintypes.WORD, + wintypes.DWORD, + COORD, + POINTER(wintypes.DWORD), + ] + _FillConsoleOutputAttribute.restype = wintypes.BOOL + + _SetConsoleTitleW = windll.kernel32.SetConsoleTitleW + _SetConsoleTitleW.argtypes = [ + wintypes.LPCWSTR + ] + _SetConsoleTitleW.restype = wintypes.BOOL + + _GetConsoleMode = windll.kernel32.GetConsoleMode + _GetConsoleMode.argtypes = [ + wintypes.HANDLE, + POINTER(wintypes.DWORD) + ] + _GetConsoleMode.restype = wintypes.BOOL + + _SetConsoleMode = windll.kernel32.SetConsoleMode + _SetConsoleMode.argtypes = [ + wintypes.HANDLE, + wintypes.DWORD + ] + _SetConsoleMode.restype = wintypes.BOOL + + def _winapi_test(handle): + csbi = CONSOLE_SCREEN_BUFFER_INFO() + success = _GetConsoleScreenBufferInfo( + handle, byref(csbi)) + return bool(success) + + def winapi_test(): + return any(_winapi_test(h) for h in + (_GetStdHandle(STDOUT), _GetStdHandle(STDERR))) + + def GetConsoleScreenBufferInfo(stream_id=STDOUT): + handle = _GetStdHandle(stream_id) + csbi = CONSOLE_SCREEN_BUFFER_INFO() + success = _GetConsoleScreenBufferInfo( + handle, byref(csbi)) + return csbi + + def SetConsoleTextAttribute(stream_id, attrs): + handle = _GetStdHandle(stream_id) + return _SetConsoleTextAttribute(handle, attrs) + + def SetConsoleCursorPosition(stream_id, position, adjust=True): + position = COORD(*position) + # If the position is out of range, do nothing. + if position.Y <= 0 or position.X <= 0: + return + # Adjust for Windows' SetConsoleCursorPosition: + # 1. being 0-based, while ANSI is 1-based. + # 2. expecting (x,y), while ANSI uses (y,x). + adjusted_position = COORD(position.Y - 1, position.X - 1) + if adjust: + # Adjust for viewport's scroll position + sr = GetConsoleScreenBufferInfo(STDOUT).srWindow + adjusted_position.Y += sr.Top + adjusted_position.X += sr.Left + # Resume normal processing + handle = _GetStdHandle(stream_id) + return _SetConsoleCursorPosition(handle, adjusted_position) + + def FillConsoleOutputCharacter(stream_id, char, length, start): + handle = _GetStdHandle(stream_id) + char = c_char(char.encode()) + length = wintypes.DWORD(length) + num_written = wintypes.DWORD(0) + # Note that this is hard-coded for ANSI (vs wide) bytes. + success = _FillConsoleOutputCharacterA( + handle, char, length, start, byref(num_written)) + return num_written.value + + def FillConsoleOutputAttribute(stream_id, attr, length, start): + ''' FillConsoleOutputAttribute( hConsole, csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten )''' + handle = _GetStdHandle(stream_id) + attribute = wintypes.WORD(attr) + length = wintypes.DWORD(length) + num_written = wintypes.DWORD(0) + # Note that this is hard-coded for ANSI (vs wide) bytes. + return _FillConsoleOutputAttribute( + handle, attribute, length, start, byref(num_written)) + + def SetConsoleTitle(title): + return _SetConsoleTitleW(title) + + def GetConsoleMode(handle): + mode = wintypes.DWORD() + success = _GetConsoleMode(handle, byref(mode)) + if not success: + raise ctypes.WinError() + return mode.value + + def SetConsoleMode(handle, mode): + success = _SetConsoleMode(handle, mode) + if not success: + raise ctypes.WinError() diff --git a/venv/Lib/site-packages/colorama/winterm.py b/venv/Lib/site-packages/colorama/winterm.py new file mode 100644 index 0000000000000000000000000000000000000000..aad867e8c80b826bf6a060116f17fa08a8eb0765 --- /dev/null +++ b/venv/Lib/site-packages/colorama/winterm.py @@ -0,0 +1,195 @@ +# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. +try: + from msvcrt import get_osfhandle +except ImportError: + def get_osfhandle(_): + raise OSError("This isn't windows!") + + +from . import win32 + +# from wincon.h +class WinColor(object): + BLACK = 0 + BLUE = 1 + GREEN = 2 + CYAN = 3 + RED = 4 + MAGENTA = 5 + YELLOW = 6 + GREY = 7 + +# from wincon.h +class WinStyle(object): + NORMAL = 0x00 # dim text, dim background + BRIGHT = 0x08 # bright text, dim background + BRIGHT_BACKGROUND = 0x80 # dim text, bright background + +class WinTerm(object): + + def __init__(self): + self._default = win32.GetConsoleScreenBufferInfo(win32.STDOUT).wAttributes + self.set_attrs(self._default) + self._default_fore = self._fore + self._default_back = self._back + self._default_style = self._style + # In order to emulate LIGHT_EX in windows, we borrow the BRIGHT style. + # So that LIGHT_EX colors and BRIGHT style do not clobber each other, + # we track them separately, since LIGHT_EX is overwritten by Fore/Back + # and BRIGHT is overwritten by Style codes. + self._light = 0 + + def get_attrs(self): + return self._fore + self._back * 16 + (self._style | self._light) + + def set_attrs(self, value): + self._fore = value & 7 + self._back = (value >> 4) & 7 + self._style = value & (WinStyle.BRIGHT | WinStyle.BRIGHT_BACKGROUND) + + def reset_all(self, on_stderr=None): + self.set_attrs(self._default) + self.set_console(attrs=self._default) + self._light = 0 + + def fore(self, fore=None, light=False, on_stderr=False): + if fore is None: + fore = self._default_fore + self._fore = fore + # Emulate LIGHT_EX with BRIGHT Style + if light: + self._light |= WinStyle.BRIGHT + else: + self._light &= ~WinStyle.BRIGHT + self.set_console(on_stderr=on_stderr) + + def back(self, back=None, light=False, on_stderr=False): + if back is None: + back = self._default_back + self._back = back + # Emulate LIGHT_EX with BRIGHT_BACKGROUND Style + if light: + self._light |= WinStyle.BRIGHT_BACKGROUND + else: + self._light &= ~WinStyle.BRIGHT_BACKGROUND + self.set_console(on_stderr=on_stderr) + + def style(self, style=None, on_stderr=False): + if style is None: + style = self._default_style + self._style = style + self.set_console(on_stderr=on_stderr) + + def set_console(self, attrs=None, on_stderr=False): + if attrs is None: + attrs = self.get_attrs() + handle = win32.STDOUT + if on_stderr: + handle = win32.STDERR + win32.SetConsoleTextAttribute(handle, attrs) + + def get_position(self, handle): + position = win32.GetConsoleScreenBufferInfo(handle).dwCursorPosition + # Because Windows coordinates are 0-based, + # and win32.SetConsoleCursorPosition expects 1-based. + position.X += 1 + position.Y += 1 + return position + + def set_cursor_position(self, position=None, on_stderr=False): + if position is None: + # I'm not currently tracking the position, so there is no default. + # position = self.get_position() + return + handle = win32.STDOUT + if on_stderr: + handle = win32.STDERR + win32.SetConsoleCursorPosition(handle, position) + + def cursor_adjust(self, x, y, on_stderr=False): + handle = win32.STDOUT + if on_stderr: + handle = win32.STDERR + position = self.get_position(handle) + adjusted_position = (position.Y + y, position.X + x) + win32.SetConsoleCursorPosition(handle, adjusted_position, adjust=False) + + def erase_screen(self, mode=0, on_stderr=False): + # 0 should clear from the cursor to the end of the screen. + # 1 should clear from the cursor to the beginning of the screen. + # 2 should clear the entire screen, and move cursor to (1,1) + handle = win32.STDOUT + if on_stderr: + handle = win32.STDERR + csbi = win32.GetConsoleScreenBufferInfo(handle) + # get the number of character cells in the current buffer + cells_in_screen = csbi.dwSize.X * csbi.dwSize.Y + # get number of character cells before current cursor position + cells_before_cursor = csbi.dwSize.X * csbi.dwCursorPosition.Y + csbi.dwCursorPosition.X + if mode == 0: + from_coord = csbi.dwCursorPosition + cells_to_erase = cells_in_screen - cells_before_cursor + elif mode == 1: + from_coord = win32.COORD(0, 0) + cells_to_erase = cells_before_cursor + elif mode == 2: + from_coord = win32.COORD(0, 0) + cells_to_erase = cells_in_screen + else: + # invalid mode + return + # fill the entire screen with blanks + win32.FillConsoleOutputCharacter(handle, ' ', cells_to_erase, from_coord) + # now set the buffer's attributes accordingly + win32.FillConsoleOutputAttribute(handle, self.get_attrs(), cells_to_erase, from_coord) + if mode == 2: + # put the cursor where needed + win32.SetConsoleCursorPosition(handle, (1, 1)) + + def erase_line(self, mode=0, on_stderr=False): + # 0 should clear from the cursor to the end of the line. + # 1 should clear from the cursor to the beginning of the line. + # 2 should clear the entire line. + handle = win32.STDOUT + if on_stderr: + handle = win32.STDERR + csbi = win32.GetConsoleScreenBufferInfo(handle) + if mode == 0: + from_coord = csbi.dwCursorPosition + cells_to_erase = csbi.dwSize.X - csbi.dwCursorPosition.X + elif mode == 1: + from_coord = win32.COORD(0, csbi.dwCursorPosition.Y) + cells_to_erase = csbi.dwCursorPosition.X + elif mode == 2: + from_coord = win32.COORD(0, csbi.dwCursorPosition.Y) + cells_to_erase = csbi.dwSize.X + else: + # invalid mode + return + # fill the entire screen with blanks + win32.FillConsoleOutputCharacter(handle, ' ', cells_to_erase, from_coord) + # now set the buffer's attributes accordingly + win32.FillConsoleOutputAttribute(handle, self.get_attrs(), cells_to_erase, from_coord) + + def set_title(self, title): + win32.SetConsoleTitle(title) + + +def enable_vt_processing(fd): + if win32.windll is None or not win32.winapi_test(): + return False + + try: + handle = get_osfhandle(fd) + mode = win32.GetConsoleMode(handle) + win32.SetConsoleMode( + handle, + mode | win32.ENABLE_VIRTUAL_TERMINAL_PROCESSING, + ) + + mode = win32.GetConsoleMode(handle) + if mode & win32.ENABLE_VIRTUAL_TERMINAL_PROCESSING: + return True + # Can get TypeError in testsuite where 'fd' is a Mock() + except (OSError, TypeError): + return False diff --git a/venv/Lib/site-packages/dotenv/__init__.py b/venv/Lib/site-packages/dotenv/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7f4c631ba11786bceebd22591f91bd378d8b232c --- /dev/null +++ b/venv/Lib/site-packages/dotenv/__init__.py @@ -0,0 +1,49 @@ +from typing import Any, Optional + +from .main import (dotenv_values, find_dotenv, get_key, load_dotenv, set_key, + unset_key) + + +def load_ipython_extension(ipython: Any) -> None: + from .ipython import load_ipython_extension + load_ipython_extension(ipython) + + +def get_cli_string( + path: Optional[str] = None, + action: Optional[str] = None, + key: Optional[str] = None, + value: Optional[str] = None, + quote: Optional[str] = None, +): + """Returns a string suitable for running as a shell script. + + Useful for converting a arguments passed to a fabric task + to be passed to a `local` or `run` command. + """ + command = ['dotenv'] + if quote: + command.append(f'-q {quote}') + if path: + command.append(f'-f {path}') + if action: + command.append(action) + if key: + command.append(key) + if value: + if ' ' in value: + command.append(f'"{value}"') + else: + command.append(value) + + return ' '.join(command).strip() + + +__all__ = ['get_cli_string', + 'load_dotenv', + 'dotenv_values', + 'get_key', + 'set_key', + 'unset_key', + 'find_dotenv', + 'load_ipython_extension'] diff --git a/venv/Lib/site-packages/dotenv/__main__.py b/venv/Lib/site-packages/dotenv/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..3977f55a8b1e94e67bab364885e502e6c89e3bc5 --- /dev/null +++ b/venv/Lib/site-packages/dotenv/__main__.py @@ -0,0 +1,6 @@ +"""Entry point for cli, enables execution with `python -m dotenv`""" + +from .cli import cli + +if __name__ == "__main__": + cli() diff --git a/venv/Lib/site-packages/dotenv/__pycache__/__init__.cpython-313.pyc b/venv/Lib/site-packages/dotenv/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f5fea85eedff8e5c071439da7ce1c1ceaffa721c Binary files /dev/null and b/venv/Lib/site-packages/dotenv/__pycache__/__init__.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/dotenv/__pycache__/__main__.cpython-313.pyc b/venv/Lib/site-packages/dotenv/__pycache__/__main__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..209f87d713f4701dc33352ebfa3aff888e06c56f Binary files /dev/null and b/venv/Lib/site-packages/dotenv/__pycache__/__main__.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/dotenv/__pycache__/cli.cpython-313.pyc b/venv/Lib/site-packages/dotenv/__pycache__/cli.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..27709cd8c50c95428e98e5deccbe34610aaa7995 Binary files /dev/null and b/venv/Lib/site-packages/dotenv/__pycache__/cli.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/dotenv/__pycache__/ipython.cpython-313.pyc b/venv/Lib/site-packages/dotenv/__pycache__/ipython.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c0dc38ea1854e27c562eee9f30b421b86562be63 Binary files /dev/null and b/venv/Lib/site-packages/dotenv/__pycache__/ipython.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/dotenv/__pycache__/main.cpython-313.pyc b/venv/Lib/site-packages/dotenv/__pycache__/main.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8817359974a9d09f11242c28316635a796846236 Binary files /dev/null and b/venv/Lib/site-packages/dotenv/__pycache__/main.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/dotenv/__pycache__/parser.cpython-313.pyc b/venv/Lib/site-packages/dotenv/__pycache__/parser.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7fd5b7e8a2eae741d55b3404b787fc0fb5ea08c7 Binary files /dev/null and b/venv/Lib/site-packages/dotenv/__pycache__/parser.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/dotenv/__pycache__/variables.cpython-313.pyc b/venv/Lib/site-packages/dotenv/__pycache__/variables.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a3a67eec1bac11cc131dd239207fefa7791f692a Binary files /dev/null and b/venv/Lib/site-packages/dotenv/__pycache__/variables.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/dotenv/__pycache__/version.cpython-313.pyc b/venv/Lib/site-packages/dotenv/__pycache__/version.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..037a8a5061c2b8e71e46601e857d528907219c46 Binary files /dev/null and b/venv/Lib/site-packages/dotenv/__pycache__/version.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/dotenv/cli.py b/venv/Lib/site-packages/dotenv/cli.py new file mode 100644 index 0000000000000000000000000000000000000000..075a7af175ab5b278229529d1308d62a71d153a0 --- /dev/null +++ b/venv/Lib/site-packages/dotenv/cli.py @@ -0,0 +1,205 @@ +import json +import os +import shlex +import sys +from contextlib import contextmanager +from typing import Any, Dict, IO, Iterator, List, Optional + +if sys.platform == 'win32': + from subprocess import Popen + +try: + import click +except ImportError: + sys.stderr.write('It seems python-dotenv is not installed with cli option. \n' + 'Run pip install "python-dotenv[cli]" to fix this.') + sys.exit(1) + +from .main import dotenv_values, set_key, unset_key +from .version import __version__ + + +def enumerate_env() -> Optional[str]: + """ + Return a path for the ${pwd}/.env file. + + If pwd does not exist, return None. + """ + try: + cwd = os.getcwd() + except FileNotFoundError: + return None + path = os.path.join(cwd, '.env') + return path + + +@click.group() +@click.option('-f', '--file', default=enumerate_env(), + type=click.Path(file_okay=True), + help="Location of the .env file, defaults to .env file in current working directory.") +@click.option('-q', '--quote', default='always', + type=click.Choice(['always', 'never', 'auto']), + help="Whether to quote or not the variable values. Default mode is always. This does not affect parsing.") +@click.option('-e', '--export', default=False, + type=click.BOOL, + help="Whether to write the dot file as an executable bash script.") +@click.version_option(version=__version__) +@click.pass_context +def cli(ctx: click.Context, file: Any, quote: Any, export: Any) -> None: + """This script is used to set, get or unset values from a .env file.""" + ctx.obj = {'QUOTE': quote, 'EXPORT': export, 'FILE': file} + + +@contextmanager +def stream_file(path: os.PathLike) -> Iterator[IO[str]]: + """ + Open a file and yield the corresponding (decoded) stream. + + Exits with error code 2 if the file cannot be opened. + """ + + try: + with open(path) as stream: + yield stream + except OSError as exc: + print(f"Error opening env file: {exc}", file=sys.stderr) + exit(2) + + +@cli.command() +@click.pass_context +@click.option('--format', default='simple', + type=click.Choice(['simple', 'json', 'shell', 'export']), + help="The format in which to display the list. Default format is simple, " + "which displays name=value without quotes.") +def list(ctx: click.Context, format: bool) -> None: + """Display all the stored key/value.""" + file = ctx.obj['FILE'] + + with stream_file(file) as stream: + values = dotenv_values(stream=stream) + + if format == 'json': + click.echo(json.dumps(values, indent=2, sort_keys=True)) + else: + prefix = 'export ' if format == 'export' else '' + for k in sorted(values): + v = values[k] + if v is not None: + if format in ('export', 'shell'): + v = shlex.quote(v) + click.echo(f'{prefix}{k}={v}') + + +@cli.command() +@click.pass_context +@click.argument('key', required=True) +@click.argument('value', required=True) +def set(ctx: click.Context, key: Any, value: Any) -> None: + """Store the given key/value.""" + file = ctx.obj['FILE'] + quote = ctx.obj['QUOTE'] + export = ctx.obj['EXPORT'] + success, key, value = set_key(file, key, value, quote, export) + if success: + click.echo(f'{key}={value}') + else: + exit(1) + + +@cli.command() +@click.pass_context +@click.argument('key', required=True) +def get(ctx: click.Context, key: Any) -> None: + """Retrieve the value for the given key.""" + file = ctx.obj['FILE'] + + with stream_file(file) as stream: + values = dotenv_values(stream=stream) + + stored_value = values.get(key) + if stored_value: + click.echo(stored_value) + else: + exit(1) + + +@cli.command() +@click.pass_context +@click.argument('key', required=True) +def unset(ctx: click.Context, key: Any) -> None: + """Removes the given key.""" + file = ctx.obj['FILE'] + quote = ctx.obj['QUOTE'] + success, key = unset_key(file, key, quote) + if success: + click.echo(f"Successfully removed {key}") + else: + exit(1) + + +@cli.command(context_settings={'ignore_unknown_options': True}) +@click.pass_context +@click.option( + "--override/--no-override", + default=True, + help="Override variables from the environment file with those from the .env file.", +) +@click.argument('commandline', nargs=-1, type=click.UNPROCESSED) +def run(ctx: click.Context, override: bool, commandline: List[str]) -> None: + """Run command with environment variables present.""" + file = ctx.obj['FILE'] + if not os.path.isfile(file): + raise click.BadParameter( + f'Invalid value for \'-f\' "{file}" does not exist.', + ctx=ctx + ) + dotenv_as_dict = { + k: v + for (k, v) in dotenv_values(file).items() + if v is not None and (override or k not in os.environ) + } + + if not commandline: + click.echo('No command given.') + exit(1) + run_command(commandline, dotenv_as_dict) + + +def run_command(command: List[str], env: Dict[str, str]) -> None: + """Replace the current process with the specified command. + + Replaces the current process with the specified command and the variables from `env` + added in the current environment variables. + + Parameters + ---------- + command: List[str] + The command and it's parameters + env: Dict + The additional environment variables + + Returns + ------- + None + This function does not return any value. It replaces the current process with the new one. + + """ + # copy the current environment variables and add the vales from + # `env` + cmd_env = os.environ.copy() + cmd_env.update(env) + + if sys.platform == 'win32': + # execvpe on Windows returns control immediately + # rather than once the command has finished. + p = Popen(command, + universal_newlines=True, + bufsize=0, + shell=False, + env=cmd_env) + _, _ = p.communicate() + + exit(p.returncode) + else: + os.execvpe(command[0], args=command, env=cmd_env) diff --git a/venv/Lib/site-packages/dotenv/ipython.py b/venv/Lib/site-packages/dotenv/ipython.py new file mode 100644 index 0000000000000000000000000000000000000000..7df727cd0ba5eb481a9e2568ffdd063bfce90314 --- /dev/null +++ b/venv/Lib/site-packages/dotenv/ipython.py @@ -0,0 +1,39 @@ +from IPython.core.magic import Magics, line_magic, magics_class # type: ignore +from IPython.core.magic_arguments import (argument, magic_arguments, # type: ignore + parse_argstring) # type: ignore + +from .main import find_dotenv, load_dotenv + + +@magics_class +class IPythonDotEnv(Magics): + + @magic_arguments() + @argument( + '-o', '--override', action='store_true', + help="Indicate to override existing variables" + ) + @argument( + '-v', '--verbose', action='store_true', + help="Indicate function calls to be verbose" + ) + @argument('dotenv_path', nargs='?', type=str, default='.env', + help='Search in increasingly higher folders for the `dotenv_path`') + @line_magic + def dotenv(self, line): + args = parse_argstring(self.dotenv, line) + # Locate the .env file + dotenv_path = args.dotenv_path + try: + dotenv_path = find_dotenv(dotenv_path, True, True) + except IOError: + print("cannot find .env file") + return + + # Load the .env file + load_dotenv(dotenv_path, verbose=args.verbose, override=args.override) + + +def load_ipython_extension(ipython): + """Register the %dotenv magic.""" + ipython.register_magics(IPythonDotEnv) diff --git a/venv/Lib/site-packages/dotenv/main.py b/venv/Lib/site-packages/dotenv/main.py new file mode 100644 index 0000000000000000000000000000000000000000..8e6a7cf460f9bad21a2c0c1f1c10ccabbdf4f118 --- /dev/null +++ b/venv/Lib/site-packages/dotenv/main.py @@ -0,0 +1,400 @@ +import io +import logging +import os +import pathlib +import shutil +import sys +import tempfile +from collections import OrderedDict +from contextlib import contextmanager +from typing import IO, Dict, Iterable, Iterator, Mapping, Optional, Tuple, Union + +from .parser import Binding, parse_stream +from .variables import parse_variables + +# A type alias for a string path to be used for the paths in this file. +# These paths may flow to `open()` and `shutil.move()`; `shutil.move()` +# only accepts string paths, not byte paths or file descriptors. See +# https://github.com/python/typeshed/pull/6832. +StrPath = Union[str, "os.PathLike[str]"] + +logger = logging.getLogger(__name__) + + +def with_warn_for_invalid_lines(mappings: Iterator[Binding]) -> Iterator[Binding]: + for mapping in mappings: + if mapping.error: + logger.warning( + "python-dotenv could not parse statement starting at line %s", + mapping.original.line, + ) + yield mapping + + +class DotEnv: + def __init__( + self, + dotenv_path: Optional[StrPath], + stream: Optional[IO[str]] = None, + verbose: bool = False, + encoding: Optional[str] = None, + interpolate: bool = True, + override: bool = True, + ) -> None: + self.dotenv_path: Optional[StrPath] = dotenv_path + self.stream: Optional[IO[str]] = stream + self._dict: Optional[Dict[str, Optional[str]]] = None + self.verbose: bool = verbose + self.encoding: Optional[str] = encoding + self.interpolate: bool = interpolate + self.override: bool = override + + @contextmanager + def _get_stream(self) -> Iterator[IO[str]]: + if self.dotenv_path and os.path.isfile(self.dotenv_path): + with open(self.dotenv_path, encoding=self.encoding) as stream: + yield stream + elif self.stream is not None: + yield self.stream + else: + if self.verbose: + logger.info( + "python-dotenv could not find configuration file %s.", + self.dotenv_path or ".env", + ) + yield io.StringIO("") + + def dict(self) -> Dict[str, Optional[str]]: + """Return dotenv as dict""" + if self._dict: + return self._dict + + raw_values = self.parse() + + if self.interpolate: + self._dict = OrderedDict( + resolve_variables(raw_values, override=self.override) + ) + else: + self._dict = OrderedDict(raw_values) + + return self._dict + + def parse(self) -> Iterator[Tuple[str, Optional[str]]]: + with self._get_stream() as stream: + for mapping in with_warn_for_invalid_lines(parse_stream(stream)): + if mapping.key is not None: + yield mapping.key, mapping.value + + def set_as_environment_variables(self) -> bool: + """ + Load the current dotenv as system environment variable. + """ + if not self.dict(): + return False + + for k, v in self.dict().items(): + if k in os.environ and not self.override: + continue + if v is not None: + os.environ[k] = v + + return True + + def get(self, key: str) -> Optional[str]: + """ """ + data = self.dict() + + if key in data: + return data[key] + + if self.verbose: + logger.warning("Key %s not found in %s.", key, self.dotenv_path) + + return None + + +def get_key( + dotenv_path: StrPath, + key_to_get: str, + encoding: Optional[str] = "utf-8", +) -> Optional[str]: + """ + Get the value of a given key from the given .env. + + Returns `None` if the key isn't found or doesn't have a value. + """ + return DotEnv(dotenv_path, verbose=True, encoding=encoding).get(key_to_get) + + +@contextmanager +def rewrite( + path: StrPath, + encoding: Optional[str], +) -> Iterator[Tuple[IO[str], IO[str]]]: + pathlib.Path(path).touch() + + with tempfile.NamedTemporaryFile(mode="w", encoding=encoding, delete=False) as dest: + error = None + try: + with open(path, encoding=encoding) as source: + yield (source, dest) + except BaseException as err: + error = err + + if error is None: + shutil.move(dest.name, path) + else: + os.unlink(dest.name) + raise error from None + + +def set_key( + dotenv_path: StrPath, + key_to_set: str, + value_to_set: str, + quote_mode: str = "always", + export: bool = False, + encoding: Optional[str] = "utf-8", +) -> Tuple[Optional[bool], str, str]: + """ + Adds or Updates a key/value to the given .env + + If the .env path given doesn't exist, fails instead of risking creating + an orphan .env somewhere in the filesystem + """ + if quote_mode not in ("always", "auto", "never"): + raise ValueError(f"Unknown quote_mode: {quote_mode}") + + quote = quote_mode == "always" or ( + quote_mode == "auto" and not value_to_set.isalnum() + ) + + if quote: + value_out = "'{}'".format(value_to_set.replace("'", "\\'")) + else: + value_out = value_to_set + if export: + line_out = f"export {key_to_set}={value_out}\n" + else: + line_out = f"{key_to_set}={value_out}\n" + + with rewrite(dotenv_path, encoding=encoding) as (source, dest): + replaced = False + missing_newline = False + for mapping in with_warn_for_invalid_lines(parse_stream(source)): + if mapping.key == key_to_set: + dest.write(line_out) + replaced = True + else: + dest.write(mapping.original.string) + missing_newline = not mapping.original.string.endswith("\n") + if not replaced: + if missing_newline: + dest.write("\n") + dest.write(line_out) + + return True, key_to_set, value_to_set + + +def unset_key( + dotenv_path: StrPath, + key_to_unset: str, + quote_mode: str = "always", + encoding: Optional[str] = "utf-8", +) -> Tuple[Optional[bool], str]: + """ + Removes a given key from the given `.env` file. + + If the .env path given doesn't exist, fails. + If the given key doesn't exist in the .env, fails. + """ + if not os.path.exists(dotenv_path): + logger.warning("Can't delete from %s - it doesn't exist.", dotenv_path) + return None, key_to_unset + + removed = False + with rewrite(dotenv_path, encoding=encoding) as (source, dest): + for mapping in with_warn_for_invalid_lines(parse_stream(source)): + if mapping.key == key_to_unset: + removed = True + else: + dest.write(mapping.original.string) + + if not removed: + logger.warning( + "Key %s not removed from %s - key doesn't exist.", key_to_unset, dotenv_path + ) + return None, key_to_unset + + return removed, key_to_unset + + +def resolve_variables( + values: Iterable[Tuple[str, Optional[str]]], + override: bool, +) -> Mapping[str, Optional[str]]: + new_values: Dict[str, Optional[str]] = {} + + for name, value in values: + if value is None: + result = None + else: + atoms = parse_variables(value) + env: Dict[str, Optional[str]] = {} + if override: + env.update(os.environ) # type: ignore + env.update(new_values) + else: + env.update(new_values) + env.update(os.environ) # type: ignore + result = "".join(atom.resolve(env) for atom in atoms) + + new_values[name] = result + + return new_values + + +def _walk_to_root(path: str) -> Iterator[str]: + """ + Yield directories starting from the given directory up to the root + """ + if not os.path.exists(path): + raise IOError("Starting path not found") + + if os.path.isfile(path): + path = os.path.dirname(path) + + last_dir = None + current_dir = os.path.abspath(path) + while last_dir != current_dir: + yield current_dir + parent_dir = os.path.abspath(os.path.join(current_dir, os.path.pardir)) + last_dir, current_dir = current_dir, parent_dir + + +def find_dotenv( + filename: str = ".env", + raise_error_if_not_found: bool = False, + usecwd: bool = False, +) -> str: + """ + Search in increasingly higher folders for the given file + + Returns path to the file if found, or an empty string otherwise + """ + + def _is_interactive(): + """Decide whether this is running in a REPL or IPython notebook""" + if hasattr(sys, "ps1") or hasattr(sys, "ps2"): + return True + try: + main = __import__("__main__", None, None, fromlist=["__file__"]) + except ModuleNotFoundError: + return False + return not hasattr(main, "__file__") + + def _is_debugger(): + return sys.gettrace() is not None + + if usecwd or _is_interactive() or _is_debugger() or getattr(sys, "frozen", False): + # Should work without __file__, e.g. in REPL or IPython notebook. + path = os.getcwd() + else: + # will work for .py files + frame = sys._getframe() + current_file = __file__ + + while frame.f_code.co_filename == current_file or not os.path.exists( + frame.f_code.co_filename + ): + assert frame.f_back is not None + frame = frame.f_back + frame_filename = frame.f_code.co_filename + path = os.path.dirname(os.path.abspath(frame_filename)) + + for dirname in _walk_to_root(path): + check_path = os.path.join(dirname, filename) + if os.path.isfile(check_path): + return check_path + + if raise_error_if_not_found: + raise IOError("File not found") + + return "" + + +def load_dotenv( + dotenv_path: Optional[StrPath] = None, + stream: Optional[IO[str]] = None, + verbose: bool = False, + override: bool = False, + interpolate: bool = True, + encoding: Optional[str] = "utf-8", +) -> bool: + """Parse a .env file and then load all the variables found as environment variables. + + Parameters: + dotenv_path: Absolute or relative path to .env file. + stream: Text stream (such as `io.StringIO`) with .env content, used if + `dotenv_path` is `None`. + verbose: Whether to output a warning the .env file is missing. + override: Whether to override the system environment variables with the variables + from the `.env` file. + encoding: Encoding to be used to read the file. + Returns: + Bool: True if at least one environment variable is set else False + + If both `dotenv_path` and `stream` are `None`, `find_dotenv()` is used to find the + .env file with it's default parameters. If you need to change the default parameters + of `find_dotenv()`, you can explicitly call `find_dotenv()` and pass the result + to this function as `dotenv_path`. + """ + if dotenv_path is None and stream is None: + dotenv_path = find_dotenv() + + dotenv = DotEnv( + dotenv_path=dotenv_path, + stream=stream, + verbose=verbose, + interpolate=interpolate, + override=override, + encoding=encoding, + ) + return dotenv.set_as_environment_variables() + + +def dotenv_values( + dotenv_path: Optional[StrPath] = None, + stream: Optional[IO[str]] = None, + verbose: bool = False, + interpolate: bool = True, + encoding: Optional[str] = "utf-8", +) -> Dict[str, Optional[str]]: + """ + Parse a .env file and return its content as a dict. + + The returned dict will have `None` values for keys without values in the .env file. + For example, `foo=bar` results in `{"foo": "bar"}` whereas `foo` alone results in + `{"foo": None}` + + Parameters: + dotenv_path: Absolute or relative path to the .env file. + stream: `StringIO` object with .env content, used if `dotenv_path` is `None`. + verbose: Whether to output a warning if the .env file is missing. + encoding: Encoding to be used to read the file. + + If both `dotenv_path` and `stream` are `None`, `find_dotenv()` is used to find the + .env file. + """ + if dotenv_path is None and stream is None: + dotenv_path = find_dotenv() + + return DotEnv( + dotenv_path=dotenv_path, + stream=stream, + verbose=verbose, + interpolate=interpolate, + override=True, + encoding=encoding, + ).dict() diff --git a/venv/Lib/site-packages/dotenv/parser.py b/venv/Lib/site-packages/dotenv/parser.py new file mode 100644 index 0000000000000000000000000000000000000000..735f14a3b425a3ee7d81e6e4aa5a2b04202925c4 --- /dev/null +++ b/venv/Lib/site-packages/dotenv/parser.py @@ -0,0 +1,175 @@ +import codecs +import re +from typing import (IO, Iterator, Match, NamedTuple, Optional, # noqa:F401 + Pattern, Sequence, Tuple) + + +def make_regex(string: str, extra_flags: int = 0) -> Pattern[str]: + return re.compile(string, re.UNICODE | extra_flags) + + +_newline = make_regex(r"(\r\n|\n|\r)") +_multiline_whitespace = make_regex(r"\s*", extra_flags=re.MULTILINE) +_whitespace = make_regex(r"[^\S\r\n]*") +_export = make_regex(r"(?:export[^\S\r\n]+)?") +_single_quoted_key = make_regex(r"'([^']+)'") +_unquoted_key = make_regex(r"([^=\#\s]+)") +_equal_sign = make_regex(r"(=[^\S\r\n]*)") +_single_quoted_value = make_regex(r"'((?:\\'|[^'])*)'") +_double_quoted_value = make_regex(r'"((?:\\"|[^"])*)"') +_unquoted_value = make_regex(r"([^\r\n]*)") +_comment = make_regex(r"(?:[^\S\r\n]*#[^\r\n]*)?") +_end_of_line = make_regex(r"[^\S\r\n]*(?:\r\n|\n|\r|$)") +_rest_of_line = make_regex(r"[^\r\n]*(?:\r|\n|\r\n)?") +_double_quote_escapes = make_regex(r"\\[\\'\"abfnrtv]") +_single_quote_escapes = make_regex(r"\\[\\']") + + +class Original(NamedTuple): + string: str + line: int + + +class Binding(NamedTuple): + key: Optional[str] + value: Optional[str] + original: Original + error: bool + + +class Position: + def __init__(self, chars: int, line: int) -> None: + self.chars = chars + self.line = line + + @classmethod + def start(cls) -> "Position": + return cls(chars=0, line=1) + + def set(self, other: "Position") -> None: + self.chars = other.chars + self.line = other.line + + def advance(self, string: str) -> None: + self.chars += len(string) + self.line += len(re.findall(_newline, string)) + + +class Error(Exception): + pass + + +class Reader: + def __init__(self, stream: IO[str]) -> None: + self.string = stream.read() + self.position = Position.start() + self.mark = Position.start() + + def has_next(self) -> bool: + return self.position.chars < len(self.string) + + def set_mark(self) -> None: + self.mark.set(self.position) + + def get_marked(self) -> Original: + return Original( + string=self.string[self.mark.chars:self.position.chars], + line=self.mark.line, + ) + + def peek(self, count: int) -> str: + return self.string[self.position.chars:self.position.chars + count] + + def read(self, count: int) -> str: + result = self.string[self.position.chars:self.position.chars + count] + if len(result) < count: + raise Error("read: End of string") + self.position.advance(result) + return result + + def read_regex(self, regex: Pattern[str]) -> Sequence[str]: + match = regex.match(self.string, self.position.chars) + if match is None: + raise Error("read_regex: Pattern not found") + self.position.advance(self.string[match.start():match.end()]) + return match.groups() + + +def decode_escapes(regex: Pattern[str], string: str) -> str: + def decode_match(match: Match[str]) -> str: + return codecs.decode(match.group(0), 'unicode-escape') # type: ignore + + return regex.sub(decode_match, string) + + +def parse_key(reader: Reader) -> Optional[str]: + char = reader.peek(1) + if char == "#": + return None + elif char == "'": + (key,) = reader.read_regex(_single_quoted_key) + else: + (key,) = reader.read_regex(_unquoted_key) + return key + + +def parse_unquoted_value(reader: Reader) -> str: + (part,) = reader.read_regex(_unquoted_value) + return re.sub(r"\s+#.*", "", part).rstrip() + + +def parse_value(reader: Reader) -> str: + char = reader.peek(1) + if char == u"'": + (value,) = reader.read_regex(_single_quoted_value) + return decode_escapes(_single_quote_escapes, value) + elif char == u'"': + (value,) = reader.read_regex(_double_quoted_value) + return decode_escapes(_double_quote_escapes, value) + elif char in (u"", u"\n", u"\r"): + return u"" + else: + return parse_unquoted_value(reader) + + +def parse_binding(reader: Reader) -> Binding: + reader.set_mark() + try: + reader.read_regex(_multiline_whitespace) + if not reader.has_next(): + return Binding( + key=None, + value=None, + original=reader.get_marked(), + error=False, + ) + reader.read_regex(_export) + key = parse_key(reader) + reader.read_regex(_whitespace) + if reader.peek(1) == "=": + reader.read_regex(_equal_sign) + value: Optional[str] = parse_value(reader) + else: + value = None + reader.read_regex(_comment) + reader.read_regex(_end_of_line) + return Binding( + key=key, + value=value, + original=reader.get_marked(), + error=False, + ) + except Error: + reader.read_regex(_rest_of_line) + return Binding( + key=None, + value=None, + original=reader.get_marked(), + error=True, + ) + + +def parse_stream(stream: IO[str]) -> Iterator[Binding]: + reader = Reader(stream) + while reader.has_next(): + yield parse_binding(reader) diff --git a/venv/Lib/site-packages/dotenv/py.typed b/venv/Lib/site-packages/dotenv/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..7632ecf77545c5e5501cb3fc5719df0761104ca2 --- /dev/null +++ b/venv/Lib/site-packages/dotenv/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561 diff --git a/venv/Lib/site-packages/dotenv/variables.py b/venv/Lib/site-packages/dotenv/variables.py new file mode 100644 index 0000000000000000000000000000000000000000..667f2f26ff2182ecdfc5b809ba97a6cf1d1be13a --- /dev/null +++ b/venv/Lib/site-packages/dotenv/variables.py @@ -0,0 +1,86 @@ +import re +from abc import ABCMeta, abstractmethod +from typing import Iterator, Mapping, Optional, Pattern + +_posix_variable: Pattern[str] = re.compile( + r""" + \$\{ + (?P[^\}:]*) + (?::- + (?P[^\}]*) + )? + \} + """, + re.VERBOSE, +) + + +class Atom(metaclass=ABCMeta): + def __ne__(self, other: object) -> bool: + result = self.__eq__(other) + if result is NotImplemented: + return NotImplemented + return not result + + @abstractmethod + def resolve(self, env: Mapping[str, Optional[str]]) -> str: ... + + +class Literal(Atom): + def __init__(self, value: str) -> None: + self.value = value + + def __repr__(self) -> str: + return f"Literal(value={self.value})" + + def __eq__(self, other: object) -> bool: + if not isinstance(other, self.__class__): + return NotImplemented + return self.value == other.value + + def __hash__(self) -> int: + return hash((self.__class__, self.value)) + + def resolve(self, env: Mapping[str, Optional[str]]) -> str: + return self.value + + +class Variable(Atom): + def __init__(self, name: str, default: Optional[str]) -> None: + self.name = name + self.default = default + + def __repr__(self) -> str: + return f"Variable(name={self.name}, default={self.default})" + + def __eq__(self, other: object) -> bool: + if not isinstance(other, self.__class__): + return NotImplemented + return (self.name, self.default) == (other.name, other.default) + + def __hash__(self) -> int: + return hash((self.__class__, self.name, self.default)) + + def resolve(self, env: Mapping[str, Optional[str]]) -> str: + default = self.default if self.default is not None else "" + result = env.get(self.name, default) + return result if result is not None else "" + + +def parse_variables(value: str) -> Iterator[Atom]: + cursor = 0 + + for match in _posix_variable.finditer(value): + (start, end) = match.span() + name = match["name"] + default = match["default"] + + if start > cursor: + yield Literal(value=value[cursor:start]) + + yield Variable(name=name, default=default) + cursor = end + + length = len(value) + if cursor < length: + yield Literal(value=value[cursor:length]) diff --git a/venv/Lib/site-packages/dotenv/version.py b/venv/Lib/site-packages/dotenv/version.py new file mode 100644 index 0000000000000000000000000000000000000000..a82b376d2d72e66e1eb1b713f181f287dcea47a1 --- /dev/null +++ b/venv/Lib/site-packages/dotenv/version.py @@ -0,0 +1 @@ +__version__ = "1.1.1" diff --git a/venv/Lib/site-packages/flash-1.0.3.dist-info/INSTALLER b/venv/Lib/site-packages/flash-1.0.3.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/venv/Lib/site-packages/flash-1.0.3.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/venv/Lib/site-packages/flash-1.0.3.dist-info/LICENSE b/venv/Lib/site-packages/flash-1.0.3.dist-info/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..856eb52017b2552e7a74b75e86792e990a00ba9c --- /dev/null +++ b/venv/Lib/site-packages/flash-1.0.3.dist-info/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Elliott Zheng + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/venv/Lib/site-packages/flash-1.0.3.dist-info/METADATA b/venv/Lib/site-packages/flash-1.0.3.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..4d2905d9fcd38ff15ff22ce8335d4c4003b9d578 --- /dev/null +++ b/venv/Lib/site-packages/flash-1.0.3.dist-info/METADATA @@ -0,0 +1,13 @@ +Metadata-Version: 2.1 +Name: flash +Version: 1.0.3 +Summary: Fast tool +Home-page: UNKNOWN +Author: Elliott Zheng +Author-email: admin@hypercube.top +License: MIT +Platform: UNKNOWN + +UNKNOWN + + diff --git a/venv/Lib/site-packages/flash-1.0.3.dist-info/RECORD b/venv/Lib/site-packages/flash-1.0.3.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..72cee51c54e5c83cc2d18fbe92df5b246a33d42d --- /dev/null +++ b/venv/Lib/site-packages/flash-1.0.3.dist-info/RECORD @@ -0,0 +1,13 @@ +flash-1.0.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +flash-1.0.3.dist-info/LICENSE,sha256=BkdNB-uzJFN11LYvtPlZQxOq9kRtn9t4j2-iZw8zlpY,1091 +flash-1.0.3.dist-info/METADATA,sha256=9oJwSvYfS6ZOz5pgDRoWdWfzlZYekG7ln0ZeNxA_8Fk,185 +flash-1.0.3.dist-info/RECORD,, +flash-1.0.3.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +flash-1.0.3.dist-info/WHEEL,sha256=QBOOAdG2icRHGBs2s94rfaUlHrdfNBp-TceubUYCwOE,97 +flash-1.0.3.dist-info/top_level.txt,sha256=gPTfQwGao1M89TdHszAxa2fgqvl88iO9S3O7zmm7GoE,6 +flash/__init__.py,sha256=NyLg3w3c12yD0z-U2bh_7d11K68ctGaLJmfUTjwxJvI,56 +flash/__pycache__/__init__.cpython-313.pyc,, +flash/__pycache__/_version.cpython-313.pyc,, +flash/__pycache__/tool.cpython-313.pyc,, +flash/_version.py,sha256=MpVHFFoITiYyPltTb_qFrdeX2entdTm4x0PczXi3txY,21 +flash/tool.py,sha256=R1wx73CQHg4_InMkY7mYAVbz9GGVMI2ivn_IewHhcMI,861 diff --git a/venv/Lib/site-packages/flash-1.0.3.dist-info/REQUESTED b/venv/Lib/site-packages/flash-1.0.3.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/venv/Lib/site-packages/flash-1.0.3.dist-info/WHEEL b/venv/Lib/site-packages/flash-1.0.3.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..251abadc1be2fe6c810e7aad3a40f1ca2c64160e --- /dev/null +++ b/venv/Lib/site-packages/flash-1.0.3.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.33.4) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/venv/Lib/site-packages/flash-1.0.3.dist-info/top_level.txt b/venv/Lib/site-packages/flash-1.0.3.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..980a7fc3d9c38b52848bde722d8ec8ab6d9c8b77 --- /dev/null +++ b/venv/Lib/site-packages/flash-1.0.3.dist-info/top_level.txt @@ -0,0 +1 @@ +flash diff --git a/venv/Lib/site-packages/flash/__init__.py b/venv/Lib/site-packages/flash/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fe329d0af70ba44050c48d43df6bcb408f2633dd --- /dev/null +++ b/venv/Lib/site-packages/flash/__init__.py @@ -0,0 +1,2 @@ +from ._version import __version__ +from .tool import * diff --git a/venv/Lib/site-packages/flash/__pycache__/__init__.cpython-313.pyc b/venv/Lib/site-packages/flash/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7010828e2a801d1b20a653fb32c6cc1c610a750f Binary files /dev/null and b/venv/Lib/site-packages/flash/__pycache__/__init__.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flash/__pycache__/_version.cpython-313.pyc b/venv/Lib/site-packages/flash/__pycache__/_version.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d1e2f28f64bd84447b44cb7e031423521d7be608 Binary files /dev/null and b/venv/Lib/site-packages/flash/__pycache__/_version.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flash/__pycache__/tool.cpython-313.pyc b/venv/Lib/site-packages/flash/__pycache__/tool.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..35920c1ce6ec0d5b242e51ff8d34f7a57775ee80 Binary files /dev/null and b/venv/Lib/site-packages/flash/__pycache__/tool.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flash/_version.py b/venv/Lib/site-packages/flash/_version.py new file mode 100644 index 0000000000000000000000000000000000000000..77139f6adeb4faadea412300c55d15cf702ed0d8 --- /dev/null +++ b/venv/Lib/site-packages/flash/_version.py @@ -0,0 +1 @@ +__version__ = '1.0.3' \ No newline at end of file diff --git a/venv/Lib/site-packages/flash/tool.py b/venv/Lib/site-packages/flash/tool.py new file mode 100644 index 0000000000000000000000000000000000000000..f33aca5bbe83fa5c634dd52d35620c8cc397dd2c --- /dev/null +++ b/venv/Lib/site-packages/flash/tool.py @@ -0,0 +1,36 @@ +import os +import platform + + +def mkdir(*args): + for folder in args: + if not os.path.exists(folder): + os.makedirs(folder) + + +def make_join(*args): + folder = os.path.join(*args) + mkdir(folder) + return folder + + +def list_dir(folder, condition=None, key=None, reverse=False): + if condition is not None: + files = [(file, os.path.join(folder, file)) for file in filter(condition, os.listdir(folder))] + else: + files = [(file, os.path.join(folder, file)) for file in os.listdir(folder)] + if key is not None: + files = sorted(files, key=key, reverse=reverse) + return files + + +def flatten(l): + return [item for sublist in l for item in sublist] + + +def is_win(): + return platform.system() == "Windows" + + +def get_postfix(post_fix): + return lambda x: x.endswith(post_fix) diff --git a/venv/Lib/site-packages/flask-2.3.3.dist-info/INSTALLER b/venv/Lib/site-packages/flask-2.3.3.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/venv/Lib/site-packages/flask-2.3.3.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/venv/Lib/site-packages/flask-2.3.3.dist-info/LICENSE.rst b/venv/Lib/site-packages/flask-2.3.3.dist-info/LICENSE.rst new file mode 100644 index 0000000000000000000000000000000000000000..9d227a0cc43c3268d15722b763bd94ad298645a1 --- /dev/null +++ b/venv/Lib/site-packages/flask-2.3.3.dist-info/LICENSE.rst @@ -0,0 +1,28 @@ +Copyright 2010 Pallets + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/venv/Lib/site-packages/flask-2.3.3.dist-info/METADATA b/venv/Lib/site-packages/flask-2.3.3.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..d7c314536239e2b54a4166f1edf315c2a31b7ea6 --- /dev/null +++ b/venv/Lib/site-packages/flask-2.3.3.dist-info/METADATA @@ -0,0 +1,116 @@ +Metadata-Version: 2.1 +Name: Flask +Version: 2.3.3 +Summary: A simple framework for building complex web applications. +Maintainer-email: Pallets +Requires-Python: >=3.8 +Description-Content-Type: text/x-rst +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Web Environment +Classifier: Framework :: Flask +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content +Classifier: Topic :: Internet :: WWW/HTTP :: WSGI +Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application +Classifier: Topic :: Software Development :: Libraries :: Application Frameworks +Requires-Dist: Werkzeug>=2.3.7 +Requires-Dist: Jinja2>=3.1.2 +Requires-Dist: itsdangerous>=2.1.2 +Requires-Dist: click>=8.1.3 +Requires-Dist: blinker>=1.6.2 +Requires-Dist: importlib-metadata>=3.6.0; python_version < '3.10' +Requires-Dist: asgiref>=3.2 ; extra == "async" +Requires-Dist: python-dotenv ; extra == "dotenv" +Project-URL: Changes, https://flask.palletsprojects.com/changes/ +Project-URL: Chat, https://discord.gg/pallets +Project-URL: Documentation, https://flask.palletsprojects.com/ +Project-URL: Donate, https://palletsprojects.com/donate +Project-URL: Issue Tracker, https://github.com/pallets/flask/issues/ +Project-URL: Source Code, https://github.com/pallets/flask/ +Provides-Extra: async +Provides-Extra: dotenv + +Flask +===== + +Flask is a lightweight `WSGI`_ web application framework. It is designed +to make getting started quick and easy, with the ability to scale up to +complex applications. It began as a simple wrapper around `Werkzeug`_ +and `Jinja`_ and has become one of the most popular Python web +application frameworks. + +Flask offers suggestions, but doesn't enforce any dependencies or +project layout. It is up to the developer to choose the tools and +libraries they want to use. There are many extensions provided by the +community that make adding new functionality easy. + +.. _WSGI: https://wsgi.readthedocs.io/ +.. _Werkzeug: https://werkzeug.palletsprojects.com/ +.. _Jinja: https://jinja.palletsprojects.com/ + + +Installing +---------- + +Install and update using `pip`_: + +.. code-block:: text + + $ pip install -U Flask + +.. _pip: https://pip.pypa.io/en/stable/getting-started/ + + +A Simple Example +---------------- + +.. code-block:: python + + # save this as app.py + from flask import Flask + + app = Flask(__name__) + + @app.route("/") + def hello(): + return "Hello, World!" + +.. code-block:: text + + $ flask run + * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) + + +Contributing +------------ + +For guidance on setting up a development environment and how to make a +contribution to Flask, see the `contributing guidelines`_. + +.. _contributing guidelines: https://github.com/pallets/flask/blob/main/CONTRIBUTING.rst + + +Donate +------ + +The Pallets organization develops and supports Flask and the libraries +it uses. In order to grow the community of contributors and users, and +allow the maintainers to devote more time to the projects, `please +donate today`_. + +.. _please donate today: https://palletsprojects.com/donate + + +Links +----- + +- Documentation: https://flask.palletsprojects.com/ +- Changes: https://flask.palletsprojects.com/changes/ +- PyPI Releases: https://pypi.org/project/Flask/ +- Source Code: https://github.com/pallets/flask/ +- Issue Tracker: https://github.com/pallets/flask/issues/ +- Chat: https://discord.gg/pallets + diff --git a/venv/Lib/site-packages/flask-2.3.3.dist-info/RECORD b/venv/Lib/site-packages/flask-2.3.3.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..52a47036cb0e0c09ec67f58725eab363dcc4b47c --- /dev/null +++ b/venv/Lib/site-packages/flask-2.3.3.dist-info/RECORD @@ -0,0 +1,53 @@ +../../Scripts/flask.exe,sha256=tE5Vas-3M8EZMRm2H6_iFhRUt5j1xKe1ZIm-U8tZUhw,108396 +flask-2.3.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +flask-2.3.3.dist-info/LICENSE.rst,sha256=SJqOEQhQntmKN7uYPhHg9-HTHwvY-Zp5yESOf_N9B-o,1475 +flask-2.3.3.dist-info/METADATA,sha256=-BtXVsnPe7lNA3mcFZHJfsVIiVin1A8LUstChm8qiHo,3588 +flask-2.3.3.dist-info/RECORD,, +flask-2.3.3.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +flask-2.3.3.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81 +flask-2.3.3.dist-info/entry_points.txt,sha256=bBP7hTOS5fz9zLtC7sPofBZAlMkEvBxu7KqS6l5lvc4,40 +flask/__init__.py,sha256=xq09XNKP-Y-fdv6BeGH7RlFaY006tUA3o_llGcl-dno,3731 +flask/__main__.py,sha256=bYt9eEaoRQWdejEHFD8REx9jxVEdZptECFsV7F49Ink,30 +flask/__pycache__/__init__.cpython-313.pyc,, +flask/__pycache__/__main__.cpython-313.pyc,, +flask/__pycache__/app.cpython-313.pyc,, +flask/__pycache__/blueprints.cpython-313.pyc,, +flask/__pycache__/cli.cpython-313.pyc,, +flask/__pycache__/config.cpython-313.pyc,, +flask/__pycache__/ctx.cpython-313.pyc,, +flask/__pycache__/debughelpers.cpython-313.pyc,, +flask/__pycache__/globals.cpython-313.pyc,, +flask/__pycache__/helpers.cpython-313.pyc,, +flask/__pycache__/logging.cpython-313.pyc,, +flask/__pycache__/scaffold.cpython-313.pyc,, +flask/__pycache__/sessions.cpython-313.pyc,, +flask/__pycache__/signals.cpython-313.pyc,, +flask/__pycache__/templating.cpython-313.pyc,, +flask/__pycache__/testing.cpython-313.pyc,, +flask/__pycache__/typing.cpython-313.pyc,, +flask/__pycache__/views.cpython-313.pyc,, +flask/__pycache__/wrappers.cpython-313.pyc,, +flask/app.py,sha256=ht3Qx9U9z0I1qUfLoS7bYhJcubdpk-i54eHq37LDlN8,87620 +flask/blueprints.py,sha256=ZpVrwa8UY-YnVDsX_1K10XQjDwCUp7Qn2hmKln5icEQ,24332 +flask/cli.py,sha256=PDwZCfPagi5GUzb-D6dEN7y20gWiVAg3ejRnxBKNHPA,33821 +flask/config.py,sha256=YZSZ-xpFj1iW1B1Kj1iDhpc5s7pHncloiRLqXhsU7Hs,12856 +flask/ctx.py,sha256=x2kGzUXtPzVyi2YSKrU_PV1AvtxTmh2iRdriJRTSPGM,14841 +flask/debughelpers.py,sha256=BR0xkd-sAyFuFW07D6NfrqNwSZxk1IrkG5n8zem-3sw,5547 +flask/globals.py,sha256=KUzVvSPh8v28kUasVDi_aQKB9hI2jZSYQHqaDU2P414,2945 +flask/helpers.py,sha256=uVhMwhhfwgjBt8b--zIZTjkfBRK28yPpmNhgVzhP444,25106 +flask/json/__init__.py,sha256=pdtpoK2b0b1u7Sxbx3feM7VWhsI20l1yGAvbYWxaxvc,5572 +flask/json/__pycache__/__init__.cpython-313.pyc,, +flask/json/__pycache__/provider.cpython-313.pyc,, +flask/json/__pycache__/tag.cpython-313.pyc,, +flask/json/provider.py,sha256=Os0frb8oGfyWKL-TDxb0Uy-MY6gDhPdJkRaUl5xAOXI,7637 +flask/json/tag.py,sha256=ihb7QWrNEr0YC3KD4TolZbftgSPCuLk7FAvK49huYC0,8871 +flask/logging.py,sha256=lArx2Bq9oTtUJ-DnZL9t88xU2zytzp4UWSM9Bd72NDQ,2327 +flask/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +flask/scaffold.py,sha256=ALGHLcy2qSbJ7ENd1H8dOnq5VDgH5XSFsOkDelcOKV8,33217 +flask/sessions.py,sha256=rFH2QKXG24dEazkKGxAHqUpAUh_30hDHrddhVYgAcY0,14169 +flask/signals.py,sha256=s1H4yKjf3c5dgVr41V6sJpE9dLJvmTJMYuK0rkqx3sw,1146 +flask/templating.py,sha256=XdP2hMFnZ5FCZOG7HUaLjC2VC-b4uHSWlDjwv_1p3qc,7503 +flask/testing.py,sha256=h7AinggrMgGzKlDN66VfB0JjWW4Z1U_OD6FyjqBNiYM,10017 +flask/typing.py,sha256=4Lj-YTxUoYvPYofC9GKu-1o0Ht8lyjp9z3I336J13_o,3005 +flask/views.py,sha256=V5hOGZLx0Bn99QGcM6mh5x_uM-MypVT0-RysEFU84jc,6789 +flask/wrappers.py,sha256=PhMp3teK3SnEmIdog59cO_DHiZ9Btn0qI1EifrTdwP8,5709 diff --git a/venv/Lib/site-packages/flask-2.3.3.dist-info/REQUESTED b/venv/Lib/site-packages/flask-2.3.3.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/venv/Lib/site-packages/flask-2.3.3.dist-info/WHEEL b/venv/Lib/site-packages/flask-2.3.3.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..3b5e64b5e6c4a210201d1676a891fd57b15cda99 --- /dev/null +++ b/venv/Lib/site-packages/flask-2.3.3.dist-info/WHEEL @@ -0,0 +1,4 @@ +Wheel-Version: 1.0 +Generator: flit 3.9.0 +Root-Is-Purelib: true +Tag: py3-none-any diff --git a/venv/Lib/site-packages/flask-2.3.3.dist-info/entry_points.txt b/venv/Lib/site-packages/flask-2.3.3.dist-info/entry_points.txt new file mode 100644 index 0000000000000000000000000000000000000000..eec6733e577feb9487435b9722713a820bd4ccc1 --- /dev/null +++ b/venv/Lib/site-packages/flask-2.3.3.dist-info/entry_points.txt @@ -0,0 +1,3 @@ +[console_scripts] +flask=flask.cli:main + diff --git a/venv/Lib/site-packages/flask/__init__.py b/venv/Lib/site-packages/flask/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bdca1b0149179a48a8e417b0c0ae912ebb2a0b57 --- /dev/null +++ b/venv/Lib/site-packages/flask/__init__.py @@ -0,0 +1,102 @@ +from . import json as json +from .app import Flask as Flask +from .app import Request as Request +from .app import Response as Response +from .blueprints import Blueprint as Blueprint +from .config import Config as Config +from .ctx import after_this_request as after_this_request +from .ctx import copy_current_request_context as copy_current_request_context +from .ctx import has_app_context as has_app_context +from .ctx import has_request_context as has_request_context +from .globals import current_app as current_app +from .globals import g as g +from .globals import request as request +from .globals import session as session +from .helpers import abort as abort +from .helpers import flash as flash +from .helpers import get_flashed_messages as get_flashed_messages +from .helpers import get_template_attribute as get_template_attribute +from .helpers import make_response as make_response +from .helpers import redirect as redirect +from .helpers import send_file as send_file +from .helpers import send_from_directory as send_from_directory +from .helpers import stream_with_context as stream_with_context +from .helpers import url_for as url_for +from .json import jsonify as jsonify +from .signals import appcontext_popped as appcontext_popped +from .signals import appcontext_pushed as appcontext_pushed +from .signals import appcontext_tearing_down as appcontext_tearing_down +from .signals import before_render_template as before_render_template +from .signals import got_request_exception as got_request_exception +from .signals import message_flashed as message_flashed +from .signals import request_finished as request_finished +from .signals import request_started as request_started +from .signals import request_tearing_down as request_tearing_down +from .signals import template_rendered as template_rendered +from .templating import render_template as render_template +from .templating import render_template_string as render_template_string +from .templating import stream_template as stream_template +from .templating import stream_template_string as stream_template_string + +__version__ = "2.3.3" + + +def __getattr__(name): + if name == "_app_ctx_stack": + import warnings + from .globals import __app_ctx_stack + + warnings.warn( + "'_app_ctx_stack' is deprecated and will be removed in Flask 2.4.", + DeprecationWarning, + stacklevel=2, + ) + return __app_ctx_stack + + if name == "_request_ctx_stack": + import warnings + from .globals import __request_ctx_stack + + warnings.warn( + "'_request_ctx_stack' is deprecated and will be removed in Flask 2.4.", + DeprecationWarning, + stacklevel=2, + ) + return __request_ctx_stack + + if name == "escape": + import warnings + from markupsafe import escape + + warnings.warn( + "'flask.escape' is deprecated and will be removed in Flask 2.4. Import" + " 'markupsafe.escape' instead.", + DeprecationWarning, + stacklevel=2, + ) + return escape + + if name == "Markup": + import warnings + from markupsafe import Markup + + warnings.warn( + "'flask.Markup' is deprecated and will be removed in Flask 2.4. Import" + " 'markupsafe.Markup' instead.", + DeprecationWarning, + stacklevel=2, + ) + return Markup + + if name == "signals_available": + import warnings + + warnings.warn( + "'signals_available' is deprecated and will be removed in Flask 2.4." + " Signals are always available", + DeprecationWarning, + stacklevel=2, + ) + return True + + raise AttributeError(name) diff --git a/venv/Lib/site-packages/flask/__main__.py b/venv/Lib/site-packages/flask/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..4e28416e104515e90fca4b69cc60d0c61fd15d61 --- /dev/null +++ b/venv/Lib/site-packages/flask/__main__.py @@ -0,0 +1,3 @@ +from .cli import main + +main() diff --git a/venv/Lib/site-packages/flask/__pycache__/__init__.cpython-313.pyc b/venv/Lib/site-packages/flask/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..21b3d1d7dc374f65b169e7024a00030cad875894 Binary files /dev/null and b/venv/Lib/site-packages/flask/__pycache__/__init__.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask/__pycache__/__main__.cpython-313.pyc b/venv/Lib/site-packages/flask/__pycache__/__main__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..20fd9887fc4e39c5c10a08d606ff974f0f4b8ddb Binary files /dev/null and b/venv/Lib/site-packages/flask/__pycache__/__main__.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask/__pycache__/app.cpython-313.pyc b/venv/Lib/site-packages/flask/__pycache__/app.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8cc9d59d0c0554a149b81ae3368679b21bf2b598 Binary files /dev/null and b/venv/Lib/site-packages/flask/__pycache__/app.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask/__pycache__/blueprints.cpython-313.pyc b/venv/Lib/site-packages/flask/__pycache__/blueprints.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b6740f05ca53578974575c363149a485a43b685a Binary files /dev/null and b/venv/Lib/site-packages/flask/__pycache__/blueprints.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask/__pycache__/cli.cpython-313.pyc b/venv/Lib/site-packages/flask/__pycache__/cli.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7459b1d889994cc7abdbca6d4f5c1a1fbb567707 Binary files /dev/null and b/venv/Lib/site-packages/flask/__pycache__/cli.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask/__pycache__/config.cpython-313.pyc b/venv/Lib/site-packages/flask/__pycache__/config.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..43561e85d5dd3888ae90d3d24e85b740398e545c Binary files /dev/null and b/venv/Lib/site-packages/flask/__pycache__/config.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask/__pycache__/ctx.cpython-313.pyc b/venv/Lib/site-packages/flask/__pycache__/ctx.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..868c75e490410ad7bad9446664bf8b8e66578104 Binary files /dev/null and b/venv/Lib/site-packages/flask/__pycache__/ctx.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask/__pycache__/debughelpers.cpython-313.pyc b/venv/Lib/site-packages/flask/__pycache__/debughelpers.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ed0fce432f24f251b7eacaad93e9b7da78e97c19 Binary files /dev/null and b/venv/Lib/site-packages/flask/__pycache__/debughelpers.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask/__pycache__/globals.cpython-313.pyc b/venv/Lib/site-packages/flask/__pycache__/globals.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f90ed2176bdca27f75932a8cbd02ac7658117d85 Binary files /dev/null and b/venv/Lib/site-packages/flask/__pycache__/globals.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask/__pycache__/helpers.cpython-313.pyc b/venv/Lib/site-packages/flask/__pycache__/helpers.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ce858acae67d1f488073a492c1b376046d93f3c7 Binary files /dev/null and b/venv/Lib/site-packages/flask/__pycache__/helpers.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask/__pycache__/logging.cpython-313.pyc b/venv/Lib/site-packages/flask/__pycache__/logging.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5cd283c6bcc86c472f671078593b97e92a405fa5 Binary files /dev/null and b/venv/Lib/site-packages/flask/__pycache__/logging.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask/__pycache__/scaffold.cpython-313.pyc b/venv/Lib/site-packages/flask/__pycache__/scaffold.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..65e7e3c0f30bb0f7bfd56d3a53ed67f3e02ce5e9 Binary files /dev/null and b/venv/Lib/site-packages/flask/__pycache__/scaffold.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask/__pycache__/sessions.cpython-313.pyc b/venv/Lib/site-packages/flask/__pycache__/sessions.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a0766cf45eb402391bf155d2748ba62541f4d4b7 Binary files /dev/null and b/venv/Lib/site-packages/flask/__pycache__/sessions.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask/__pycache__/signals.cpython-313.pyc b/venv/Lib/site-packages/flask/__pycache__/signals.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..579ac89607e62e00a6e87bdaba309154d07aad8e Binary files /dev/null and b/venv/Lib/site-packages/flask/__pycache__/signals.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask/__pycache__/templating.cpython-313.pyc b/venv/Lib/site-packages/flask/__pycache__/templating.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8a2470ef9cc604c3aac28c9b01e805b24a4d1a4b Binary files /dev/null and b/venv/Lib/site-packages/flask/__pycache__/templating.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask/__pycache__/testing.cpython-313.pyc b/venv/Lib/site-packages/flask/__pycache__/testing.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d5039436a4ea3757bf6e5f5b0e0375355673a3b5 Binary files /dev/null and b/venv/Lib/site-packages/flask/__pycache__/testing.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask/__pycache__/typing.cpython-313.pyc b/venv/Lib/site-packages/flask/__pycache__/typing.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9ed053c7f504f960b50f84559f8e954394833aec Binary files /dev/null and b/venv/Lib/site-packages/flask/__pycache__/typing.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask/__pycache__/views.cpython-313.pyc b/venv/Lib/site-packages/flask/__pycache__/views.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..214d952ccb0357fb453e955a9fd15bfc8b416f78 Binary files /dev/null and b/venv/Lib/site-packages/flask/__pycache__/views.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask/__pycache__/wrappers.cpython-313.pyc b/venv/Lib/site-packages/flask/__pycache__/wrappers.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..779bd3c91a4774b127d07b4fdef865fcb5eee1ae Binary files /dev/null and b/venv/Lib/site-packages/flask/__pycache__/wrappers.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask/app.py b/venv/Lib/site-packages/flask/app.py new file mode 100644 index 0000000000000000000000000000000000000000..3b6b38d8ad7f32af70edfead740af1aa313b76f3 --- /dev/null +++ b/venv/Lib/site-packages/flask/app.py @@ -0,0 +1,2213 @@ +from __future__ import annotations + +import logging +import os +import sys +import typing as t +import weakref +from collections.abc import Iterator as _abc_Iterator +from datetime import timedelta +from inspect import iscoroutinefunction +from itertools import chain +from types import TracebackType +from urllib.parse import quote as _url_quote + +import click +from werkzeug.datastructures import Headers +from werkzeug.datastructures import ImmutableDict +from werkzeug.exceptions import Aborter +from werkzeug.exceptions import BadRequest +from werkzeug.exceptions import BadRequestKeyError +from werkzeug.exceptions import HTTPException +from werkzeug.exceptions import InternalServerError +from werkzeug.routing import BuildError +from werkzeug.routing import Map +from werkzeug.routing import MapAdapter +from werkzeug.routing import RequestRedirect +from werkzeug.routing import RoutingException +from werkzeug.routing import Rule +from werkzeug.serving import is_running_from_reloader +from werkzeug.utils import cached_property +from werkzeug.utils import redirect as _wz_redirect +from werkzeug.wrappers import Response as BaseResponse + +from . import cli +from . import typing as ft +from .config import Config +from .config import ConfigAttribute +from .ctx import _AppCtxGlobals +from .ctx import AppContext +from .ctx import RequestContext +from .globals import _cv_app +from .globals import _cv_request +from .globals import g +from .globals import request +from .globals import request_ctx +from .globals import session +from .helpers import _split_blueprint_path +from .helpers import get_debug_flag +from .helpers import get_flashed_messages +from .helpers import get_load_dotenv +from .json.provider import DefaultJSONProvider +from .json.provider import JSONProvider +from .logging import create_logger +from .scaffold import _endpoint_from_view_func +from .scaffold import _sentinel +from .scaffold import find_package +from .scaffold import Scaffold +from .scaffold import setupmethod +from .sessions import SecureCookieSessionInterface +from .sessions import SessionInterface +from .signals import appcontext_tearing_down +from .signals import got_request_exception +from .signals import request_finished +from .signals import request_started +from .signals import request_tearing_down +from .templating import DispatchingJinjaLoader +from .templating import Environment +from .wrappers import Request +from .wrappers import Response + +if t.TYPE_CHECKING: # pragma: no cover + from .blueprints import Blueprint + from .testing import FlaskClient + from .testing import FlaskCliRunner + +T_shell_context_processor = t.TypeVar( + "T_shell_context_processor", bound=ft.ShellContextProcessorCallable +) +T_teardown = t.TypeVar("T_teardown", bound=ft.TeardownCallable) +T_template_filter = t.TypeVar("T_template_filter", bound=ft.TemplateFilterCallable) +T_template_global = t.TypeVar("T_template_global", bound=ft.TemplateGlobalCallable) +T_template_test = t.TypeVar("T_template_test", bound=ft.TemplateTestCallable) + + +def _make_timedelta(value: timedelta | int | None) -> timedelta | None: + if value is None or isinstance(value, timedelta): + return value + + return timedelta(seconds=value) + + +class Flask(Scaffold): + """The flask object implements a WSGI application and acts as the central + object. It is passed the name of the module or package of the + application. Once it is created it will act as a central registry for + the view functions, the URL rules, template configuration and much more. + + The name of the package is used to resolve resources from inside the + package or the folder the module is contained in depending on if the + package parameter resolves to an actual python package (a folder with + an :file:`__init__.py` file inside) or a standard module (just a ``.py`` file). + + For more information about resource loading, see :func:`open_resource`. + + Usually you create a :class:`Flask` instance in your main module or + in the :file:`__init__.py` file of your package like this:: + + from flask import Flask + app = Flask(__name__) + + .. admonition:: About the First Parameter + + The idea of the first parameter is to give Flask an idea of what + belongs to your application. This name is used to find resources + on the filesystem, can be used by extensions to improve debugging + information and a lot more. + + So it's important what you provide there. If you are using a single + module, `__name__` is always the correct value. If you however are + using a package, it's usually recommended to hardcode the name of + your package there. + + For example if your application is defined in :file:`yourapplication/app.py` + you should create it with one of the two versions below:: + + app = Flask('yourapplication') + app = Flask(__name__.split('.')[0]) + + Why is that? The application will work even with `__name__`, thanks + to how resources are looked up. However it will make debugging more + painful. Certain extensions can make assumptions based on the + import name of your application. For example the Flask-SQLAlchemy + extension will look for the code in your application that triggered + an SQL query in debug mode. If the import name is not properly set + up, that debugging information is lost. (For example it would only + pick up SQL queries in `yourapplication.app` and not + `yourapplication.views.frontend`) + + .. versionadded:: 0.7 + The `static_url_path`, `static_folder`, and `template_folder` + parameters were added. + + .. versionadded:: 0.8 + The `instance_path` and `instance_relative_config` parameters were + added. + + .. versionadded:: 0.11 + The `root_path` parameter was added. + + .. versionadded:: 1.0 + The ``host_matching`` and ``static_host`` parameters were added. + + .. versionadded:: 1.0 + The ``subdomain_matching`` parameter was added. Subdomain + matching needs to be enabled manually now. Setting + :data:`SERVER_NAME` does not implicitly enable it. + + :param import_name: the name of the application package + :param static_url_path: can be used to specify a different path for the + static files on the web. Defaults to the name + of the `static_folder` folder. + :param static_folder: The folder with static files that is served at + ``static_url_path``. Relative to the application ``root_path`` + or an absolute path. Defaults to ``'static'``. + :param static_host: the host to use when adding the static route. + Defaults to None. Required when using ``host_matching=True`` + with a ``static_folder`` configured. + :param host_matching: set ``url_map.host_matching`` attribute. + Defaults to False. + :param subdomain_matching: consider the subdomain relative to + :data:`SERVER_NAME` when matching routes. Defaults to False. + :param template_folder: the folder that contains the templates that should + be used by the application. Defaults to + ``'templates'`` folder in the root path of the + application. + :param instance_path: An alternative instance path for the application. + By default the folder ``'instance'`` next to the + package or module is assumed to be the instance + path. + :param instance_relative_config: if set to ``True`` relative filenames + for loading the config are assumed to + be relative to the instance path instead + of the application root. + :param root_path: The path to the root of the application files. + This should only be set manually when it can't be detected + automatically, such as for namespace packages. + """ + + #: The class that is used for request objects. See :class:`~flask.Request` + #: for more information. + request_class = Request + + #: The class that is used for response objects. See + #: :class:`~flask.Response` for more information. + response_class = Response + + #: The class of the object assigned to :attr:`aborter`, created by + #: :meth:`create_aborter`. That object is called by + #: :func:`flask.abort` to raise HTTP errors, and can be + #: called directly as well. + #: + #: Defaults to :class:`werkzeug.exceptions.Aborter`. + #: + #: .. versionadded:: 2.2 + aborter_class = Aborter + + #: The class that is used for the Jinja environment. + #: + #: .. versionadded:: 0.11 + jinja_environment = Environment + + #: The class that is used for the :data:`~flask.g` instance. + #: + #: Example use cases for a custom class: + #: + #: 1. Store arbitrary attributes on flask.g. + #: 2. Add a property for lazy per-request database connectors. + #: 3. Return None instead of AttributeError on unexpected attributes. + #: 4. Raise exception if an unexpected attr is set, a "controlled" flask.g. + #: + #: In Flask 0.9 this property was called `request_globals_class` but it + #: was changed in 0.10 to :attr:`app_ctx_globals_class` because the + #: flask.g object is now application context scoped. + #: + #: .. versionadded:: 0.10 + app_ctx_globals_class = _AppCtxGlobals + + #: The class that is used for the ``config`` attribute of this app. + #: Defaults to :class:`~flask.Config`. + #: + #: Example use cases for a custom class: + #: + #: 1. Default values for certain config options. + #: 2. Access to config values through attributes in addition to keys. + #: + #: .. versionadded:: 0.11 + config_class = Config + + #: The testing flag. Set this to ``True`` to enable the test mode of + #: Flask extensions (and in the future probably also Flask itself). + #: For example this might activate test helpers that have an + #: additional runtime cost which should not be enabled by default. + #: + #: If this is enabled and PROPAGATE_EXCEPTIONS is not changed from the + #: default it's implicitly enabled. + #: + #: This attribute can also be configured from the config with the + #: ``TESTING`` configuration key. Defaults to ``False``. + testing = ConfigAttribute("TESTING") + + #: If a secret key is set, cryptographic components can use this to + #: sign cookies and other things. Set this to a complex random value + #: when you want to use the secure cookie for instance. + #: + #: This attribute can also be configured from the config with the + #: :data:`SECRET_KEY` configuration key. Defaults to ``None``. + secret_key = ConfigAttribute("SECRET_KEY") + + #: A :class:`~datetime.timedelta` which is used to set the expiration + #: date of a permanent session. The default is 31 days which makes a + #: permanent session survive for roughly one month. + #: + #: This attribute can also be configured from the config with the + #: ``PERMANENT_SESSION_LIFETIME`` configuration key. Defaults to + #: ``timedelta(days=31)`` + permanent_session_lifetime = ConfigAttribute( + "PERMANENT_SESSION_LIFETIME", get_converter=_make_timedelta + ) + + json_provider_class: type[JSONProvider] = DefaultJSONProvider + """A subclass of :class:`~flask.json.provider.JSONProvider`. An + instance is created and assigned to :attr:`app.json` when creating + the app. + + The default, :class:`~flask.json.provider.DefaultJSONProvider`, uses + Python's built-in :mod:`json` library. A different provider can use + a different JSON library. + + .. versionadded:: 2.2 + """ + + #: Options that are passed to the Jinja environment in + #: :meth:`create_jinja_environment`. Changing these options after + #: the environment is created (accessing :attr:`jinja_env`) will + #: have no effect. + #: + #: .. versionchanged:: 1.1.0 + #: This is a ``dict`` instead of an ``ImmutableDict`` to allow + #: easier configuration. + #: + jinja_options: dict = {} + + #: Default configuration parameters. + default_config = ImmutableDict( + { + "DEBUG": None, + "TESTING": False, + "PROPAGATE_EXCEPTIONS": None, + "SECRET_KEY": None, + "PERMANENT_SESSION_LIFETIME": timedelta(days=31), + "USE_X_SENDFILE": False, + "SERVER_NAME": None, + "APPLICATION_ROOT": "/", + "SESSION_COOKIE_NAME": "session", + "SESSION_COOKIE_DOMAIN": None, + "SESSION_COOKIE_PATH": None, + "SESSION_COOKIE_HTTPONLY": True, + "SESSION_COOKIE_SECURE": False, + "SESSION_COOKIE_SAMESITE": None, + "SESSION_REFRESH_EACH_REQUEST": True, + "MAX_CONTENT_LENGTH": None, + "SEND_FILE_MAX_AGE_DEFAULT": None, + "TRAP_BAD_REQUEST_ERRORS": None, + "TRAP_HTTP_EXCEPTIONS": False, + "EXPLAIN_TEMPLATE_LOADING": False, + "PREFERRED_URL_SCHEME": "http", + "TEMPLATES_AUTO_RELOAD": None, + "MAX_COOKIE_SIZE": 4093, + } + ) + + #: The rule object to use for URL rules created. This is used by + #: :meth:`add_url_rule`. Defaults to :class:`werkzeug.routing.Rule`. + #: + #: .. versionadded:: 0.7 + url_rule_class = Rule + + #: The map object to use for storing the URL rules and routing + #: configuration parameters. Defaults to :class:`werkzeug.routing.Map`. + #: + #: .. versionadded:: 1.1.0 + url_map_class = Map + + #: The :meth:`test_client` method creates an instance of this test + #: client class. Defaults to :class:`~flask.testing.FlaskClient`. + #: + #: .. versionadded:: 0.7 + test_client_class: type[FlaskClient] | None = None + + #: The :class:`~click.testing.CliRunner` subclass, by default + #: :class:`~flask.testing.FlaskCliRunner` that is used by + #: :meth:`test_cli_runner`. Its ``__init__`` method should take a + #: Flask app object as the first argument. + #: + #: .. versionadded:: 1.0 + test_cli_runner_class: type[FlaskCliRunner] | None = None + + #: the session interface to use. By default an instance of + #: :class:`~flask.sessions.SecureCookieSessionInterface` is used here. + #: + #: .. versionadded:: 0.8 + session_interface: SessionInterface = SecureCookieSessionInterface() + + def __init__( + self, + import_name: str, + static_url_path: str | None = None, + static_folder: str | os.PathLike | None = "static", + static_host: str | None = None, + host_matching: bool = False, + subdomain_matching: bool = False, + template_folder: str | os.PathLike | None = "templates", + instance_path: str | None = None, + instance_relative_config: bool = False, + root_path: str | None = None, + ): + super().__init__( + import_name=import_name, + static_folder=static_folder, + static_url_path=static_url_path, + template_folder=template_folder, + root_path=root_path, + ) + + if instance_path is None: + instance_path = self.auto_find_instance_path() + elif not os.path.isabs(instance_path): + raise ValueError( + "If an instance path is provided it must be absolute." + " A relative path was given instead." + ) + + #: Holds the path to the instance folder. + #: + #: .. versionadded:: 0.8 + self.instance_path = instance_path + + #: The configuration dictionary as :class:`Config`. This behaves + #: exactly like a regular dictionary but supports additional methods + #: to load a config from files. + self.config = self.make_config(instance_relative_config) + + #: An instance of :attr:`aborter_class` created by + #: :meth:`make_aborter`. This is called by :func:`flask.abort` + #: to raise HTTP errors, and can be called directly as well. + #: + #: .. versionadded:: 2.2 + #: Moved from ``flask.abort``, which calls this object. + self.aborter = self.make_aborter() + + self.json: JSONProvider = self.json_provider_class(self) + """Provides access to JSON methods. Functions in ``flask.json`` + will call methods on this provider when the application context + is active. Used for handling JSON requests and responses. + + An instance of :attr:`json_provider_class`. Can be customized by + changing that attribute on a subclass, or by assigning to this + attribute afterwards. + + The default, :class:`~flask.json.provider.DefaultJSONProvider`, + uses Python's built-in :mod:`json` library. A different provider + can use a different JSON library. + + .. versionadded:: 2.2 + """ + + #: A list of functions that are called by + #: :meth:`handle_url_build_error` when :meth:`.url_for` raises a + #: :exc:`~werkzeug.routing.BuildError`. Each function is called + #: with ``error``, ``endpoint`` and ``values``. If a function + #: returns ``None`` or raises a ``BuildError``, it is skipped. + #: Otherwise, its return value is returned by ``url_for``. + #: + #: .. versionadded:: 0.9 + self.url_build_error_handlers: list[ + t.Callable[[Exception, str, dict[str, t.Any]], str] + ] = [] + + #: A list of functions that are called when the application context + #: is destroyed. Since the application context is also torn down + #: if the request ends this is the place to store code that disconnects + #: from databases. + #: + #: .. versionadded:: 0.9 + self.teardown_appcontext_funcs: list[ft.TeardownCallable] = [] + + #: A list of shell context processor functions that should be run + #: when a shell context is created. + #: + #: .. versionadded:: 0.11 + self.shell_context_processors: list[ft.ShellContextProcessorCallable] = [] + + #: Maps registered blueprint names to blueprint objects. The + #: dict retains the order the blueprints were registered in. + #: Blueprints can be registered multiple times, this dict does + #: not track how often they were attached. + #: + #: .. versionadded:: 0.7 + self.blueprints: dict[str, Blueprint] = {} + + #: a place where extensions can store application specific state. For + #: example this is where an extension could store database engines and + #: similar things. + #: + #: The key must match the name of the extension module. For example in + #: case of a "Flask-Foo" extension in `flask_foo`, the key would be + #: ``'foo'``. + #: + #: .. versionadded:: 0.7 + self.extensions: dict = {} + + #: The :class:`~werkzeug.routing.Map` for this instance. You can use + #: this to change the routing converters after the class was created + #: but before any routes are connected. Example:: + #: + #: from werkzeug.routing import BaseConverter + #: + #: class ListConverter(BaseConverter): + #: def to_python(self, value): + #: return value.split(',') + #: def to_url(self, values): + #: return ','.join(super(ListConverter, self).to_url(value) + #: for value in values) + #: + #: app = Flask(__name__) + #: app.url_map.converters['list'] = ListConverter + self.url_map = self.url_map_class() + + self.url_map.host_matching = host_matching + self.subdomain_matching = subdomain_matching + + # tracks internally if the application already handled at least one + # request. + self._got_first_request = False + + # Add a static route using the provided static_url_path, static_host, + # and static_folder if there is a configured static_folder. + # Note we do this without checking if static_folder exists. + # For one, it might be created while the server is running (e.g. during + # development). Also, Google App Engine stores static files somewhere + if self.has_static_folder: + assert ( + bool(static_host) == host_matching + ), "Invalid static_host/host_matching combination" + # Use a weakref to avoid creating a reference cycle between the app + # and the view function (see #3761). + self_ref = weakref.ref(self) + self.add_url_rule( + f"{self.static_url_path}/", + endpoint="static", + host=static_host, + view_func=lambda **kw: self_ref().send_static_file(**kw), # type: ignore # noqa: B950 + ) + + # Set the name of the Click group in case someone wants to add + # the app's commands to another CLI tool. + self.cli.name = self.name + + def _check_setup_finished(self, f_name: str) -> None: + if self._got_first_request: + raise AssertionError( + f"The setup method '{f_name}' can no longer be called" + " on the application. It has already handled its first" + " request, any changes will not be applied" + " consistently.\n" + "Make sure all imports, decorators, functions, etc." + " needed to set up the application are done before" + " running it." + ) + + @cached_property + def name(self) -> str: # type: ignore + """The name of the application. This is usually the import name + with the difference that it's guessed from the run file if the + import name is main. This name is used as a display name when + Flask needs the name of the application. It can be set and overridden + to change the value. + + .. versionadded:: 0.8 + """ + if self.import_name == "__main__": + fn = getattr(sys.modules["__main__"], "__file__", None) + if fn is None: + return "__main__" + return os.path.splitext(os.path.basename(fn))[0] + return self.import_name + + @cached_property + def logger(self) -> logging.Logger: + """A standard Python :class:`~logging.Logger` for the app, with + the same name as :attr:`name`. + + In debug mode, the logger's :attr:`~logging.Logger.level` will + be set to :data:`~logging.DEBUG`. + + If there are no handlers configured, a default handler will be + added. See :doc:`/logging` for more information. + + .. versionchanged:: 1.1.0 + The logger takes the same name as :attr:`name` rather than + hard-coding ``"flask.app"``. + + .. versionchanged:: 1.0.0 + Behavior was simplified. The logger is always named + ``"flask.app"``. The level is only set during configuration, + it doesn't check ``app.debug`` each time. Only one format is + used, not different ones depending on ``app.debug``. No + handlers are removed, and a handler is only added if no + handlers are already configured. + + .. versionadded:: 0.3 + """ + return create_logger(self) + + @cached_property + def jinja_env(self) -> Environment: + """The Jinja environment used to load templates. + + The environment is created the first time this property is + accessed. Changing :attr:`jinja_options` after that will have no + effect. + """ + return self.create_jinja_environment() + + @property + def got_first_request(self) -> bool: + """This attribute is set to ``True`` if the application started + handling the first request. + + .. deprecated:: 2.3 + Will be removed in Flask 2.4. + + .. versionadded:: 0.8 + """ + import warnings + + warnings.warn( + "'got_first_request' is deprecated and will be removed in Flask 2.4.", + DeprecationWarning, + stacklevel=2, + ) + return self._got_first_request + + def make_config(self, instance_relative: bool = False) -> Config: + """Used to create the config attribute by the Flask constructor. + The `instance_relative` parameter is passed in from the constructor + of Flask (there named `instance_relative_config`) and indicates if + the config should be relative to the instance path or the root path + of the application. + + .. versionadded:: 0.8 + """ + root_path = self.root_path + if instance_relative: + root_path = self.instance_path + defaults = dict(self.default_config) + defaults["DEBUG"] = get_debug_flag() + return self.config_class(root_path, defaults) + + def make_aborter(self) -> Aborter: + """Create the object to assign to :attr:`aborter`. That object + is called by :func:`flask.abort` to raise HTTP errors, and can + be called directly as well. + + By default, this creates an instance of :attr:`aborter_class`, + which defaults to :class:`werkzeug.exceptions.Aborter`. + + .. versionadded:: 2.2 + """ + return self.aborter_class() + + def auto_find_instance_path(self) -> str: + """Tries to locate the instance path if it was not provided to the + constructor of the application class. It will basically calculate + the path to a folder named ``instance`` next to your main file or + the package. + + .. versionadded:: 0.8 + """ + prefix, package_path = find_package(self.import_name) + if prefix is None: + return os.path.join(package_path, "instance") + return os.path.join(prefix, "var", f"{self.name}-instance") + + def open_instance_resource(self, resource: str, mode: str = "rb") -> t.IO[t.AnyStr]: + """Opens a resource from the application's instance folder + (:attr:`instance_path`). Otherwise works like + :meth:`open_resource`. Instance resources can also be opened for + writing. + + :param resource: the name of the resource. To access resources within + subfolders use forward slashes as separator. + :param mode: resource file opening mode, default is 'rb'. + """ + return open(os.path.join(self.instance_path, resource), mode) + + def create_jinja_environment(self) -> Environment: + """Create the Jinja environment based on :attr:`jinja_options` + and the various Jinja-related methods of the app. Changing + :attr:`jinja_options` after this will have no effect. Also adds + Flask-related globals and filters to the environment. + + .. versionchanged:: 0.11 + ``Environment.auto_reload`` set in accordance with + ``TEMPLATES_AUTO_RELOAD`` configuration option. + + .. versionadded:: 0.5 + """ + options = dict(self.jinja_options) + + if "autoescape" not in options: + options["autoescape"] = self.select_jinja_autoescape + + if "auto_reload" not in options: + auto_reload = self.config["TEMPLATES_AUTO_RELOAD"] + + if auto_reload is None: + auto_reload = self.debug + + options["auto_reload"] = auto_reload + + rv = self.jinja_environment(self, **options) + rv.globals.update( + url_for=self.url_for, + get_flashed_messages=get_flashed_messages, + config=self.config, + # request, session and g are normally added with the + # context processor for efficiency reasons but for imported + # templates we also want the proxies in there. + request=request, + session=session, + g=g, + ) + rv.policies["json.dumps_function"] = self.json.dumps + return rv + + def create_global_jinja_loader(self) -> DispatchingJinjaLoader: + """Creates the loader for the Jinja2 environment. Can be used to + override just the loader and keeping the rest unchanged. It's + discouraged to override this function. Instead one should override + the :meth:`jinja_loader` function instead. + + The global loader dispatches between the loaders of the application + and the individual blueprints. + + .. versionadded:: 0.7 + """ + return DispatchingJinjaLoader(self) + + def select_jinja_autoescape(self, filename: str) -> bool: + """Returns ``True`` if autoescaping should be active for the given + template name. If no template name is given, returns `True`. + + .. versionchanged:: 2.2 + Autoescaping is now enabled by default for ``.svg`` files. + + .. versionadded:: 0.5 + """ + if filename is None: + return True + return filename.endswith((".html", ".htm", ".xml", ".xhtml", ".svg")) + + def update_template_context(self, context: dict) -> None: + """Update the template context with some commonly used variables. + This injects request, session, config and g into the template + context as well as everything template context processors want + to inject. Note that the as of Flask 0.6, the original values + in the context will not be overridden if a context processor + decides to return a value with the same key. + + :param context: the context as a dictionary that is updated in place + to add extra variables. + """ + names: t.Iterable[str | None] = (None,) + + # A template may be rendered outside a request context. + if request: + names = chain(names, reversed(request.blueprints)) + + # The values passed to render_template take precedence. Keep a + # copy to re-apply after all context functions. + orig_ctx = context.copy() + + for name in names: + if name in self.template_context_processors: + for func in self.template_context_processors[name]: + context.update(func()) + + context.update(orig_ctx) + + def make_shell_context(self) -> dict: + """Returns the shell context for an interactive shell for this + application. This runs all the registered shell context + processors. + + .. versionadded:: 0.11 + """ + rv = {"app": self, "g": g} + for processor in self.shell_context_processors: + rv.update(processor()) + return rv + + @property + def debug(self) -> bool: + """Whether debug mode is enabled. When using ``flask run`` to start the + development server, an interactive debugger will be shown for unhandled + exceptions, and the server will be reloaded when code changes. This maps to the + :data:`DEBUG` config key. It may not behave as expected if set late. + + **Do not enable debug mode when deploying in production.** + + Default: ``False`` + """ + return self.config["DEBUG"] + + @debug.setter + def debug(self, value: bool) -> None: + self.config["DEBUG"] = value + + if self.config["TEMPLATES_AUTO_RELOAD"] is None: + self.jinja_env.auto_reload = value + + def run( + self, + host: str | None = None, + port: int | None = None, + debug: bool | None = None, + load_dotenv: bool = True, + **options: t.Any, + ) -> None: + """Runs the application on a local development server. + + Do not use ``run()`` in a production setting. It is not intended to + meet security and performance requirements for a production server. + Instead, see :doc:`/deploying/index` for WSGI server recommendations. + + If the :attr:`debug` flag is set the server will automatically reload + for code changes and show a debugger in case an exception happened. + + If you want to run the application in debug mode, but disable the + code execution on the interactive debugger, you can pass + ``use_evalex=False`` as parameter. This will keep the debugger's + traceback screen active, but disable code execution. + + It is not recommended to use this function for development with + automatic reloading as this is badly supported. Instead you should + be using the :command:`flask` command line script's ``run`` support. + + .. admonition:: Keep in Mind + + Flask will suppress any server error with a generic error page + unless it is in debug mode. As such to enable just the + interactive debugger without the code reloading, you have to + invoke :meth:`run` with ``debug=True`` and ``use_reloader=False``. + Setting ``use_debugger`` to ``True`` without being in debug mode + won't catch any exceptions because there won't be any to + catch. + + :param host: the hostname to listen on. Set this to ``'0.0.0.0'`` to + have the server available externally as well. Defaults to + ``'127.0.0.1'`` or the host in the ``SERVER_NAME`` config variable + if present. + :param port: the port of the webserver. Defaults to ``5000`` or the + port defined in the ``SERVER_NAME`` config variable if present. + :param debug: if given, enable or disable debug mode. See + :attr:`debug`. + :param load_dotenv: Load the nearest :file:`.env` and :file:`.flaskenv` + files to set environment variables. Will also change the working + directory to the directory containing the first file found. + :param options: the options to be forwarded to the underlying Werkzeug + server. See :func:`werkzeug.serving.run_simple` for more + information. + + .. versionchanged:: 1.0 + If installed, python-dotenv will be used to load environment + variables from :file:`.env` and :file:`.flaskenv` files. + + The :envvar:`FLASK_DEBUG` environment variable will override :attr:`debug`. + + Threaded mode is enabled by default. + + .. versionchanged:: 0.10 + The default port is now picked from the ``SERVER_NAME`` + variable. + """ + # Ignore this call so that it doesn't start another server if + # the 'flask run' command is used. + if os.environ.get("FLASK_RUN_FROM_CLI") == "true": + if not is_running_from_reloader(): + click.secho( + " * Ignoring a call to 'app.run()' that would block" + " the current 'flask' CLI command.\n" + " Only call 'app.run()' in an 'if __name__ ==" + ' "__main__"\' guard.', + fg="red", + ) + + return + + if get_load_dotenv(load_dotenv): + cli.load_dotenv() + + # if set, env var overrides existing value + if "FLASK_DEBUG" in os.environ: + self.debug = get_debug_flag() + + # debug passed to method overrides all other sources + if debug is not None: + self.debug = bool(debug) + + server_name = self.config.get("SERVER_NAME") + sn_host = sn_port = None + + if server_name: + sn_host, _, sn_port = server_name.partition(":") + + if not host: + if sn_host: + host = sn_host + else: + host = "127.0.0.1" + + if port or port == 0: + port = int(port) + elif sn_port: + port = int(sn_port) + else: + port = 5000 + + options.setdefault("use_reloader", self.debug) + options.setdefault("use_debugger", self.debug) + options.setdefault("threaded", True) + + cli.show_server_banner(self.debug, self.name) + + from werkzeug.serving import run_simple + + try: + run_simple(t.cast(str, host), port, self, **options) + finally: + # reset the first request information if the development server + # reset normally. This makes it possible to restart the server + # without reloader and that stuff from an interactive shell. + self._got_first_request = False + + def test_client(self, use_cookies: bool = True, **kwargs: t.Any) -> FlaskClient: + """Creates a test client for this application. For information + about unit testing head over to :doc:`/testing`. + + Note that if you are testing for assertions or exceptions in your + application code, you must set ``app.testing = True`` in order for the + exceptions to propagate to the test client. Otherwise, the exception + will be handled by the application (not visible to the test client) and + the only indication of an AssertionError or other exception will be a + 500 status code response to the test client. See the :attr:`testing` + attribute. For example:: + + app.testing = True + client = app.test_client() + + The test client can be used in a ``with`` block to defer the closing down + of the context until the end of the ``with`` block. This is useful if + you want to access the context locals for testing:: + + with app.test_client() as c: + rv = c.get('/?vodka=42') + assert request.args['vodka'] == '42' + + Additionally, you may pass optional keyword arguments that will then + be passed to the application's :attr:`test_client_class` constructor. + For example:: + + from flask.testing import FlaskClient + + class CustomClient(FlaskClient): + def __init__(self, *args, **kwargs): + self._authentication = kwargs.pop("authentication") + super(CustomClient,self).__init__( *args, **kwargs) + + app.test_client_class = CustomClient + client = app.test_client(authentication='Basic ....') + + See :class:`~flask.testing.FlaskClient` for more information. + + .. versionchanged:: 0.4 + added support for ``with`` block usage for the client. + + .. versionadded:: 0.7 + The `use_cookies` parameter was added as well as the ability + to override the client to be used by setting the + :attr:`test_client_class` attribute. + + .. versionchanged:: 0.11 + Added `**kwargs` to support passing additional keyword arguments to + the constructor of :attr:`test_client_class`. + """ + cls = self.test_client_class + if cls is None: + from .testing import FlaskClient as cls + return cls( # type: ignore + self, self.response_class, use_cookies=use_cookies, **kwargs + ) + + def test_cli_runner(self, **kwargs: t.Any) -> FlaskCliRunner: + """Create a CLI runner for testing CLI commands. + See :ref:`testing-cli`. + + Returns an instance of :attr:`test_cli_runner_class`, by default + :class:`~flask.testing.FlaskCliRunner`. The Flask app object is + passed as the first argument. + + .. versionadded:: 1.0 + """ + cls = self.test_cli_runner_class + + if cls is None: + from .testing import FlaskCliRunner as cls + + return cls(self, **kwargs) # type: ignore + + @setupmethod + def register_blueprint(self, blueprint: Blueprint, **options: t.Any) -> None: + """Register a :class:`~flask.Blueprint` on the application. Keyword + arguments passed to this method will override the defaults set on the + blueprint. + + Calls the blueprint's :meth:`~flask.Blueprint.register` method after + recording the blueprint in the application's :attr:`blueprints`. + + :param blueprint: The blueprint to register. + :param url_prefix: Blueprint routes will be prefixed with this. + :param subdomain: Blueprint routes will match on this subdomain. + :param url_defaults: Blueprint routes will use these default values for + view arguments. + :param options: Additional keyword arguments are passed to + :class:`~flask.blueprints.BlueprintSetupState`. They can be + accessed in :meth:`~flask.Blueprint.record` callbacks. + + .. versionchanged:: 2.0.1 + The ``name`` option can be used to change the (pre-dotted) + name the blueprint is registered with. This allows the same + blueprint to be registered multiple times with unique names + for ``url_for``. + + .. versionadded:: 0.7 + """ + blueprint.register(self, options) + + def iter_blueprints(self) -> t.ValuesView[Blueprint]: + """Iterates over all blueprints by the order they were registered. + + .. versionadded:: 0.11 + """ + return self.blueprints.values() + + @setupmethod + def add_url_rule( + self, + rule: str, + endpoint: str | None = None, + view_func: ft.RouteCallable | None = None, + provide_automatic_options: bool | None = None, + **options: t.Any, + ) -> None: + if endpoint is None: + endpoint = _endpoint_from_view_func(view_func) # type: ignore + options["endpoint"] = endpoint + methods = options.pop("methods", None) + + # if the methods are not given and the view_func object knows its + # methods we can use that instead. If neither exists, we go with + # a tuple of only ``GET`` as default. + if methods is None: + methods = getattr(view_func, "methods", None) or ("GET",) + if isinstance(methods, str): + raise TypeError( + "Allowed methods must be a list of strings, for" + ' example: @app.route(..., methods=["POST"])' + ) + methods = {item.upper() for item in methods} + + # Methods that should always be added + required_methods = set(getattr(view_func, "required_methods", ())) + + # starting with Flask 0.8 the view_func object can disable and + # force-enable the automatic options handling. + if provide_automatic_options is None: + provide_automatic_options = getattr( + view_func, "provide_automatic_options", None + ) + + if provide_automatic_options is None: + if "OPTIONS" not in methods: + provide_automatic_options = True + required_methods.add("OPTIONS") + else: + provide_automatic_options = False + + # Add the required methods now. + methods |= required_methods + + rule = self.url_rule_class(rule, methods=methods, **options) + rule.provide_automatic_options = provide_automatic_options # type: ignore + + self.url_map.add(rule) + if view_func is not None: + old_func = self.view_functions.get(endpoint) + if old_func is not None and old_func != view_func: + raise AssertionError( + "View function mapping is overwriting an existing" + f" endpoint function: {endpoint}" + ) + self.view_functions[endpoint] = view_func + + @setupmethod + def template_filter( + self, name: str | None = None + ) -> t.Callable[[T_template_filter], T_template_filter]: + """A decorator that is used to register custom template filter. + You can specify a name for the filter, otherwise the function + name will be used. Example:: + + @app.template_filter() + def reverse(s): + return s[::-1] + + :param name: the optional name of the filter, otherwise the + function name will be used. + """ + + def decorator(f: T_template_filter) -> T_template_filter: + self.add_template_filter(f, name=name) + return f + + return decorator + + @setupmethod + def add_template_filter( + self, f: ft.TemplateFilterCallable, name: str | None = None + ) -> None: + """Register a custom template filter. Works exactly like the + :meth:`template_filter` decorator. + + :param name: the optional name of the filter, otherwise the + function name will be used. + """ + self.jinja_env.filters[name or f.__name__] = f + + @setupmethod + def template_test( + self, name: str | None = None + ) -> t.Callable[[T_template_test], T_template_test]: + """A decorator that is used to register custom template test. + You can specify a name for the test, otherwise the function + name will be used. Example:: + + @app.template_test() + def is_prime(n): + if n == 2: + return True + for i in range(2, int(math.ceil(math.sqrt(n))) + 1): + if n % i == 0: + return False + return True + + .. versionadded:: 0.10 + + :param name: the optional name of the test, otherwise the + function name will be used. + """ + + def decorator(f: T_template_test) -> T_template_test: + self.add_template_test(f, name=name) + return f + + return decorator + + @setupmethod + def add_template_test( + self, f: ft.TemplateTestCallable, name: str | None = None + ) -> None: + """Register a custom template test. Works exactly like the + :meth:`template_test` decorator. + + .. versionadded:: 0.10 + + :param name: the optional name of the test, otherwise the + function name will be used. + """ + self.jinja_env.tests[name or f.__name__] = f + + @setupmethod + def template_global( + self, name: str | None = None + ) -> t.Callable[[T_template_global], T_template_global]: + """A decorator that is used to register a custom template global function. + You can specify a name for the global function, otherwise the function + name will be used. Example:: + + @app.template_global() + def double(n): + return 2 * n + + .. versionadded:: 0.10 + + :param name: the optional name of the global function, otherwise the + function name will be used. + """ + + def decorator(f: T_template_global) -> T_template_global: + self.add_template_global(f, name=name) + return f + + return decorator + + @setupmethod + def add_template_global( + self, f: ft.TemplateGlobalCallable, name: str | None = None + ) -> None: + """Register a custom template global function. Works exactly like the + :meth:`template_global` decorator. + + .. versionadded:: 0.10 + + :param name: the optional name of the global function, otherwise the + function name will be used. + """ + self.jinja_env.globals[name or f.__name__] = f + + @setupmethod + def teardown_appcontext(self, f: T_teardown) -> T_teardown: + """Registers a function to be called when the application + context is popped. The application context is typically popped + after the request context for each request, at the end of CLI + commands, or after a manually pushed context ends. + + .. code-block:: python + + with app.app_context(): + ... + + When the ``with`` block exits (or ``ctx.pop()`` is called), the + teardown functions are called just before the app context is + made inactive. Since a request context typically also manages an + application context it would also be called when you pop a + request context. + + When a teardown function was called because of an unhandled + exception it will be passed an error object. If an + :meth:`errorhandler` is registered, it will handle the exception + and the teardown will not receive it. + + Teardown functions must avoid raising exceptions. If they + execute code that might fail they must surround that code with a + ``try``/``except`` block and log any errors. + + The return values of teardown functions are ignored. + + .. versionadded:: 0.9 + """ + self.teardown_appcontext_funcs.append(f) + return f + + @setupmethod + def shell_context_processor( + self, f: T_shell_context_processor + ) -> T_shell_context_processor: + """Registers a shell context processor function. + + .. versionadded:: 0.11 + """ + self.shell_context_processors.append(f) + return f + + def _find_error_handler(self, e: Exception) -> ft.ErrorHandlerCallable | None: + """Return a registered error handler for an exception in this order: + blueprint handler for a specific code, app handler for a specific code, + blueprint handler for an exception class, app handler for an exception + class, or ``None`` if a suitable handler is not found. + """ + exc_class, code = self._get_exc_class_and_code(type(e)) + names = (*request.blueprints, None) + + for c in (code, None) if code is not None else (None,): + for name in names: + handler_map = self.error_handler_spec[name][c] + + if not handler_map: + continue + + for cls in exc_class.__mro__: + handler = handler_map.get(cls) + + if handler is not None: + return handler + return None + + def handle_http_exception( + self, e: HTTPException + ) -> HTTPException | ft.ResponseReturnValue: + """Handles an HTTP exception. By default this will invoke the + registered error handlers and fall back to returning the + exception as response. + + .. versionchanged:: 1.0.3 + ``RoutingException``, used internally for actions such as + slash redirects during routing, is not passed to error + handlers. + + .. versionchanged:: 1.0 + Exceptions are looked up by code *and* by MRO, so + ``HTTPException`` subclasses can be handled with a catch-all + handler for the base ``HTTPException``. + + .. versionadded:: 0.3 + """ + # Proxy exceptions don't have error codes. We want to always return + # those unchanged as errors + if e.code is None: + return e + + # RoutingExceptions are used internally to trigger routing + # actions, such as slash redirects raising RequestRedirect. They + # are not raised or handled in user code. + if isinstance(e, RoutingException): + return e + + handler = self._find_error_handler(e) + if handler is None: + return e + return self.ensure_sync(handler)(e) + + def trap_http_exception(self, e: Exception) -> bool: + """Checks if an HTTP exception should be trapped or not. By default + this will return ``False`` for all exceptions except for a bad request + key error if ``TRAP_BAD_REQUEST_ERRORS`` is set to ``True``. It + also returns ``True`` if ``TRAP_HTTP_EXCEPTIONS`` is set to ``True``. + + This is called for all HTTP exceptions raised by a view function. + If it returns ``True`` for any exception the error handler for this + exception is not called and it shows up as regular exception in the + traceback. This is helpful for debugging implicitly raised HTTP + exceptions. + + .. versionchanged:: 1.0 + Bad request errors are not trapped by default in debug mode. + + .. versionadded:: 0.8 + """ + if self.config["TRAP_HTTP_EXCEPTIONS"]: + return True + + trap_bad_request = self.config["TRAP_BAD_REQUEST_ERRORS"] + + # if unset, trap key errors in debug mode + if ( + trap_bad_request is None + and self.debug + and isinstance(e, BadRequestKeyError) + ): + return True + + if trap_bad_request: + return isinstance(e, BadRequest) + + return False + + def handle_user_exception( + self, e: Exception + ) -> HTTPException | ft.ResponseReturnValue: + """This method is called whenever an exception occurs that + should be handled. A special case is :class:`~werkzeug + .exceptions.HTTPException` which is forwarded to the + :meth:`handle_http_exception` method. This function will either + return a response value or reraise the exception with the same + traceback. + + .. versionchanged:: 1.0 + Key errors raised from request data like ``form`` show the + bad key in debug mode rather than a generic bad request + message. + + .. versionadded:: 0.7 + """ + if isinstance(e, BadRequestKeyError) and ( + self.debug or self.config["TRAP_BAD_REQUEST_ERRORS"] + ): + e.show_exception = True + + if isinstance(e, HTTPException) and not self.trap_http_exception(e): + return self.handle_http_exception(e) + + handler = self._find_error_handler(e) + + if handler is None: + raise + + return self.ensure_sync(handler)(e) + + def handle_exception(self, e: Exception) -> Response: + """Handle an exception that did not have an error handler + associated with it, or that was raised from an error handler. + This always causes a 500 ``InternalServerError``. + + Always sends the :data:`got_request_exception` signal. + + If :data:`PROPAGATE_EXCEPTIONS` is ``True``, such as in debug + mode, the error will be re-raised so that the debugger can + display it. Otherwise, the original exception is logged, and + an :exc:`~werkzeug.exceptions.InternalServerError` is returned. + + If an error handler is registered for ``InternalServerError`` or + ``500``, it will be used. For consistency, the handler will + always receive the ``InternalServerError``. The original + unhandled exception is available as ``e.original_exception``. + + .. versionchanged:: 1.1.0 + Always passes the ``InternalServerError`` instance to the + handler, setting ``original_exception`` to the unhandled + error. + + .. versionchanged:: 1.1.0 + ``after_request`` functions and other finalization is done + even for the default 500 response when there is no handler. + + .. versionadded:: 0.3 + """ + exc_info = sys.exc_info() + got_request_exception.send(self, _async_wrapper=self.ensure_sync, exception=e) + propagate = self.config["PROPAGATE_EXCEPTIONS"] + + if propagate is None: + propagate = self.testing or self.debug + + if propagate: + # Re-raise if called with an active exception, otherwise + # raise the passed in exception. + if exc_info[1] is e: + raise + + raise e + + self.log_exception(exc_info) + server_error: InternalServerError | ft.ResponseReturnValue + server_error = InternalServerError(original_exception=e) + handler = self._find_error_handler(server_error) + + if handler is not None: + server_error = self.ensure_sync(handler)(server_error) + + return self.finalize_request(server_error, from_error_handler=True) + + def log_exception( + self, + exc_info: (tuple[type, BaseException, TracebackType] | tuple[None, None, None]), + ) -> None: + """Logs an exception. This is called by :meth:`handle_exception` + if debugging is disabled and right before the handler is called. + The default implementation logs the exception as error on the + :attr:`logger`. + + .. versionadded:: 0.8 + """ + self.logger.error( + f"Exception on {request.path} [{request.method}]", exc_info=exc_info + ) + + def raise_routing_exception(self, request: Request) -> t.NoReturn: + """Intercept routing exceptions and possibly do something else. + + In debug mode, intercept a routing redirect and replace it with + an error if the body will be discarded. + + With modern Werkzeug this shouldn't occur, since it now uses a + 308 status which tells the browser to resend the method and + body. + + .. versionchanged:: 2.1 + Don't intercept 307 and 308 redirects. + + :meta private: + :internal: + """ + if ( + not self.debug + or not isinstance(request.routing_exception, RequestRedirect) + or request.routing_exception.code in {307, 308} + or request.method in {"GET", "HEAD", "OPTIONS"} + ): + raise request.routing_exception # type: ignore + + from .debughelpers import FormDataRoutingRedirect + + raise FormDataRoutingRedirect(request) + + def dispatch_request(self) -> ft.ResponseReturnValue: + """Does the request dispatching. Matches the URL and returns the + return value of the view or error handler. This does not have to + be a response object. In order to convert the return value to a + proper response object, call :func:`make_response`. + + .. versionchanged:: 0.7 + This no longer does the exception handling, this code was + moved to the new :meth:`full_dispatch_request`. + """ + req = request_ctx.request + if req.routing_exception is not None: + self.raise_routing_exception(req) + rule: Rule = req.url_rule # type: ignore[assignment] + # if we provide automatic options for this URL and the + # request came with the OPTIONS method, reply automatically + if ( + getattr(rule, "provide_automatic_options", False) + and req.method == "OPTIONS" + ): + return self.make_default_options_response() + # otherwise dispatch to the handler for that endpoint + view_args: dict[str, t.Any] = req.view_args # type: ignore[assignment] + return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) + + def full_dispatch_request(self) -> Response: + """Dispatches the request and on top of that performs request + pre and postprocessing as well as HTTP exception catching and + error handling. + + .. versionadded:: 0.7 + """ + self._got_first_request = True + + try: + request_started.send(self, _async_wrapper=self.ensure_sync) + rv = self.preprocess_request() + if rv is None: + rv = self.dispatch_request() + except Exception as e: + rv = self.handle_user_exception(e) + return self.finalize_request(rv) + + def finalize_request( + self, + rv: ft.ResponseReturnValue | HTTPException, + from_error_handler: bool = False, + ) -> Response: + """Given the return value from a view function this finalizes + the request by converting it into a response and invoking the + postprocessing functions. This is invoked for both normal + request dispatching as well as error handlers. + + Because this means that it might be called as a result of a + failure a special safe mode is available which can be enabled + with the `from_error_handler` flag. If enabled, failures in + response processing will be logged and otherwise ignored. + + :internal: + """ + response = self.make_response(rv) + try: + response = self.process_response(response) + request_finished.send( + self, _async_wrapper=self.ensure_sync, response=response + ) + except Exception: + if not from_error_handler: + raise + self.logger.exception( + "Request finalizing failed with an error while handling an error" + ) + return response + + def make_default_options_response(self) -> Response: + """This method is called to create the default ``OPTIONS`` response. + This can be changed through subclassing to change the default + behavior of ``OPTIONS`` responses. + + .. versionadded:: 0.7 + """ + adapter = request_ctx.url_adapter + methods = adapter.allowed_methods() # type: ignore[union-attr] + rv = self.response_class() + rv.allow.update(methods) + return rv + + def should_ignore_error(self, error: BaseException | None) -> bool: + """This is called to figure out if an error should be ignored + or not as far as the teardown system is concerned. If this + function returns ``True`` then the teardown handlers will not be + passed the error. + + .. versionadded:: 0.10 + """ + return False + + def ensure_sync(self, func: t.Callable) -> t.Callable: + """Ensure that the function is synchronous for WSGI workers. + Plain ``def`` functions are returned as-is. ``async def`` + functions are wrapped to run and wait for the response. + + Override this method to change how the app runs async views. + + .. versionadded:: 2.0 + """ + if iscoroutinefunction(func): + return self.async_to_sync(func) + + return func + + def async_to_sync( + self, func: t.Callable[..., t.Coroutine] + ) -> t.Callable[..., t.Any]: + """Return a sync function that will run the coroutine function. + + .. code-block:: python + + result = app.async_to_sync(func)(*args, **kwargs) + + Override this method to change how the app converts async code + to be synchronously callable. + + .. versionadded:: 2.0 + """ + try: + from asgiref.sync import async_to_sync as asgiref_async_to_sync + except ImportError: + raise RuntimeError( + "Install Flask with the 'async' extra in order to use async views." + ) from None + + return asgiref_async_to_sync(func) + + def url_for( + self, + endpoint: str, + *, + _anchor: str | None = None, + _method: str | None = None, + _scheme: str | None = None, + _external: bool | None = None, + **values: t.Any, + ) -> str: + """Generate a URL to the given endpoint with the given values. + + This is called by :func:`flask.url_for`, and can be called + directly as well. + + An *endpoint* is the name of a URL rule, usually added with + :meth:`@app.route() `, and usually the same name as the + view function. A route defined in a :class:`~flask.Blueprint` + will prepend the blueprint's name separated by a ``.`` to the + endpoint. + + In some cases, such as email messages, you want URLs to include + the scheme and domain, like ``https://example.com/hello``. When + not in an active request, URLs will be external by default, but + this requires setting :data:`SERVER_NAME` so Flask knows what + domain to use. :data:`APPLICATION_ROOT` and + :data:`PREFERRED_URL_SCHEME` should also be configured as + needed. This config is only used when not in an active request. + + Functions can be decorated with :meth:`url_defaults` to modify + keyword arguments before the URL is built. + + If building fails for some reason, such as an unknown endpoint + or incorrect values, the app's :meth:`handle_url_build_error` + method is called. If that returns a string, that is returned, + otherwise a :exc:`~werkzeug.routing.BuildError` is raised. + + :param endpoint: The endpoint name associated with the URL to + generate. If this starts with a ``.``, the current blueprint + name (if any) will be used. + :param _anchor: If given, append this as ``#anchor`` to the URL. + :param _method: If given, generate the URL associated with this + method for the endpoint. + :param _scheme: If given, the URL will have this scheme if it + is external. + :param _external: If given, prefer the URL to be internal + (False) or require it to be external (True). External URLs + include the scheme and domain. When not in an active + request, URLs are external by default. + :param values: Values to use for the variable parts of the URL + rule. Unknown keys are appended as query string arguments, + like ``?a=b&c=d``. + + .. versionadded:: 2.2 + Moved from ``flask.url_for``, which calls this method. + """ + req_ctx = _cv_request.get(None) + + if req_ctx is not None: + url_adapter = req_ctx.url_adapter + blueprint_name = req_ctx.request.blueprint + + # If the endpoint starts with "." and the request matches a + # blueprint, the endpoint is relative to the blueprint. + if endpoint[:1] == ".": + if blueprint_name is not None: + endpoint = f"{blueprint_name}{endpoint}" + else: + endpoint = endpoint[1:] + + # When in a request, generate a URL without scheme and + # domain by default, unless a scheme is given. + if _external is None: + _external = _scheme is not None + else: + app_ctx = _cv_app.get(None) + + # If called by helpers.url_for, an app context is active, + # use its url_adapter. Otherwise, app.url_for was called + # directly, build an adapter. + if app_ctx is not None: + url_adapter = app_ctx.url_adapter + else: + url_adapter = self.create_url_adapter(None) + + if url_adapter is None: + raise RuntimeError( + "Unable to build URLs outside an active request" + " without 'SERVER_NAME' configured. Also configure" + " 'APPLICATION_ROOT' and 'PREFERRED_URL_SCHEME' as" + " needed." + ) + + # When outside a request, generate a URL with scheme and + # domain by default. + if _external is None: + _external = True + + # It is an error to set _scheme when _external=False, in order + # to avoid accidental insecure URLs. + if _scheme is not None and not _external: + raise ValueError("When specifying '_scheme', '_external' must be True.") + + self.inject_url_defaults(endpoint, values) + + try: + rv = url_adapter.build( # type: ignore[union-attr] + endpoint, + values, + method=_method, + url_scheme=_scheme, + force_external=_external, + ) + except BuildError as error: + values.update( + _anchor=_anchor, _method=_method, _scheme=_scheme, _external=_external + ) + return self.handle_url_build_error(error, endpoint, values) + + if _anchor is not None: + _anchor = _url_quote(_anchor, safe="%!#$&'()*+,/:;=?@") + rv = f"{rv}#{_anchor}" + + return rv + + def redirect(self, location: str, code: int = 302) -> BaseResponse: + """Create a redirect response object. + + This is called by :func:`flask.redirect`, and can be called + directly as well. + + :param location: The URL to redirect to. + :param code: The status code for the redirect. + + .. versionadded:: 2.2 + Moved from ``flask.redirect``, which calls this method. + """ + return _wz_redirect(location, code=code, Response=self.response_class) + + def make_response(self, rv: ft.ResponseReturnValue) -> Response: + """Convert the return value from a view function to an instance of + :attr:`response_class`. + + :param rv: the return value from the view function. The view function + must return a response. Returning ``None``, or the view ending + without returning, is not allowed. The following types are allowed + for ``view_rv``: + + ``str`` + A response object is created with the string encoded to UTF-8 + as the body. + + ``bytes`` + A response object is created with the bytes as the body. + + ``dict`` + A dictionary that will be jsonify'd before being returned. + + ``list`` + A list that will be jsonify'd before being returned. + + ``generator`` or ``iterator`` + A generator that returns ``str`` or ``bytes`` to be + streamed as the response. + + ``tuple`` + Either ``(body, status, headers)``, ``(body, status)``, or + ``(body, headers)``, where ``body`` is any of the other types + allowed here, ``status`` is a string or an integer, and + ``headers`` is a dictionary or a list of ``(key, value)`` + tuples. If ``body`` is a :attr:`response_class` instance, + ``status`` overwrites the exiting value and ``headers`` are + extended. + + :attr:`response_class` + The object is returned unchanged. + + other :class:`~werkzeug.wrappers.Response` class + The object is coerced to :attr:`response_class`. + + :func:`callable` + The function is called as a WSGI application. The result is + used to create a response object. + + .. versionchanged:: 2.2 + A generator will be converted to a streaming response. + A list will be converted to a JSON response. + + .. versionchanged:: 1.1 + A dict will be converted to a JSON response. + + .. versionchanged:: 0.9 + Previously a tuple was interpreted as the arguments for the + response object. + """ + + status = headers = None + + # unpack tuple returns + if isinstance(rv, tuple): + len_rv = len(rv) + + # a 3-tuple is unpacked directly + if len_rv == 3: + rv, status, headers = rv # type: ignore[misc] + # decide if a 2-tuple has status or headers + elif len_rv == 2: + if isinstance(rv[1], (Headers, dict, tuple, list)): + rv, headers = rv + else: + rv, status = rv # type: ignore[assignment,misc] + # other sized tuples are not allowed + else: + raise TypeError( + "The view function did not return a valid response tuple." + " The tuple must have the form (body, status, headers)," + " (body, status), or (body, headers)." + ) + + # the body must not be None + if rv is None: + raise TypeError( + f"The view function for {request.endpoint!r} did not" + " return a valid response. The function either returned" + " None or ended without a return statement." + ) + + # make sure the body is an instance of the response class + if not isinstance(rv, self.response_class): + if isinstance(rv, (str, bytes, bytearray)) or isinstance(rv, _abc_Iterator): + # let the response class set the status and headers instead of + # waiting to do it manually, so that the class can handle any + # special logic + rv = self.response_class( + rv, + status=status, + headers=headers, # type: ignore[arg-type] + ) + status = headers = None + elif isinstance(rv, (dict, list)): + rv = self.json.response(rv) + elif isinstance(rv, BaseResponse) or callable(rv): + # evaluate a WSGI callable, or coerce a different response + # class to the correct type + try: + rv = self.response_class.force_type( + rv, request.environ # type: ignore[arg-type] + ) + except TypeError as e: + raise TypeError( + f"{e}\nThe view function did not return a valid" + " response. The return type must be a string," + " dict, list, tuple with headers or status," + " Response instance, or WSGI callable, but it" + f" was a {type(rv).__name__}." + ).with_traceback(sys.exc_info()[2]) from None + else: + raise TypeError( + "The view function did not return a valid" + " response. The return type must be a string," + " dict, list, tuple with headers or status," + " Response instance, or WSGI callable, but it was a" + f" {type(rv).__name__}." + ) + + rv = t.cast(Response, rv) + # prefer the status if it was provided + if status is not None: + if isinstance(status, (str, bytes, bytearray)): + rv.status = status + else: + rv.status_code = status + + # extend existing headers with provided headers + if headers: + rv.headers.update(headers) # type: ignore[arg-type] + + return rv + + def create_url_adapter(self, request: Request | None) -> MapAdapter | None: + """Creates a URL adapter for the given request. The URL adapter + is created at a point where the request context is not yet set + up so the request is passed explicitly. + + .. versionadded:: 0.6 + + .. versionchanged:: 0.9 + This can now also be called without a request object when the + URL adapter is created for the application context. + + .. versionchanged:: 1.0 + :data:`SERVER_NAME` no longer implicitly enables subdomain + matching. Use :attr:`subdomain_matching` instead. + """ + if request is not None: + # If subdomain matching is disabled (the default), use the + # default subdomain in all cases. This should be the default + # in Werkzeug but it currently does not have that feature. + if not self.subdomain_matching: + subdomain = self.url_map.default_subdomain or None + else: + subdomain = None + + return self.url_map.bind_to_environ( + request.environ, + server_name=self.config["SERVER_NAME"], + subdomain=subdomain, + ) + # We need at the very least the server name to be set for this + # to work. + if self.config["SERVER_NAME"] is not None: + return self.url_map.bind( + self.config["SERVER_NAME"], + script_name=self.config["APPLICATION_ROOT"], + url_scheme=self.config["PREFERRED_URL_SCHEME"], + ) + + return None + + def inject_url_defaults(self, endpoint: str, values: dict) -> None: + """Injects the URL defaults for the given endpoint directly into + the values dictionary passed. This is used internally and + automatically called on URL building. + + .. versionadded:: 0.7 + """ + names: t.Iterable[str | None] = (None,) + + # url_for may be called outside a request context, parse the + # passed endpoint instead of using request.blueprints. + if "." in endpoint: + names = chain( + names, reversed(_split_blueprint_path(endpoint.rpartition(".")[0])) + ) + + for name in names: + if name in self.url_default_functions: + for func in self.url_default_functions[name]: + func(endpoint, values) + + def handle_url_build_error( + self, error: BuildError, endpoint: str, values: dict[str, t.Any] + ) -> str: + """Called by :meth:`.url_for` if a + :exc:`~werkzeug.routing.BuildError` was raised. If this returns + a value, it will be returned by ``url_for``, otherwise the error + will be re-raised. + + Each function in :attr:`url_build_error_handlers` is called with + ``error``, ``endpoint`` and ``values``. If a function returns + ``None`` or raises a ``BuildError``, it is skipped. Otherwise, + its return value is returned by ``url_for``. + + :param error: The active ``BuildError`` being handled. + :param endpoint: The endpoint being built. + :param values: The keyword arguments passed to ``url_for``. + """ + for handler in self.url_build_error_handlers: + try: + rv = handler(error, endpoint, values) + except BuildError as e: + # make error available outside except block + error = e + else: + if rv is not None: + return rv + + # Re-raise if called with an active exception, otherwise raise + # the passed in exception. + if error is sys.exc_info()[1]: + raise + + raise error + + def preprocess_request(self) -> ft.ResponseReturnValue | None: + """Called before the request is dispatched. Calls + :attr:`url_value_preprocessors` registered with the app and the + current blueprint (if any). Then calls :attr:`before_request_funcs` + registered with the app and the blueprint. + + If any :meth:`before_request` handler returns a non-None value, the + value is handled as if it was the return value from the view, and + further request handling is stopped. + """ + names = (None, *reversed(request.blueprints)) + + for name in names: + if name in self.url_value_preprocessors: + for url_func in self.url_value_preprocessors[name]: + url_func(request.endpoint, request.view_args) + + for name in names: + if name in self.before_request_funcs: + for before_func in self.before_request_funcs[name]: + rv = self.ensure_sync(before_func)() + + if rv is not None: + return rv + + return None + + def process_response(self, response: Response) -> Response: + """Can be overridden in order to modify the response object + before it's sent to the WSGI server. By default this will + call all the :meth:`after_request` decorated functions. + + .. versionchanged:: 0.5 + As of Flask 0.5 the functions registered for after request + execution are called in reverse order of registration. + + :param response: a :attr:`response_class` object. + :return: a new response object or the same, has to be an + instance of :attr:`response_class`. + """ + ctx = request_ctx._get_current_object() # type: ignore[attr-defined] + + for func in ctx._after_request_functions: + response = self.ensure_sync(func)(response) + + for name in chain(request.blueprints, (None,)): + if name in self.after_request_funcs: + for func in reversed(self.after_request_funcs[name]): + response = self.ensure_sync(func)(response) + + if not self.session_interface.is_null_session(ctx.session): + self.session_interface.save_session(self, ctx.session, response) + + return response + + def do_teardown_request( + self, exc: BaseException | None = _sentinel # type: ignore + ) -> None: + """Called after the request is dispatched and the response is + returned, right before the request context is popped. + + This calls all functions decorated with + :meth:`teardown_request`, and :meth:`Blueprint.teardown_request` + if a blueprint handled the request. Finally, the + :data:`request_tearing_down` signal is sent. + + This is called by + :meth:`RequestContext.pop() `, + which may be delayed during testing to maintain access to + resources. + + :param exc: An unhandled exception raised while dispatching the + request. Detected from the current exception information if + not passed. Passed to each teardown function. + + .. versionchanged:: 0.9 + Added the ``exc`` argument. + """ + if exc is _sentinel: + exc = sys.exc_info()[1] + + for name in chain(request.blueprints, (None,)): + if name in self.teardown_request_funcs: + for func in reversed(self.teardown_request_funcs[name]): + self.ensure_sync(func)(exc) + + request_tearing_down.send(self, _async_wrapper=self.ensure_sync, exc=exc) + + def do_teardown_appcontext( + self, exc: BaseException | None = _sentinel # type: ignore + ) -> None: + """Called right before the application context is popped. + + When handling a request, the application context is popped + after the request context. See :meth:`do_teardown_request`. + + This calls all functions decorated with + :meth:`teardown_appcontext`. Then the + :data:`appcontext_tearing_down` signal is sent. + + This is called by + :meth:`AppContext.pop() `. + + .. versionadded:: 0.9 + """ + if exc is _sentinel: + exc = sys.exc_info()[1] + + for func in reversed(self.teardown_appcontext_funcs): + self.ensure_sync(func)(exc) + + appcontext_tearing_down.send(self, _async_wrapper=self.ensure_sync, exc=exc) + + def app_context(self) -> AppContext: + """Create an :class:`~flask.ctx.AppContext`. Use as a ``with`` + block to push the context, which will make :data:`current_app` + point at this application. + + An application context is automatically pushed by + :meth:`RequestContext.push() ` + when handling a request, and when running a CLI command. Use + this to manually create a context outside of these situations. + + :: + + with app.app_context(): + init_db() + + See :doc:`/appcontext`. + + .. versionadded:: 0.9 + """ + return AppContext(self) + + def request_context(self, environ: dict) -> RequestContext: + """Create a :class:`~flask.ctx.RequestContext` representing a + WSGI environment. Use a ``with`` block to push the context, + which will make :data:`request` point at this request. + + See :doc:`/reqcontext`. + + Typically you should not call this from your own code. A request + context is automatically pushed by the :meth:`wsgi_app` when + handling a request. Use :meth:`test_request_context` to create + an environment and context instead of this method. + + :param environ: a WSGI environment + """ + return RequestContext(self, environ) + + def test_request_context(self, *args: t.Any, **kwargs: t.Any) -> RequestContext: + """Create a :class:`~flask.ctx.RequestContext` for a WSGI + environment created from the given values. This is mostly useful + during testing, where you may want to run a function that uses + request data without dispatching a full request. + + See :doc:`/reqcontext`. + + Use a ``with`` block to push the context, which will make + :data:`request` point at the request for the created + environment. :: + + with app.test_request_context(...): + generate_report() + + When using the shell, it may be easier to push and pop the + context manually to avoid indentation. :: + + ctx = app.test_request_context(...) + ctx.push() + ... + ctx.pop() + + Takes the same arguments as Werkzeug's + :class:`~werkzeug.test.EnvironBuilder`, with some defaults from + the application. See the linked Werkzeug docs for most of the + available arguments. Flask-specific behavior is listed here. + + :param path: URL path being requested. + :param base_url: Base URL where the app is being served, which + ``path`` is relative to. If not given, built from + :data:`PREFERRED_URL_SCHEME`, ``subdomain``, + :data:`SERVER_NAME`, and :data:`APPLICATION_ROOT`. + :param subdomain: Subdomain name to append to + :data:`SERVER_NAME`. + :param url_scheme: Scheme to use instead of + :data:`PREFERRED_URL_SCHEME`. + :param data: The request body, either as a string or a dict of + form keys and values. + :param json: If given, this is serialized as JSON and passed as + ``data``. Also defaults ``content_type`` to + ``application/json``. + :param args: other positional arguments passed to + :class:`~werkzeug.test.EnvironBuilder`. + :param kwargs: other keyword arguments passed to + :class:`~werkzeug.test.EnvironBuilder`. + """ + from .testing import EnvironBuilder + + builder = EnvironBuilder(self, *args, **kwargs) + + try: + return self.request_context(builder.get_environ()) + finally: + builder.close() + + def wsgi_app(self, environ: dict, start_response: t.Callable) -> t.Any: + """The actual WSGI application. This is not implemented in + :meth:`__call__` so that middlewares can be applied without + losing a reference to the app object. Instead of doing this:: + + app = MyMiddleware(app) + + It's a better idea to do this instead:: + + app.wsgi_app = MyMiddleware(app.wsgi_app) + + Then you still have the original application object around and + can continue to call methods on it. + + .. versionchanged:: 0.7 + Teardown events for the request and app contexts are called + even if an unhandled error occurs. Other events may not be + called depending on when an error occurs during dispatch. + See :ref:`callbacks-and-errors`. + + :param environ: A WSGI environment. + :param start_response: A callable accepting a status code, + a list of headers, and an optional exception context to + start the response. + """ + ctx = self.request_context(environ) + error: BaseException | None = None + try: + try: + ctx.push() + response = self.full_dispatch_request() + except Exception as e: + error = e + response = self.handle_exception(e) + except: # noqa: B001 + error = sys.exc_info()[1] + raise + return response(environ, start_response) + finally: + if "werkzeug.debug.preserve_context" in environ: + environ["werkzeug.debug.preserve_context"](_cv_app.get()) + environ["werkzeug.debug.preserve_context"](_cv_request.get()) + + if error is not None and self.should_ignore_error(error): + error = None + + ctx.pop(error) + + def __call__(self, environ: dict, start_response: t.Callable) -> t.Any: + """The WSGI server calls the Flask application object as the + WSGI application. This calls :meth:`wsgi_app`, which can be + wrapped to apply middleware. + """ + return self.wsgi_app(environ, start_response) diff --git a/venv/Lib/site-packages/flask/blueprints.py b/venv/Lib/site-packages/flask/blueprints.py new file mode 100644 index 0000000000000000000000000000000000000000..0407f86fefdca40ce4487ad006a4e65bee0d1ee6 --- /dev/null +++ b/venv/Lib/site-packages/flask/blueprints.py @@ -0,0 +1,626 @@ +from __future__ import annotations + +import os +import typing as t +from collections import defaultdict +from functools import update_wrapper + +from . import typing as ft +from .scaffold import _endpoint_from_view_func +from .scaffold import _sentinel +from .scaffold import Scaffold +from .scaffold import setupmethod + +if t.TYPE_CHECKING: # pragma: no cover + from .app import Flask + +DeferredSetupFunction = t.Callable[["BlueprintSetupState"], t.Callable] +T_after_request = t.TypeVar("T_after_request", bound=ft.AfterRequestCallable) +T_before_request = t.TypeVar("T_before_request", bound=ft.BeforeRequestCallable) +T_error_handler = t.TypeVar("T_error_handler", bound=ft.ErrorHandlerCallable) +T_teardown = t.TypeVar("T_teardown", bound=ft.TeardownCallable) +T_template_context_processor = t.TypeVar( + "T_template_context_processor", bound=ft.TemplateContextProcessorCallable +) +T_template_filter = t.TypeVar("T_template_filter", bound=ft.TemplateFilterCallable) +T_template_global = t.TypeVar("T_template_global", bound=ft.TemplateGlobalCallable) +T_template_test = t.TypeVar("T_template_test", bound=ft.TemplateTestCallable) +T_url_defaults = t.TypeVar("T_url_defaults", bound=ft.URLDefaultCallable) +T_url_value_preprocessor = t.TypeVar( + "T_url_value_preprocessor", bound=ft.URLValuePreprocessorCallable +) + + +class BlueprintSetupState: + """Temporary holder object for registering a blueprint with the + application. An instance of this class is created by the + :meth:`~flask.Blueprint.make_setup_state` method and later passed + to all register callback functions. + """ + + def __init__( + self, + blueprint: Blueprint, + app: Flask, + options: t.Any, + first_registration: bool, + ) -> None: + #: a reference to the current application + self.app = app + + #: a reference to the blueprint that created this setup state. + self.blueprint = blueprint + + #: a dictionary with all options that were passed to the + #: :meth:`~flask.Flask.register_blueprint` method. + self.options = options + + #: as blueprints can be registered multiple times with the + #: application and not everything wants to be registered + #: multiple times on it, this attribute can be used to figure + #: out if the blueprint was registered in the past already. + self.first_registration = first_registration + + subdomain = self.options.get("subdomain") + if subdomain is None: + subdomain = self.blueprint.subdomain + + #: The subdomain that the blueprint should be active for, ``None`` + #: otherwise. + self.subdomain = subdomain + + url_prefix = self.options.get("url_prefix") + if url_prefix is None: + url_prefix = self.blueprint.url_prefix + #: The prefix that should be used for all URLs defined on the + #: blueprint. + self.url_prefix = url_prefix + + self.name = self.options.get("name", blueprint.name) + self.name_prefix = self.options.get("name_prefix", "") + + #: A dictionary with URL defaults that is added to each and every + #: URL that was defined with the blueprint. + self.url_defaults = dict(self.blueprint.url_values_defaults) + self.url_defaults.update(self.options.get("url_defaults", ())) + + def add_url_rule( + self, + rule: str, + endpoint: str | None = None, + view_func: t.Callable | None = None, + **options: t.Any, + ) -> None: + """A helper method to register a rule (and optionally a view function) + to the application. The endpoint is automatically prefixed with the + blueprint's name. + """ + if self.url_prefix is not None: + if rule: + rule = "/".join((self.url_prefix.rstrip("/"), rule.lstrip("/"))) + else: + rule = self.url_prefix + options.setdefault("subdomain", self.subdomain) + if endpoint is None: + endpoint = _endpoint_from_view_func(view_func) # type: ignore + defaults = self.url_defaults + if "defaults" in options: + defaults = dict(defaults, **options.pop("defaults")) + + self.app.add_url_rule( + rule, + f"{self.name_prefix}.{self.name}.{endpoint}".lstrip("."), + view_func, + defaults=defaults, + **options, + ) + + +class Blueprint(Scaffold): + """Represents a blueprint, a collection of routes and other + app-related functions that can be registered on a real application + later. + + A blueprint is an object that allows defining application functions + without requiring an application object ahead of time. It uses the + same decorators as :class:`~flask.Flask`, but defers the need for an + application by recording them for later registration. + + Decorating a function with a blueprint creates a deferred function + that is called with :class:`~flask.blueprints.BlueprintSetupState` + when the blueprint is registered on an application. + + See :doc:`/blueprints` for more information. + + :param name: The name of the blueprint. Will be prepended to each + endpoint name. + :param import_name: The name of the blueprint package, usually + ``__name__``. This helps locate the ``root_path`` for the + blueprint. + :param static_folder: A folder with static files that should be + served by the blueprint's static route. The path is relative to + the blueprint's root path. Blueprint static files are disabled + by default. + :param static_url_path: The url to serve static files from. + Defaults to ``static_folder``. If the blueprint does not have + a ``url_prefix``, the app's static route will take precedence, + and the blueprint's static files won't be accessible. + :param template_folder: A folder with templates that should be added + to the app's template search path. The path is relative to the + blueprint's root path. Blueprint templates are disabled by + default. Blueprint templates have a lower precedence than those + in the app's templates folder. + :param url_prefix: A path to prepend to all of the blueprint's URLs, + to make them distinct from the rest of the app's routes. + :param subdomain: A subdomain that blueprint routes will match on by + default. + :param url_defaults: A dict of default values that blueprint routes + will receive by default. + :param root_path: By default, the blueprint will automatically set + this based on ``import_name``. In certain situations this + automatic detection can fail, so the path can be specified + manually instead. + + .. versionchanged:: 1.1.0 + Blueprints have a ``cli`` group to register nested CLI commands. + The ``cli_group`` parameter controls the name of the group under + the ``flask`` command. + + .. versionadded:: 0.7 + """ + + _got_registered_once = False + + def __init__( + self, + name: str, + import_name: str, + static_folder: str | os.PathLike | None = None, + static_url_path: str | None = None, + template_folder: str | os.PathLike | None = None, + url_prefix: str | None = None, + subdomain: str | None = None, + url_defaults: dict | None = None, + root_path: str | None = None, + cli_group: str | None = _sentinel, # type: ignore + ): + super().__init__( + import_name=import_name, + static_folder=static_folder, + static_url_path=static_url_path, + template_folder=template_folder, + root_path=root_path, + ) + + if not name: + raise ValueError("'name' may not be empty.") + + if "." in name: + raise ValueError("'name' may not contain a dot '.' character.") + + self.name = name + self.url_prefix = url_prefix + self.subdomain = subdomain + self.deferred_functions: list[DeferredSetupFunction] = [] + + if url_defaults is None: + url_defaults = {} + + self.url_values_defaults = url_defaults + self.cli_group = cli_group + self._blueprints: list[tuple[Blueprint, dict]] = [] + + def _check_setup_finished(self, f_name: str) -> None: + if self._got_registered_once: + raise AssertionError( + f"The setup method '{f_name}' can no longer be called on the blueprint" + f" '{self.name}'. It has already been registered at least once, any" + " changes will not be applied consistently.\n" + "Make sure all imports, decorators, functions, etc. needed to set up" + " the blueprint are done before registering it." + ) + + @setupmethod + def record(self, func: t.Callable) -> None: + """Registers a function that is called when the blueprint is + registered on the application. This function is called with the + state as argument as returned by the :meth:`make_setup_state` + method. + """ + self.deferred_functions.append(func) + + @setupmethod + def record_once(self, func: t.Callable) -> None: + """Works like :meth:`record` but wraps the function in another + function that will ensure the function is only called once. If the + blueprint is registered a second time on the application, the + function passed is not called. + """ + + def wrapper(state: BlueprintSetupState) -> None: + if state.first_registration: + func(state) + + self.record(update_wrapper(wrapper, func)) + + def make_setup_state( + self, app: Flask, options: dict, first_registration: bool = False + ) -> BlueprintSetupState: + """Creates an instance of :meth:`~flask.blueprints.BlueprintSetupState` + object that is later passed to the register callback functions. + Subclasses can override this to return a subclass of the setup state. + """ + return BlueprintSetupState(self, app, options, first_registration) + + @setupmethod + def register_blueprint(self, blueprint: Blueprint, **options: t.Any) -> None: + """Register a :class:`~flask.Blueprint` on this blueprint. Keyword + arguments passed to this method will override the defaults set + on the blueprint. + + .. versionchanged:: 2.0.1 + The ``name`` option can be used to change the (pre-dotted) + name the blueprint is registered with. This allows the same + blueprint to be registered multiple times with unique names + for ``url_for``. + + .. versionadded:: 2.0 + """ + if blueprint is self: + raise ValueError("Cannot register a blueprint on itself") + self._blueprints.append((blueprint, options)) + + def register(self, app: Flask, options: dict) -> None: + """Called by :meth:`Flask.register_blueprint` to register all + views and callbacks registered on the blueprint with the + application. Creates a :class:`.BlueprintSetupState` and calls + each :meth:`record` callback with it. + + :param app: The application this blueprint is being registered + with. + :param options: Keyword arguments forwarded from + :meth:`~Flask.register_blueprint`. + + .. versionchanged:: 2.3 + Nested blueprints now correctly apply subdomains. + + .. versionchanged:: 2.1 + Registering the same blueprint with the same name multiple + times is an error. + + .. versionchanged:: 2.0.1 + Nested blueprints are registered with their dotted name. + This allows different blueprints with the same name to be + nested at different locations. + + .. versionchanged:: 2.0.1 + The ``name`` option can be used to change the (pre-dotted) + name the blueprint is registered with. This allows the same + blueprint to be registered multiple times with unique names + for ``url_for``. + """ + name_prefix = options.get("name_prefix", "") + self_name = options.get("name", self.name) + name = f"{name_prefix}.{self_name}".lstrip(".") + + if name in app.blueprints: + bp_desc = "this" if app.blueprints[name] is self else "a different" + existing_at = f" '{name}'" if self_name != name else "" + + raise ValueError( + f"The name '{self_name}' is already registered for" + f" {bp_desc} blueprint{existing_at}. Use 'name=' to" + f" provide a unique name." + ) + + first_bp_registration = not any(bp is self for bp in app.blueprints.values()) + first_name_registration = name not in app.blueprints + + app.blueprints[name] = self + self._got_registered_once = True + state = self.make_setup_state(app, options, first_bp_registration) + + if self.has_static_folder: + state.add_url_rule( + f"{self.static_url_path}/", + view_func=self.send_static_file, + endpoint="static", + ) + + # Merge blueprint data into parent. + if first_bp_registration or first_name_registration: + + def extend(bp_dict, parent_dict): + for key, values in bp_dict.items(): + key = name if key is None else f"{name}.{key}" + parent_dict[key].extend(values) + + for key, value in self.error_handler_spec.items(): + key = name if key is None else f"{name}.{key}" + value = defaultdict( + dict, + { + code: { + exc_class: func for exc_class, func in code_values.items() + } + for code, code_values in value.items() + }, + ) + app.error_handler_spec[key] = value + + for endpoint, func in self.view_functions.items(): + app.view_functions[endpoint] = func + + extend(self.before_request_funcs, app.before_request_funcs) + extend(self.after_request_funcs, app.after_request_funcs) + extend( + self.teardown_request_funcs, + app.teardown_request_funcs, + ) + extend(self.url_default_functions, app.url_default_functions) + extend(self.url_value_preprocessors, app.url_value_preprocessors) + extend(self.template_context_processors, app.template_context_processors) + + for deferred in self.deferred_functions: + deferred(state) + + cli_resolved_group = options.get("cli_group", self.cli_group) + + if self.cli.commands: + if cli_resolved_group is None: + app.cli.commands.update(self.cli.commands) + elif cli_resolved_group is _sentinel: + self.cli.name = name + app.cli.add_command(self.cli) + else: + self.cli.name = cli_resolved_group + app.cli.add_command(self.cli) + + for blueprint, bp_options in self._blueprints: + bp_options = bp_options.copy() + bp_url_prefix = bp_options.get("url_prefix") + bp_subdomain = bp_options.get("subdomain") + + if bp_subdomain is None: + bp_subdomain = blueprint.subdomain + + if state.subdomain is not None and bp_subdomain is not None: + bp_options["subdomain"] = bp_subdomain + "." + state.subdomain + elif bp_subdomain is not None: + bp_options["subdomain"] = bp_subdomain + elif state.subdomain is not None: + bp_options["subdomain"] = state.subdomain + + if bp_url_prefix is None: + bp_url_prefix = blueprint.url_prefix + + if state.url_prefix is not None and bp_url_prefix is not None: + bp_options["url_prefix"] = ( + state.url_prefix.rstrip("/") + "/" + bp_url_prefix.lstrip("/") + ) + elif bp_url_prefix is not None: + bp_options["url_prefix"] = bp_url_prefix + elif state.url_prefix is not None: + bp_options["url_prefix"] = state.url_prefix + + bp_options["name_prefix"] = name + blueprint.register(app, bp_options) + + @setupmethod + def add_url_rule( + self, + rule: str, + endpoint: str | None = None, + view_func: ft.RouteCallable | None = None, + provide_automatic_options: bool | None = None, + **options: t.Any, + ) -> None: + """Register a URL rule with the blueprint. See :meth:`.Flask.add_url_rule` for + full documentation. + + The URL rule is prefixed with the blueprint's URL prefix. The endpoint name, + used with :func:`url_for`, is prefixed with the blueprint's name. + """ + if endpoint and "." in endpoint: + raise ValueError("'endpoint' may not contain a dot '.' character.") + + if view_func and hasattr(view_func, "__name__") and "." in view_func.__name__: + raise ValueError("'view_func' name may not contain a dot '.' character.") + + self.record( + lambda s: s.add_url_rule( + rule, + endpoint, + view_func, + provide_automatic_options=provide_automatic_options, + **options, + ) + ) + + @setupmethod + def app_template_filter( + self, name: str | None = None + ) -> t.Callable[[T_template_filter], T_template_filter]: + """Register a template filter, available in any template rendered by the + application. Equivalent to :meth:`.Flask.template_filter`. + + :param name: the optional name of the filter, otherwise the + function name will be used. + """ + + def decorator(f: T_template_filter) -> T_template_filter: + self.add_app_template_filter(f, name=name) + return f + + return decorator + + @setupmethod + def add_app_template_filter( + self, f: ft.TemplateFilterCallable, name: str | None = None + ) -> None: + """Register a template filter, available in any template rendered by the + application. Works like the :meth:`app_template_filter` decorator. Equivalent to + :meth:`.Flask.add_template_filter`. + + :param name: the optional name of the filter, otherwise the + function name will be used. + """ + + def register_template(state: BlueprintSetupState) -> None: + state.app.jinja_env.filters[name or f.__name__] = f + + self.record_once(register_template) + + @setupmethod + def app_template_test( + self, name: str | None = None + ) -> t.Callable[[T_template_test], T_template_test]: + """Register a template test, available in any template rendered by the + application. Equivalent to :meth:`.Flask.template_test`. + + .. versionadded:: 0.10 + + :param name: the optional name of the test, otherwise the + function name will be used. + """ + + def decorator(f: T_template_test) -> T_template_test: + self.add_app_template_test(f, name=name) + return f + + return decorator + + @setupmethod + def add_app_template_test( + self, f: ft.TemplateTestCallable, name: str | None = None + ) -> None: + """Register a template test, available in any template rendered by the + application. Works like the :meth:`app_template_test` decorator. Equivalent to + :meth:`.Flask.add_template_test`. + + .. versionadded:: 0.10 + + :param name: the optional name of the test, otherwise the + function name will be used. + """ + + def register_template(state: BlueprintSetupState) -> None: + state.app.jinja_env.tests[name or f.__name__] = f + + self.record_once(register_template) + + @setupmethod + def app_template_global( + self, name: str | None = None + ) -> t.Callable[[T_template_global], T_template_global]: + """Register a template global, available in any template rendered by the + application. Equivalent to :meth:`.Flask.template_global`. + + .. versionadded:: 0.10 + + :param name: the optional name of the global, otherwise the + function name will be used. + """ + + def decorator(f: T_template_global) -> T_template_global: + self.add_app_template_global(f, name=name) + return f + + return decorator + + @setupmethod + def add_app_template_global( + self, f: ft.TemplateGlobalCallable, name: str | None = None + ) -> None: + """Register a template global, available in any template rendered by the + application. Works like the :meth:`app_template_global` decorator. Equivalent to + :meth:`.Flask.add_template_global`. + + .. versionadded:: 0.10 + + :param name: the optional name of the global, otherwise the + function name will be used. + """ + + def register_template(state: BlueprintSetupState) -> None: + state.app.jinja_env.globals[name or f.__name__] = f + + self.record_once(register_template) + + @setupmethod + def before_app_request(self, f: T_before_request) -> T_before_request: + """Like :meth:`before_request`, but before every request, not only those handled + by the blueprint. Equivalent to :meth:`.Flask.before_request`. + """ + self.record_once( + lambda s: s.app.before_request_funcs.setdefault(None, []).append(f) + ) + return f + + @setupmethod + def after_app_request(self, f: T_after_request) -> T_after_request: + """Like :meth:`after_request`, but after every request, not only those handled + by the blueprint. Equivalent to :meth:`.Flask.after_request`. + """ + self.record_once( + lambda s: s.app.after_request_funcs.setdefault(None, []).append(f) + ) + return f + + @setupmethod + def teardown_app_request(self, f: T_teardown) -> T_teardown: + """Like :meth:`teardown_request`, but after every request, not only those + handled by the blueprint. Equivalent to :meth:`.Flask.teardown_request`. + """ + self.record_once( + lambda s: s.app.teardown_request_funcs.setdefault(None, []).append(f) + ) + return f + + @setupmethod + def app_context_processor( + self, f: T_template_context_processor + ) -> T_template_context_processor: + """Like :meth:`context_processor`, but for templates rendered by every view, not + only by the blueprint. Equivalent to :meth:`.Flask.context_processor`. + """ + self.record_once( + lambda s: s.app.template_context_processors.setdefault(None, []).append(f) + ) + return f + + @setupmethod + def app_errorhandler( + self, code: type[Exception] | int + ) -> t.Callable[[T_error_handler], T_error_handler]: + """Like :meth:`errorhandler`, but for every request, not only those handled by + the blueprint. Equivalent to :meth:`.Flask.errorhandler`. + """ + + def decorator(f: T_error_handler) -> T_error_handler: + self.record_once(lambda s: s.app.errorhandler(code)(f)) + return f + + return decorator + + @setupmethod + def app_url_value_preprocessor( + self, f: T_url_value_preprocessor + ) -> T_url_value_preprocessor: + """Like :meth:`url_value_preprocessor`, but for every request, not only those + handled by the blueprint. Equivalent to :meth:`.Flask.url_value_preprocessor`. + """ + self.record_once( + lambda s: s.app.url_value_preprocessors.setdefault(None, []).append(f) + ) + return f + + @setupmethod + def app_url_defaults(self, f: T_url_defaults) -> T_url_defaults: + """Like :meth:`url_defaults`, but for every request, not only those handled by + the blueprint. Equivalent to :meth:`.Flask.url_defaults`. + """ + self.record_once( + lambda s: s.app.url_default_functions.setdefault(None, []).append(f) + ) + return f diff --git a/venv/Lib/site-packages/flask/cli.py b/venv/Lib/site-packages/flask/cli.py new file mode 100644 index 0000000000000000000000000000000000000000..dda266b30ca810c1db50e429e9357845b9a9962d --- /dev/null +++ b/venv/Lib/site-packages/flask/cli.py @@ -0,0 +1,1068 @@ +from __future__ import annotations + +import ast +import importlib.metadata +import inspect +import os +import platform +import re +import sys +import traceback +import typing as t +from functools import update_wrapper +from operator import itemgetter + +import click +from click.core import ParameterSource +from werkzeug import run_simple +from werkzeug.serving import is_running_from_reloader +from werkzeug.utils import import_string + +from .globals import current_app +from .helpers import get_debug_flag +from .helpers import get_load_dotenv + +if t.TYPE_CHECKING: + from .app import Flask + + +class NoAppException(click.UsageError): + """Raised if an application cannot be found or loaded.""" + + +def find_best_app(module): + """Given a module instance this tries to find the best possible + application in the module or raises an exception. + """ + from . import Flask + + # Search for the most common names first. + for attr_name in ("app", "application"): + app = getattr(module, attr_name, None) + + if isinstance(app, Flask): + return app + + # Otherwise find the only object that is a Flask instance. + matches = [v for v in module.__dict__.values() if isinstance(v, Flask)] + + if len(matches) == 1: + return matches[0] + elif len(matches) > 1: + raise NoAppException( + "Detected multiple Flask applications in module" + f" '{module.__name__}'. Use '{module.__name__}:name'" + " to specify the correct one." + ) + + # Search for app factory functions. + for attr_name in ("create_app", "make_app"): + app_factory = getattr(module, attr_name, None) + + if inspect.isfunction(app_factory): + try: + app = app_factory() + + if isinstance(app, Flask): + return app + except TypeError as e: + if not _called_with_wrong_args(app_factory): + raise + + raise NoAppException( + f"Detected factory '{attr_name}' in module '{module.__name__}'," + " but could not call it without arguments. Use" + f" '{module.__name__}:{attr_name}(args)'" + " to specify arguments." + ) from e + + raise NoAppException( + "Failed to find Flask application or factory in module" + f" '{module.__name__}'. Use '{module.__name__}:name'" + " to specify one." + ) + + +def _called_with_wrong_args(f): + """Check whether calling a function raised a ``TypeError`` because + the call failed or because something in the factory raised the + error. + + :param f: The function that was called. + :return: ``True`` if the call failed. + """ + tb = sys.exc_info()[2] + + try: + while tb is not None: + if tb.tb_frame.f_code is f.__code__: + # In the function, it was called successfully. + return False + + tb = tb.tb_next + + # Didn't reach the function. + return True + finally: + # Delete tb to break a circular reference. + # https://docs.python.org/2/library/sys.html#sys.exc_info + del tb + + +def find_app_by_string(module, app_name): + """Check if the given string is a variable name or a function. Call + a function to get the app instance, or return the variable directly. + """ + from . import Flask + + # Parse app_name as a single expression to determine if it's a valid + # attribute name or function call. + try: + expr = ast.parse(app_name.strip(), mode="eval").body + except SyntaxError: + raise NoAppException( + f"Failed to parse {app_name!r} as an attribute name or function call." + ) from None + + if isinstance(expr, ast.Name): + name = expr.id + args = [] + kwargs = {} + elif isinstance(expr, ast.Call): + # Ensure the function name is an attribute name only. + if not isinstance(expr.func, ast.Name): + raise NoAppException( + f"Function reference must be a simple name: {app_name!r}." + ) + + name = expr.func.id + + # Parse the positional and keyword arguments as literals. + try: + args = [ast.literal_eval(arg) for arg in expr.args] + kwargs = {kw.arg: ast.literal_eval(kw.value) for kw in expr.keywords} + except ValueError: + # literal_eval gives cryptic error messages, show a generic + # message with the full expression instead. + raise NoAppException( + f"Failed to parse arguments as literal values: {app_name!r}." + ) from None + else: + raise NoAppException( + f"Failed to parse {app_name!r} as an attribute name or function call." + ) + + try: + attr = getattr(module, name) + except AttributeError as e: + raise NoAppException( + f"Failed to find attribute {name!r} in {module.__name__!r}." + ) from e + + # If the attribute is a function, call it with any args and kwargs + # to get the real application. + if inspect.isfunction(attr): + try: + app = attr(*args, **kwargs) + except TypeError as e: + if not _called_with_wrong_args(attr): + raise + + raise NoAppException( + f"The factory {app_name!r} in module" + f" {module.__name__!r} could not be called with the" + " specified arguments." + ) from e + else: + app = attr + + if isinstance(app, Flask): + return app + + raise NoAppException( + "A valid Flask application was not obtained from" + f" '{module.__name__}:{app_name}'." + ) + + +def prepare_import(path): + """Given a filename this will try to calculate the python path, add it + to the search path and return the actual module name that is expected. + """ + path = os.path.realpath(path) + + fname, ext = os.path.splitext(path) + if ext == ".py": + path = fname + + if os.path.basename(path) == "__init__": + path = os.path.dirname(path) + + module_name = [] + + # move up until outside package structure (no __init__.py) + while True: + path, name = os.path.split(path) + module_name.append(name) + + if not os.path.exists(os.path.join(path, "__init__.py")): + break + + if sys.path[0] != path: + sys.path.insert(0, path) + + return ".".join(module_name[::-1]) + + +def locate_app(module_name, app_name, raise_if_not_found=True): + try: + __import__(module_name) + except ImportError: + # Reraise the ImportError if it occurred within the imported module. + # Determine this by checking whether the trace has a depth > 1. + if sys.exc_info()[2].tb_next: + raise NoAppException( + f"While importing {module_name!r}, an ImportError was" + f" raised:\n\n{traceback.format_exc()}" + ) from None + elif raise_if_not_found: + raise NoAppException(f"Could not import {module_name!r}.") from None + else: + return + + module = sys.modules[module_name] + + if app_name is None: + return find_best_app(module) + else: + return find_app_by_string(module, app_name) + + +def get_version(ctx, param, value): + if not value or ctx.resilient_parsing: + return + + flask_version = importlib.metadata.version("flask") + werkzeug_version = importlib.metadata.version("werkzeug") + + click.echo( + f"Python {platform.python_version()}\n" + f"Flask {flask_version}\n" + f"Werkzeug {werkzeug_version}", + color=ctx.color, + ) + ctx.exit() + + +version_option = click.Option( + ["--version"], + help="Show the Flask version.", + expose_value=False, + callback=get_version, + is_flag=True, + is_eager=True, +) + + +class ScriptInfo: + """Helper object to deal with Flask applications. This is usually not + necessary to interface with as it's used internally in the dispatching + to click. In future versions of Flask this object will most likely play + a bigger role. Typically it's created automatically by the + :class:`FlaskGroup` but you can also manually create it and pass it + onwards as click object. + """ + + def __init__( + self, + app_import_path: str | None = None, + create_app: t.Callable[..., Flask] | None = None, + set_debug_flag: bool = True, + ) -> None: + #: Optionally the import path for the Flask application. + self.app_import_path = app_import_path + #: Optionally a function that is passed the script info to create + #: the instance of the application. + self.create_app = create_app + #: A dictionary with arbitrary data that can be associated with + #: this script info. + self.data: dict[t.Any, t.Any] = {} + self.set_debug_flag = set_debug_flag + self._loaded_app: Flask | None = None + + def load_app(self) -> Flask: + """Loads the Flask app (if not yet loaded) and returns it. Calling + this multiple times will just result in the already loaded app to + be returned. + """ + if self._loaded_app is not None: + return self._loaded_app + + if self.create_app is not None: + app = self.create_app() + else: + if self.app_import_path: + path, name = ( + re.split(r":(?![\\/])", self.app_import_path, maxsplit=1) + [None] + )[:2] + import_name = prepare_import(path) + app = locate_app(import_name, name) + else: + for path in ("wsgi.py", "app.py"): + import_name = prepare_import(path) + app = locate_app(import_name, None, raise_if_not_found=False) + + if app: + break + + if not app: + raise NoAppException( + "Could not locate a Flask application. Use the" + " 'flask --app' option, 'FLASK_APP' environment" + " variable, or a 'wsgi.py' or 'app.py' file in the" + " current directory." + ) + + if self.set_debug_flag: + # Update the app's debug flag through the descriptor so that + # other values repopulate as well. + app.debug = get_debug_flag() + + self._loaded_app = app + return app + + +pass_script_info = click.make_pass_decorator(ScriptInfo, ensure=True) + + +def with_appcontext(f): + """Wraps a callback so that it's guaranteed to be executed with the + script's application context. + + Custom commands (and their options) registered under ``app.cli`` or + ``blueprint.cli`` will always have an app context available, this + decorator is not required in that case. + + .. versionchanged:: 2.2 + The app context is active for subcommands as well as the + decorated callback. The app context is always available to + ``app.cli`` command and parameter callbacks. + """ + + @click.pass_context + def decorator(__ctx, *args, **kwargs): + if not current_app: + app = __ctx.ensure_object(ScriptInfo).load_app() + __ctx.with_resource(app.app_context()) + + return __ctx.invoke(f, *args, **kwargs) + + return update_wrapper(decorator, f) + + +class AppGroup(click.Group): + """This works similar to a regular click :class:`~click.Group` but it + changes the behavior of the :meth:`command` decorator so that it + automatically wraps the functions in :func:`with_appcontext`. + + Not to be confused with :class:`FlaskGroup`. + """ + + def command(self, *args, **kwargs): + """This works exactly like the method of the same name on a regular + :class:`click.Group` but it wraps callbacks in :func:`with_appcontext` + unless it's disabled by passing ``with_appcontext=False``. + """ + wrap_for_ctx = kwargs.pop("with_appcontext", True) + + def decorator(f): + if wrap_for_ctx: + f = with_appcontext(f) + return click.Group.command(self, *args, **kwargs)(f) + + return decorator + + def group(self, *args, **kwargs): + """This works exactly like the method of the same name on a regular + :class:`click.Group` but it defaults the group class to + :class:`AppGroup`. + """ + kwargs.setdefault("cls", AppGroup) + return click.Group.group(self, *args, **kwargs) + + +def _set_app(ctx: click.Context, param: click.Option, value: str | None) -> str | None: + if value is None: + return None + + info = ctx.ensure_object(ScriptInfo) + info.app_import_path = value + return value + + +# This option is eager so the app will be available if --help is given. +# --help is also eager, so --app must be before it in the param list. +# no_args_is_help bypasses eager processing, so this option must be +# processed manually in that case to ensure FLASK_APP gets picked up. +_app_option = click.Option( + ["-A", "--app"], + metavar="IMPORT", + help=( + "The Flask application or factory function to load, in the form 'module:name'." + " Module can be a dotted import or file path. Name is not required if it is" + " 'app', 'application', 'create_app', or 'make_app', and can be 'name(args)' to" + " pass arguments." + ), + is_eager=True, + expose_value=False, + callback=_set_app, +) + + +def _set_debug(ctx: click.Context, param: click.Option, value: bool) -> bool | None: + # If the flag isn't provided, it will default to False. Don't use + # that, let debug be set by env in that case. + source = ctx.get_parameter_source(param.name) # type: ignore[arg-type] + + if source is not None and source in ( + ParameterSource.DEFAULT, + ParameterSource.DEFAULT_MAP, + ): + return None + + # Set with env var instead of ScriptInfo.load so that it can be + # accessed early during a factory function. + os.environ["FLASK_DEBUG"] = "1" if value else "0" + return value + + +_debug_option = click.Option( + ["--debug/--no-debug"], + help="Set debug mode.", + expose_value=False, + callback=_set_debug, +) + + +def _env_file_callback( + ctx: click.Context, param: click.Option, value: str | None +) -> str | None: + if value is None: + return None + + import importlib + + try: + importlib.import_module("dotenv") + except ImportError: + raise click.BadParameter( + "python-dotenv must be installed to load an env file.", + ctx=ctx, + param=param, + ) from None + + # Don't check FLASK_SKIP_DOTENV, that only disables automatically + # loading .env and .flaskenv files. + load_dotenv(value) + return value + + +# This option is eager so env vars are loaded as early as possible to be +# used by other options. +_env_file_option = click.Option( + ["-e", "--env-file"], + type=click.Path(exists=True, dir_okay=False), + help="Load environment variables from this file. python-dotenv must be installed.", + is_eager=True, + expose_value=False, + callback=_env_file_callback, +) + + +class FlaskGroup(AppGroup): + """Special subclass of the :class:`AppGroup` group that supports + loading more commands from the configured Flask app. Normally a + developer does not have to interface with this class but there are + some very advanced use cases for which it makes sense to create an + instance of this. see :ref:`custom-scripts`. + + :param add_default_commands: if this is True then the default run and + shell commands will be added. + :param add_version_option: adds the ``--version`` option. + :param create_app: an optional callback that is passed the script info and + returns the loaded app. + :param load_dotenv: Load the nearest :file:`.env` and :file:`.flaskenv` + files to set environment variables. Will also change the working + directory to the directory containing the first file found. + :param set_debug_flag: Set the app's debug flag. + + .. versionchanged:: 2.2 + Added the ``-A/--app``, ``--debug/--no-debug``, ``-e/--env-file`` options. + + .. versionchanged:: 2.2 + An app context is pushed when running ``app.cli`` commands, so + ``@with_appcontext`` is no longer required for those commands. + + .. versionchanged:: 1.0 + If installed, python-dotenv will be used to load environment variables + from :file:`.env` and :file:`.flaskenv` files. + """ + + def __init__( + self, + add_default_commands: bool = True, + create_app: t.Callable[..., Flask] | None = None, + add_version_option: bool = True, + load_dotenv: bool = True, + set_debug_flag: bool = True, + **extra: t.Any, + ) -> None: + params = list(extra.pop("params", None) or ()) + # Processing is done with option callbacks instead of a group + # callback. This allows users to make a custom group callback + # without losing the behavior. --env-file must come first so + # that it is eagerly evaluated before --app. + params.extend((_env_file_option, _app_option, _debug_option)) + + if add_version_option: + params.append(version_option) + + if "context_settings" not in extra: + extra["context_settings"] = {} + + extra["context_settings"].setdefault("auto_envvar_prefix", "FLASK") + + super().__init__(params=params, **extra) + + self.create_app = create_app + self.load_dotenv = load_dotenv + self.set_debug_flag = set_debug_flag + + if add_default_commands: + self.add_command(run_command) + self.add_command(shell_command) + self.add_command(routes_command) + + self._loaded_plugin_commands = False + + def _load_plugin_commands(self): + if self._loaded_plugin_commands: + return + + if sys.version_info >= (3, 10): + from importlib import metadata + else: + # Use a backport on Python < 3.10. We technically have + # importlib.metadata on 3.8+, but the API changed in 3.10, + # so use the backport for consistency. + import importlib_metadata as metadata + + for ep in metadata.entry_points(group="flask.commands"): + self.add_command(ep.load(), ep.name) + + self._loaded_plugin_commands = True + + def get_command(self, ctx, name): + self._load_plugin_commands() + # Look up built-in and plugin commands, which should be + # available even if the app fails to load. + rv = super().get_command(ctx, name) + + if rv is not None: + return rv + + info = ctx.ensure_object(ScriptInfo) + + # Look up commands provided by the app, showing an error and + # continuing if the app couldn't be loaded. + try: + app = info.load_app() + except NoAppException as e: + click.secho(f"Error: {e.format_message()}\n", err=True, fg="red") + return None + + # Push an app context for the loaded app unless it is already + # active somehow. This makes the context available to parameter + # and command callbacks without needing @with_appcontext. + if not current_app or current_app._get_current_object() is not app: + ctx.with_resource(app.app_context()) + + return app.cli.get_command(ctx, name) + + def list_commands(self, ctx): + self._load_plugin_commands() + # Start with the built-in and plugin commands. + rv = set(super().list_commands(ctx)) + info = ctx.ensure_object(ScriptInfo) + + # Add commands provided by the app, showing an error and + # continuing if the app couldn't be loaded. + try: + rv.update(info.load_app().cli.list_commands(ctx)) + except NoAppException as e: + # When an app couldn't be loaded, show the error message + # without the traceback. + click.secho(f"Error: {e.format_message()}\n", err=True, fg="red") + except Exception: + # When any other errors occurred during loading, show the + # full traceback. + click.secho(f"{traceback.format_exc()}\n", err=True, fg="red") + + return sorted(rv) + + def make_context( + self, + info_name: str | None, + args: list[str], + parent: click.Context | None = None, + **extra: t.Any, + ) -> click.Context: + # Set a flag to tell app.run to become a no-op. If app.run was + # not in a __name__ == __main__ guard, it would start the server + # when importing, blocking whatever command is being called. + os.environ["FLASK_RUN_FROM_CLI"] = "true" + + # Attempt to load .env and .flask env files. The --env-file + # option can cause another file to be loaded. + if get_load_dotenv(self.load_dotenv): + load_dotenv() + + if "obj" not in extra and "obj" not in self.context_settings: + extra["obj"] = ScriptInfo( + create_app=self.create_app, set_debug_flag=self.set_debug_flag + ) + + return super().make_context(info_name, args, parent=parent, **extra) + + def parse_args(self, ctx: click.Context, args: list[str]) -> list[str]: + if not args and self.no_args_is_help: + # Attempt to load --env-file and --app early in case they + # were given as env vars. Otherwise no_args_is_help will not + # see commands from app.cli. + _env_file_option.handle_parse_result(ctx, {}, []) + _app_option.handle_parse_result(ctx, {}, []) + + return super().parse_args(ctx, args) + + +def _path_is_ancestor(path, other): + """Take ``other`` and remove the length of ``path`` from it. Then join it + to ``path``. If it is the original value, ``path`` is an ancestor of + ``other``.""" + return os.path.join(path, other[len(path) :].lstrip(os.sep)) == other + + +def load_dotenv(path: str | os.PathLike | None = None) -> bool: + """Load "dotenv" files in order of precedence to set environment variables. + + If an env var is already set it is not overwritten, so earlier files in the + list are preferred over later files. + + This is a no-op if `python-dotenv`_ is not installed. + + .. _python-dotenv: https://github.com/theskumar/python-dotenv#readme + + :param path: Load the file at this location instead of searching. + :return: ``True`` if a file was loaded. + + .. versionchanged:: 2.0 + The current directory is not changed to the location of the + loaded file. + + .. versionchanged:: 2.0 + When loading the env files, set the default encoding to UTF-8. + + .. versionchanged:: 1.1.0 + Returns ``False`` when python-dotenv is not installed, or when + the given path isn't a file. + + .. versionadded:: 1.0 + """ + try: + import dotenv + except ImportError: + if path or os.path.isfile(".env") or os.path.isfile(".flaskenv"): + click.secho( + " * Tip: There are .env or .flaskenv files present." + ' Do "pip install python-dotenv" to use them.', + fg="yellow", + err=True, + ) + + return False + + # Always return after attempting to load a given path, don't load + # the default files. + if path is not None: + if os.path.isfile(path): + return dotenv.load_dotenv(path, encoding="utf-8") + + return False + + loaded = False + + for name in (".env", ".flaskenv"): + path = dotenv.find_dotenv(name, usecwd=True) + + if not path: + continue + + dotenv.load_dotenv(path, encoding="utf-8") + loaded = True + + return loaded # True if at least one file was located and loaded. + + +def show_server_banner(debug, app_import_path): + """Show extra startup messages the first time the server is run, + ignoring the reloader. + """ + if is_running_from_reloader(): + return + + if app_import_path is not None: + click.echo(f" * Serving Flask app '{app_import_path}'") + + if debug is not None: + click.echo(f" * Debug mode: {'on' if debug else 'off'}") + + +class CertParamType(click.ParamType): + """Click option type for the ``--cert`` option. Allows either an + existing file, the string ``'adhoc'``, or an import for a + :class:`~ssl.SSLContext` object. + """ + + name = "path" + + def __init__(self): + self.path_type = click.Path(exists=True, dir_okay=False, resolve_path=True) + + def convert(self, value, param, ctx): + try: + import ssl + except ImportError: + raise click.BadParameter( + 'Using "--cert" requires Python to be compiled with SSL support.', + ctx, + param, + ) from None + + try: + return self.path_type(value, param, ctx) + except click.BadParameter: + value = click.STRING(value, param, ctx).lower() + + if value == "adhoc": + try: + import cryptography # noqa: F401 + except ImportError: + raise click.BadParameter( + "Using ad-hoc certificates requires the cryptography library.", + ctx, + param, + ) from None + + return value + + obj = import_string(value, silent=True) + + if isinstance(obj, ssl.SSLContext): + return obj + + raise + + +def _validate_key(ctx, param, value): + """The ``--key`` option must be specified when ``--cert`` is a file. + Modifies the ``cert`` param to be a ``(cert, key)`` pair if needed. + """ + cert = ctx.params.get("cert") + is_adhoc = cert == "adhoc" + + try: + import ssl + except ImportError: + is_context = False + else: + is_context = isinstance(cert, ssl.SSLContext) + + if value is not None: + if is_adhoc: + raise click.BadParameter( + 'When "--cert" is "adhoc", "--key" is not used.', ctx, param + ) + + if is_context: + raise click.BadParameter( + 'When "--cert" is an SSLContext object, "--key is not used.', ctx, param + ) + + if not cert: + raise click.BadParameter('"--cert" must also be specified.', ctx, param) + + ctx.params["cert"] = cert, value + + else: + if cert and not (is_adhoc or is_context): + raise click.BadParameter('Required when using "--cert".', ctx, param) + + return value + + +class SeparatedPathType(click.Path): + """Click option type that accepts a list of values separated by the + OS's path separator (``:``, ``;`` on Windows). Each value is + validated as a :class:`click.Path` type. + """ + + def convert(self, value, param, ctx): + items = self.split_envvar_value(value) + super_convert = super().convert + return [super_convert(item, param, ctx) for item in items] + + +@click.command("run", short_help="Run a development server.") +@click.option("--host", "-h", default="127.0.0.1", help="The interface to bind to.") +@click.option("--port", "-p", default=5000, help="The port to bind to.") +@click.option( + "--cert", + type=CertParamType(), + help="Specify a certificate file to use HTTPS.", + is_eager=True, +) +@click.option( + "--key", + type=click.Path(exists=True, dir_okay=False, resolve_path=True), + callback=_validate_key, + expose_value=False, + help="The key file to use when specifying a certificate.", +) +@click.option( + "--reload/--no-reload", + default=None, + help="Enable or disable the reloader. By default the reloader " + "is active if debug is enabled.", +) +@click.option( + "--debugger/--no-debugger", + default=None, + help="Enable or disable the debugger. By default the debugger " + "is active if debug is enabled.", +) +@click.option( + "--with-threads/--without-threads", + default=True, + help="Enable or disable multithreading.", +) +@click.option( + "--extra-files", + default=None, + type=SeparatedPathType(), + help=( + "Extra files that trigger a reload on change. Multiple paths" + f" are separated by {os.path.pathsep!r}." + ), +) +@click.option( + "--exclude-patterns", + default=None, + type=SeparatedPathType(), + help=( + "Files matching these fnmatch patterns will not trigger a reload" + " on change. Multiple patterns are separated by" + f" {os.path.pathsep!r}." + ), +) +@pass_script_info +def run_command( + info, + host, + port, + reload, + debugger, + with_threads, + cert, + extra_files, + exclude_patterns, +): + """Run a local development server. + + This server is for development purposes only. It does not provide + the stability, security, or performance of production WSGI servers. + + The reloader and debugger are enabled by default with the '--debug' + option. + """ + try: + app = info.load_app() + except Exception as e: + if is_running_from_reloader(): + # When reloading, print out the error immediately, but raise + # it later so the debugger or server can handle it. + traceback.print_exc() + err = e + + def app(environ, start_response): + raise err from None + + else: + # When not reloading, raise the error immediately so the + # command fails. + raise e from None + + debug = get_debug_flag() + + if reload is None: + reload = debug + + if debugger is None: + debugger = debug + + show_server_banner(debug, info.app_import_path) + + run_simple( + host, + port, + app, + use_reloader=reload, + use_debugger=debugger, + threaded=with_threads, + ssl_context=cert, + extra_files=extra_files, + exclude_patterns=exclude_patterns, + ) + + +run_command.params.insert(0, _debug_option) + + +@click.command("shell", short_help="Run a shell in the app context.") +@with_appcontext +def shell_command() -> None: + """Run an interactive Python shell in the context of a given + Flask application. The application will populate the default + namespace of this shell according to its configuration. + + This is useful for executing small snippets of management code + without having to manually configure the application. + """ + import code + + banner = ( + f"Python {sys.version} on {sys.platform}\n" + f"App: {current_app.import_name}\n" + f"Instance: {current_app.instance_path}" + ) + ctx: dict = {} + + # Support the regular Python interpreter startup script if someone + # is using it. + startup = os.environ.get("PYTHONSTARTUP") + if startup and os.path.isfile(startup): + with open(startup) as f: + eval(compile(f.read(), startup, "exec"), ctx) + + ctx.update(current_app.make_shell_context()) + + # Site, customize, or startup script can set a hook to call when + # entering interactive mode. The default one sets up readline with + # tab and history completion. + interactive_hook = getattr(sys, "__interactivehook__", None) + + if interactive_hook is not None: + try: + import readline + from rlcompleter import Completer + except ImportError: + pass + else: + # rlcompleter uses __main__.__dict__ by default, which is + # flask.__main__. Use the shell context instead. + readline.set_completer(Completer(ctx).complete) + + interactive_hook() + + code.interact(banner=banner, local=ctx) + + +@click.command("routes", short_help="Show the routes for the app.") +@click.option( + "--sort", + "-s", + type=click.Choice(("endpoint", "methods", "domain", "rule", "match")), + default="endpoint", + help=( + "Method to sort routes by. 'match' is the order that Flask will match routes" + " when dispatching a request." + ), +) +@click.option("--all-methods", is_flag=True, help="Show HEAD and OPTIONS methods.") +@with_appcontext +def routes_command(sort: str, all_methods: bool) -> None: + """Show all registered routes with endpoints and methods.""" + rules = list(current_app.url_map.iter_rules()) + + if not rules: + click.echo("No routes were registered.") + return + + ignored_methods = set() if all_methods else {"HEAD", "OPTIONS"} + host_matching = current_app.url_map.host_matching + has_domain = any(rule.host if host_matching else rule.subdomain for rule in rules) + rows = [] + + for rule in rules: + row = [ + rule.endpoint, + ", ".join(sorted((rule.methods or set()) - ignored_methods)), + ] + + if has_domain: + row.append((rule.host if host_matching else rule.subdomain) or "") + + row.append(rule.rule) + rows.append(row) + + headers = ["Endpoint", "Methods"] + sorts = ["endpoint", "methods"] + + if has_domain: + headers.append("Host" if host_matching else "Subdomain") + sorts.append("domain") + + headers.append("Rule") + sorts.append("rule") + + try: + rows.sort(key=itemgetter(sorts.index(sort))) + except ValueError: + pass + + rows.insert(0, headers) + widths = [max(len(row[i]) for row in rows) for i in range(len(headers))] + rows.insert(1, ["-" * w for w in widths]) + template = " ".join(f"{{{i}:<{w}}}" for i, w in enumerate(widths)) + + for row in rows: + click.echo(template.format(*row)) + + +cli = FlaskGroup( + name="flask", + help="""\ +A general utility script for Flask applications. + +An application to load must be given with the '--app' option, +'FLASK_APP' environment variable, or with a 'wsgi.py' or 'app.py' file +in the current directory. +""", +) + + +def main() -> None: + cli.main() + + +if __name__ == "__main__": + main() diff --git a/venv/Lib/site-packages/flask/config.py b/venv/Lib/site-packages/flask/config.py new file mode 100644 index 0000000000000000000000000000000000000000..5f921b4dff57067cef833689a835c21e3454f845 --- /dev/null +++ b/venv/Lib/site-packages/flask/config.py @@ -0,0 +1,347 @@ +from __future__ import annotations + +import errno +import json +import os +import types +import typing as t + +from werkzeug.utils import import_string + + +class ConfigAttribute: + """Makes an attribute forward to the config""" + + def __init__(self, name: str, get_converter: t.Callable | None = None) -> None: + self.__name__ = name + self.get_converter = get_converter + + def __get__(self, obj: t.Any, owner: t.Any = None) -> t.Any: + if obj is None: + return self + rv = obj.config[self.__name__] + if self.get_converter is not None: + rv = self.get_converter(rv) + return rv + + def __set__(self, obj: t.Any, value: t.Any) -> None: + obj.config[self.__name__] = value + + +class Config(dict): + """Works exactly like a dict but provides ways to fill it from files + or special dictionaries. There are two common patterns to populate the + config. + + Either you can fill the config from a config file:: + + app.config.from_pyfile('yourconfig.cfg') + + Or alternatively you can define the configuration options in the + module that calls :meth:`from_object` or provide an import path to + a module that should be loaded. It is also possible to tell it to + use the same module and with that provide the configuration values + just before the call:: + + DEBUG = True + SECRET_KEY = 'development key' + app.config.from_object(__name__) + + In both cases (loading from any Python file or loading from modules), + only uppercase keys are added to the config. This makes it possible to use + lowercase values in the config file for temporary values that are not added + to the config or to define the config keys in the same file that implements + the application. + + Probably the most interesting way to load configurations is from an + environment variable pointing to a file:: + + app.config.from_envvar('YOURAPPLICATION_SETTINGS') + + In this case before launching the application you have to set this + environment variable to the file you want to use. On Linux and OS X + use the export statement:: + + export YOURAPPLICATION_SETTINGS='/path/to/config/file' + + On windows use `set` instead. + + :param root_path: path to which files are read relative from. When the + config object is created by the application, this is + the application's :attr:`~flask.Flask.root_path`. + :param defaults: an optional dictionary of default values + """ + + def __init__( + self, root_path: str | os.PathLike, defaults: dict | None = None + ) -> None: + super().__init__(defaults or {}) + self.root_path = root_path + + def from_envvar(self, variable_name: str, silent: bool = False) -> bool: + """Loads a configuration from an environment variable pointing to + a configuration file. This is basically just a shortcut with nicer + error messages for this line of code:: + + app.config.from_pyfile(os.environ['YOURAPPLICATION_SETTINGS']) + + :param variable_name: name of the environment variable + :param silent: set to ``True`` if you want silent failure for missing + files. + :return: ``True`` if the file was loaded successfully. + """ + rv = os.environ.get(variable_name) + if not rv: + if silent: + return False + raise RuntimeError( + f"The environment variable {variable_name!r} is not set" + " and as such configuration could not be loaded. Set" + " this variable and make it point to a configuration" + " file" + ) + return self.from_pyfile(rv, silent=silent) + + def from_prefixed_env( + self, prefix: str = "FLASK", *, loads: t.Callable[[str], t.Any] = json.loads + ) -> bool: + """Load any environment variables that start with ``FLASK_``, + dropping the prefix from the env key for the config key. Values + are passed through a loading function to attempt to convert them + to more specific types than strings. + + Keys are loaded in :func:`sorted` order. + + The default loading function attempts to parse values as any + valid JSON type, including dicts and lists. + + Specific items in nested dicts can be set by separating the + keys with double underscores (``__``). If an intermediate key + doesn't exist, it will be initialized to an empty dict. + + :param prefix: Load env vars that start with this prefix, + separated with an underscore (``_``). + :param loads: Pass each string value to this function and use + the returned value as the config value. If any error is + raised it is ignored and the value remains a string. The + default is :func:`json.loads`. + + .. versionadded:: 2.1 + """ + prefix = f"{prefix}_" + len_prefix = len(prefix) + + for key in sorted(os.environ): + if not key.startswith(prefix): + continue + + value = os.environ[key] + + try: + value = loads(value) + except Exception: + # Keep the value as a string if loading failed. + pass + + # Change to key.removeprefix(prefix) on Python >= 3.9. + key = key[len_prefix:] + + if "__" not in key: + # A non-nested key, set directly. + self[key] = value + continue + + # Traverse nested dictionaries with keys separated by "__". + current = self + *parts, tail = key.split("__") + + for part in parts: + # If an intermediate dict does not exist, create it. + if part not in current: + current[part] = {} + + current = current[part] + + current[tail] = value + + return True + + def from_pyfile(self, filename: str | os.PathLike, silent: bool = False) -> bool: + """Updates the values in the config from a Python file. This function + behaves as if the file was imported as module with the + :meth:`from_object` function. + + :param filename: the filename of the config. This can either be an + absolute filename or a filename relative to the + root path. + :param silent: set to ``True`` if you want silent failure for missing + files. + :return: ``True`` if the file was loaded successfully. + + .. versionadded:: 0.7 + `silent` parameter. + """ + filename = os.path.join(self.root_path, filename) + d = types.ModuleType("config") + d.__file__ = filename + try: + with open(filename, mode="rb") as config_file: + exec(compile(config_file.read(), filename, "exec"), d.__dict__) + except OSError as e: + if silent and e.errno in (errno.ENOENT, errno.EISDIR, errno.ENOTDIR): + return False + e.strerror = f"Unable to load configuration file ({e.strerror})" + raise + self.from_object(d) + return True + + def from_object(self, obj: object | str) -> None: + """Updates the values from the given object. An object can be of one + of the following two types: + + - a string: in this case the object with that name will be imported + - an actual object reference: that object is used directly + + Objects are usually either modules or classes. :meth:`from_object` + loads only the uppercase attributes of the module/class. A ``dict`` + object will not work with :meth:`from_object` because the keys of a + ``dict`` are not attributes of the ``dict`` class. + + Example of module-based configuration:: + + app.config.from_object('yourapplication.default_config') + from yourapplication import default_config + app.config.from_object(default_config) + + Nothing is done to the object before loading. If the object is a + class and has ``@property`` attributes, it needs to be + instantiated before being passed to this method. + + You should not use this function to load the actual configuration but + rather configuration defaults. The actual config should be loaded + with :meth:`from_pyfile` and ideally from a location not within the + package because the package might be installed system wide. + + See :ref:`config-dev-prod` for an example of class-based configuration + using :meth:`from_object`. + + :param obj: an import name or object + """ + if isinstance(obj, str): + obj = import_string(obj) + for key in dir(obj): + if key.isupper(): + self[key] = getattr(obj, key) + + def from_file( + self, + filename: str | os.PathLike, + load: t.Callable[[t.IO[t.Any]], t.Mapping], + silent: bool = False, + text: bool = True, + ) -> bool: + """Update the values in the config from a file that is loaded + using the ``load`` parameter. The loaded data is passed to the + :meth:`from_mapping` method. + + .. code-block:: python + + import json + app.config.from_file("config.json", load=json.load) + + import tomllib + app.config.from_file("config.toml", load=tomllib.load, text=False) + + :param filename: The path to the data file. This can be an + absolute path or relative to the config root path. + :param load: A callable that takes a file handle and returns a + mapping of loaded data from the file. + :type load: ``Callable[[Reader], Mapping]`` where ``Reader`` + implements a ``read`` method. + :param silent: Ignore the file if it doesn't exist. + :param text: Open the file in text or binary mode. + :return: ``True`` if the file was loaded successfully. + + .. versionchanged:: 2.3 + The ``text`` parameter was added. + + .. versionadded:: 2.0 + """ + filename = os.path.join(self.root_path, filename) + + try: + with open(filename, "r" if text else "rb") as f: + obj = load(f) + except OSError as e: + if silent and e.errno in (errno.ENOENT, errno.EISDIR): + return False + + e.strerror = f"Unable to load configuration file ({e.strerror})" + raise + + return self.from_mapping(obj) + + def from_mapping( + self, mapping: t.Mapping[str, t.Any] | None = None, **kwargs: t.Any + ) -> bool: + """Updates the config like :meth:`update` ignoring items with + non-upper keys. + + :return: Always returns ``True``. + + .. versionadded:: 0.11 + """ + mappings: dict[str, t.Any] = {} + if mapping is not None: + mappings.update(mapping) + mappings.update(kwargs) + for key, value in mappings.items(): + if key.isupper(): + self[key] = value + return True + + def get_namespace( + self, namespace: str, lowercase: bool = True, trim_namespace: bool = True + ) -> dict[str, t.Any]: + """Returns a dictionary containing a subset of configuration options + that match the specified namespace/prefix. Example usage:: + + app.config['IMAGE_STORE_TYPE'] = 'fs' + app.config['IMAGE_STORE_PATH'] = '/var/app/images' + app.config['IMAGE_STORE_BASE_URL'] = 'http://img.website.com' + image_store_config = app.config.get_namespace('IMAGE_STORE_') + + The resulting dictionary `image_store_config` would look like:: + + { + 'type': 'fs', + 'path': '/var/app/images', + 'base_url': 'http://img.website.com' + } + + This is often useful when configuration options map directly to + keyword arguments in functions or class constructors. + + :param namespace: a configuration namespace + :param lowercase: a flag indicating if the keys of the resulting + dictionary should be lowercase + :param trim_namespace: a flag indicating if the keys of the resulting + dictionary should not include the namespace + + .. versionadded:: 0.11 + """ + rv = {} + for k, v in self.items(): + if not k.startswith(namespace): + continue + if trim_namespace: + key = k[len(namespace) :] + else: + key = k + if lowercase: + key = key.lower() + rv[key] = v + return rv + + def __repr__(self) -> str: + return f"<{type(self).__name__} {dict.__repr__(self)}>" diff --git a/venv/Lib/site-packages/flask/ctx.py b/venv/Lib/site-packages/flask/ctx.py new file mode 100644 index 0000000000000000000000000000000000000000..b37e4e04a6c69254ba0f755813fccbeab9715ba4 --- /dev/null +++ b/venv/Lib/site-packages/flask/ctx.py @@ -0,0 +1,440 @@ +from __future__ import annotations + +import contextvars +import sys +import typing as t +from functools import update_wrapper +from types import TracebackType + +from werkzeug.exceptions import HTTPException + +from . import typing as ft +from .globals import _cv_app +from .globals import _cv_request +from .signals import appcontext_popped +from .signals import appcontext_pushed + +if t.TYPE_CHECKING: # pragma: no cover + from .app import Flask + from .sessions import SessionMixin + from .wrappers import Request + + +# a singleton sentinel value for parameter defaults +_sentinel = object() + + +class _AppCtxGlobals: + """A plain object. Used as a namespace for storing data during an + application context. + + Creating an app context automatically creates this object, which is + made available as the :data:`g` proxy. + + .. describe:: 'key' in g + + Check whether an attribute is present. + + .. versionadded:: 0.10 + + .. describe:: iter(g) + + Return an iterator over the attribute names. + + .. versionadded:: 0.10 + """ + + # Define attr methods to let mypy know this is a namespace object + # that has arbitrary attributes. + + def __getattr__(self, name: str) -> t.Any: + try: + return self.__dict__[name] + except KeyError: + raise AttributeError(name) from None + + def __setattr__(self, name: str, value: t.Any) -> None: + self.__dict__[name] = value + + def __delattr__(self, name: str) -> None: + try: + del self.__dict__[name] + except KeyError: + raise AttributeError(name) from None + + def get(self, name: str, default: t.Any | None = None) -> t.Any: + """Get an attribute by name, or a default value. Like + :meth:`dict.get`. + + :param name: Name of attribute to get. + :param default: Value to return if the attribute is not present. + + .. versionadded:: 0.10 + """ + return self.__dict__.get(name, default) + + def pop(self, name: str, default: t.Any = _sentinel) -> t.Any: + """Get and remove an attribute by name. Like :meth:`dict.pop`. + + :param name: Name of attribute to pop. + :param default: Value to return if the attribute is not present, + instead of raising a ``KeyError``. + + .. versionadded:: 0.11 + """ + if default is _sentinel: + return self.__dict__.pop(name) + else: + return self.__dict__.pop(name, default) + + def setdefault(self, name: str, default: t.Any = None) -> t.Any: + """Get the value of an attribute if it is present, otherwise + set and return a default value. Like :meth:`dict.setdefault`. + + :param name: Name of attribute to get. + :param default: Value to set and return if the attribute is not + present. + + .. versionadded:: 0.11 + """ + return self.__dict__.setdefault(name, default) + + def __contains__(self, item: str) -> bool: + return item in self.__dict__ + + def __iter__(self) -> t.Iterator[str]: + return iter(self.__dict__) + + def __repr__(self) -> str: + ctx = _cv_app.get(None) + if ctx is not None: + return f"" + return object.__repr__(self) + + +def after_this_request(f: ft.AfterRequestCallable) -> ft.AfterRequestCallable: + """Executes a function after this request. This is useful to modify + response objects. The function is passed the response object and has + to return the same or a new one. + + Example:: + + @app.route('/') + def index(): + @after_this_request + def add_header(response): + response.headers['X-Foo'] = 'Parachute' + return response + return 'Hello World!' + + This is more useful if a function other than the view function wants to + modify a response. For instance think of a decorator that wants to add + some headers without converting the return value into a response object. + + .. versionadded:: 0.9 + """ + ctx = _cv_request.get(None) + + if ctx is None: + raise RuntimeError( + "'after_this_request' can only be used when a request" + " context is active, such as in a view function." + ) + + ctx._after_request_functions.append(f) + return f + + +def copy_current_request_context(f: t.Callable) -> t.Callable: + """A helper function that decorates a function to retain the current + request context. This is useful when working with greenlets. The moment + the function is decorated a copy of the request context is created and + then pushed when the function is called. The current session is also + included in the copied request context. + + Example:: + + import gevent + from flask import copy_current_request_context + + @app.route('/') + def index(): + @copy_current_request_context + def do_some_work(): + # do some work here, it can access flask.request or + # flask.session like you would otherwise in the view function. + ... + gevent.spawn(do_some_work) + return 'Regular response' + + .. versionadded:: 0.10 + """ + ctx = _cv_request.get(None) + + if ctx is None: + raise RuntimeError( + "'copy_current_request_context' can only be used when a" + " request context is active, such as in a view function." + ) + + ctx = ctx.copy() + + def wrapper(*args, **kwargs): + with ctx: + return ctx.app.ensure_sync(f)(*args, **kwargs) + + return update_wrapper(wrapper, f) + + +def has_request_context() -> bool: + """If you have code that wants to test if a request context is there or + not this function can be used. For instance, you may want to take advantage + of request information if the request object is available, but fail + silently if it is unavailable. + + :: + + class User(db.Model): + + def __init__(self, username, remote_addr=None): + self.username = username + if remote_addr is None and has_request_context(): + remote_addr = request.remote_addr + self.remote_addr = remote_addr + + Alternatively you can also just test any of the context bound objects + (such as :class:`request` or :class:`g`) for truthness:: + + class User(db.Model): + + def __init__(self, username, remote_addr=None): + self.username = username + if remote_addr is None and request: + remote_addr = request.remote_addr + self.remote_addr = remote_addr + + .. versionadded:: 0.7 + """ + return _cv_request.get(None) is not None + + +def has_app_context() -> bool: + """Works like :func:`has_request_context` but for the application + context. You can also just do a boolean check on the + :data:`current_app` object instead. + + .. versionadded:: 0.9 + """ + return _cv_app.get(None) is not None + + +class AppContext: + """The app context contains application-specific information. An app + context is created and pushed at the beginning of each request if + one is not already active. An app context is also pushed when + running CLI commands. + """ + + def __init__(self, app: Flask) -> None: + self.app = app + self.url_adapter = app.create_url_adapter(None) + self.g: _AppCtxGlobals = app.app_ctx_globals_class() + self._cv_tokens: list[contextvars.Token] = [] + + def push(self) -> None: + """Binds the app context to the current context.""" + self._cv_tokens.append(_cv_app.set(self)) + appcontext_pushed.send(self.app, _async_wrapper=self.app.ensure_sync) + + def pop(self, exc: BaseException | None = _sentinel) -> None: # type: ignore + """Pops the app context.""" + try: + if len(self._cv_tokens) == 1: + if exc is _sentinel: + exc = sys.exc_info()[1] + self.app.do_teardown_appcontext(exc) + finally: + ctx = _cv_app.get() + _cv_app.reset(self._cv_tokens.pop()) + + if ctx is not self: + raise AssertionError( + f"Popped wrong app context. ({ctx!r} instead of {self!r})" + ) + + appcontext_popped.send(self.app, _async_wrapper=self.app.ensure_sync) + + def __enter__(self) -> AppContext: + self.push() + return self + + def __exit__( + self, + exc_type: type | None, + exc_value: BaseException | None, + tb: TracebackType | None, + ) -> None: + self.pop(exc_value) + + +class RequestContext: + """The request context contains per-request information. The Flask + app creates and pushes it at the beginning of the request, then pops + it at the end of the request. It will create the URL adapter and + request object for the WSGI environment provided. + + Do not attempt to use this class directly, instead use + :meth:`~flask.Flask.test_request_context` and + :meth:`~flask.Flask.request_context` to create this object. + + When the request context is popped, it will evaluate all the + functions registered on the application for teardown execution + (:meth:`~flask.Flask.teardown_request`). + + The request context is automatically popped at the end of the + request. When using the interactive debugger, the context will be + restored so ``request`` is still accessible. Similarly, the test + client can preserve the context after the request ends. However, + teardown functions may already have closed some resources such as + database connections. + """ + + def __init__( + self, + app: Flask, + environ: dict, + request: Request | None = None, + session: SessionMixin | None = None, + ) -> None: + self.app = app + if request is None: + request = app.request_class(environ) + request.json_module = app.json + self.request: Request = request + self.url_adapter = None + try: + self.url_adapter = app.create_url_adapter(self.request) + except HTTPException as e: + self.request.routing_exception = e + self.flashes: list[tuple[str, str]] | None = None + self.session: SessionMixin | None = session + # Functions that should be executed after the request on the response + # object. These will be called before the regular "after_request" + # functions. + self._after_request_functions: list[ft.AfterRequestCallable] = [] + + self._cv_tokens: list[tuple[contextvars.Token, AppContext | None]] = [] + + def copy(self) -> RequestContext: + """Creates a copy of this request context with the same request object. + This can be used to move a request context to a different greenlet. + Because the actual request object is the same this cannot be used to + move a request context to a different thread unless access to the + request object is locked. + + .. versionadded:: 0.10 + + .. versionchanged:: 1.1 + The current session object is used instead of reloading the original + data. This prevents `flask.session` pointing to an out-of-date object. + """ + return self.__class__( + self.app, + environ=self.request.environ, + request=self.request, + session=self.session, + ) + + def match_request(self) -> None: + """Can be overridden by a subclass to hook into the matching + of the request. + """ + try: + result = self.url_adapter.match(return_rule=True) # type: ignore + self.request.url_rule, self.request.view_args = result # type: ignore + except HTTPException as e: + self.request.routing_exception = e + + def push(self) -> None: + # Before we push the request context we have to ensure that there + # is an application context. + app_ctx = _cv_app.get(None) + + if app_ctx is None or app_ctx.app is not self.app: + app_ctx = self.app.app_context() + app_ctx.push() + else: + app_ctx = None + + self._cv_tokens.append((_cv_request.set(self), app_ctx)) + + # Open the session at the moment that the request context is available. + # This allows a custom open_session method to use the request context. + # Only open a new session if this is the first time the request was + # pushed, otherwise stream_with_context loses the session. + if self.session is None: + session_interface = self.app.session_interface + self.session = session_interface.open_session(self.app, self.request) + + if self.session is None: + self.session = session_interface.make_null_session(self.app) + + # Match the request URL after loading the session, so that the + # session is available in custom URL converters. + if self.url_adapter is not None: + self.match_request() + + def pop(self, exc: BaseException | None = _sentinel) -> None: # type: ignore + """Pops the request context and unbinds it by doing that. This will + also trigger the execution of functions registered by the + :meth:`~flask.Flask.teardown_request` decorator. + + .. versionchanged:: 0.9 + Added the `exc` argument. + """ + clear_request = len(self._cv_tokens) == 1 + + try: + if clear_request: + if exc is _sentinel: + exc = sys.exc_info()[1] + self.app.do_teardown_request(exc) + + request_close = getattr(self.request, "close", None) + if request_close is not None: + request_close() + finally: + ctx = _cv_request.get() + token, app_ctx = self._cv_tokens.pop() + _cv_request.reset(token) + + # get rid of circular dependencies at the end of the request + # so that we don't require the GC to be active. + if clear_request: + ctx.request.environ["werkzeug.request"] = None + + if app_ctx is not None: + app_ctx.pop(exc) + + if ctx is not self: + raise AssertionError( + f"Popped wrong request context. ({ctx!r} instead of {self!r})" + ) + + def __enter__(self) -> RequestContext: + self.push() + return self + + def __exit__( + self, + exc_type: type | None, + exc_value: BaseException | None, + tb: TracebackType | None, + ) -> None: + self.pop(exc_value) + + def __repr__(self) -> str: + return ( + f"<{type(self).__name__} {self.request.url!r}" + f" [{self.request.method}] of {self.app.name}>" + ) diff --git a/venv/Lib/site-packages/flask/debughelpers.py b/venv/Lib/site-packages/flask/debughelpers.py new file mode 100644 index 0000000000000000000000000000000000000000..6061441a89fbf984ff6414b0b597192e7bca5bbc --- /dev/null +++ b/venv/Lib/site-packages/flask/debughelpers.py @@ -0,0 +1,160 @@ +from __future__ import annotations + +import typing as t + +from .app import Flask +from .blueprints import Blueprint +from .globals import request_ctx + + +class UnexpectedUnicodeError(AssertionError, UnicodeError): + """Raised in places where we want some better error reporting for + unexpected unicode or binary data. + """ + + +class DebugFilesKeyError(KeyError, AssertionError): + """Raised from request.files during debugging. The idea is that it can + provide a better error message than just a generic KeyError/BadRequest. + """ + + def __init__(self, request, key): + form_matches = request.form.getlist(key) + buf = [ + f"You tried to access the file {key!r} in the request.files" + " dictionary but it does not exist. The mimetype for the" + f" request is {request.mimetype!r} instead of" + " 'multipart/form-data' which means that no file contents" + " were transmitted. To fix this error you should provide" + ' enctype="multipart/form-data" in your form.' + ] + if form_matches: + names = ", ".join(repr(x) for x in form_matches) + buf.append( + "\n\nThe browser instead transmitted some file names. " + f"This was submitted: {names}" + ) + self.msg = "".join(buf) + + def __str__(self): + return self.msg + + +class FormDataRoutingRedirect(AssertionError): + """This exception is raised in debug mode if a routing redirect + would cause the browser to drop the method or body. This happens + when method is not GET, HEAD or OPTIONS and the status code is not + 307 or 308. + """ + + def __init__(self, request): + exc = request.routing_exception + buf = [ + f"A request was sent to '{request.url}', but routing issued" + f" a redirect to the canonical URL '{exc.new_url}'." + ] + + if f"{request.base_url}/" == exc.new_url.partition("?")[0]: + buf.append( + " The URL was defined with a trailing slash. Flask" + " will redirect to the URL with a trailing slash if it" + " was accessed without one." + ) + + buf.append( + " Send requests to the canonical URL, or use 307 or 308 for" + " routing redirects. Otherwise, browsers will drop form" + " data.\n\n" + "This exception is only raised in debug mode." + ) + super().__init__("".join(buf)) + + +def attach_enctype_error_multidict(request): + """Patch ``request.files.__getitem__`` to raise a descriptive error + about ``enctype=multipart/form-data``. + + :param request: The request to patch. + :meta private: + """ + oldcls = request.files.__class__ + + class newcls(oldcls): + def __getitem__(self, key): + try: + return super().__getitem__(key) + except KeyError as e: + if key not in request.form: + raise + + raise DebugFilesKeyError(request, key).with_traceback( + e.__traceback__ + ) from None + + newcls.__name__ = oldcls.__name__ + newcls.__module__ = oldcls.__module__ + request.files.__class__ = newcls + + +def _dump_loader_info(loader) -> t.Generator: + yield f"class: {type(loader).__module__}.{type(loader).__name__}" + for key, value in sorted(loader.__dict__.items()): + if key.startswith("_"): + continue + if isinstance(value, (tuple, list)): + if not all(isinstance(x, str) for x in value): + continue + yield f"{key}:" + for item in value: + yield f" - {item}" + continue + elif not isinstance(value, (str, int, float, bool)): + continue + yield f"{key}: {value!r}" + + +def explain_template_loading_attempts(app: Flask, template, attempts) -> None: + """This should help developers understand what failed""" + info = [f"Locating template {template!r}:"] + total_found = 0 + blueprint = None + if request_ctx and request_ctx.request.blueprint is not None: + blueprint = request_ctx.request.blueprint + + for idx, (loader, srcobj, triple) in enumerate(attempts): + if isinstance(srcobj, Flask): + src_info = f"application {srcobj.import_name!r}" + elif isinstance(srcobj, Blueprint): + src_info = f"blueprint {srcobj.name!r} ({srcobj.import_name})" + else: + src_info = repr(srcobj) + + info.append(f"{idx + 1:5}: trying loader of {src_info}") + + for line in _dump_loader_info(loader): + info.append(f" {line}") + + if triple is None: + detail = "no match" + else: + detail = f"found ({triple[1] or ''!r})" + total_found += 1 + info.append(f" -> {detail}") + + seems_fishy = False + if total_found == 0: + info.append("Error: the template could not be found.") + seems_fishy = True + elif total_found > 1: + info.append("Warning: multiple loaders returned a match for the template.") + seems_fishy = True + + if blueprint is not None and seems_fishy: + info.append( + " The template was looked up from an endpoint that belongs" + f" to the blueprint {blueprint!r}." + ) + info.append(" Maybe you did not place a template in the right folder?") + info.append(" See https://flask.palletsprojects.com/blueprints/#templates") + + app.logger.info("\n".join(info)) diff --git a/venv/Lib/site-packages/flask/globals.py b/venv/Lib/site-packages/flask/globals.py new file mode 100644 index 0000000000000000000000000000000000000000..e9cd4acfcda8a51dda20c604678fd706709070b2 --- /dev/null +++ b/venv/Lib/site-packages/flask/globals.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +import typing as t +from contextvars import ContextVar + +from werkzeug.local import LocalProxy + +if t.TYPE_CHECKING: # pragma: no cover + from .app import Flask + from .ctx import _AppCtxGlobals + from .ctx import AppContext + from .ctx import RequestContext + from .sessions import SessionMixin + from .wrappers import Request + + +class _FakeStack: + def __init__(self, name: str, cv: ContextVar[t.Any]) -> None: + self.name = name + self.cv = cv + + @property + def top(self) -> t.Any | None: + import warnings + + warnings.warn( + f"'_{self.name}_ctx_stack' is deprecated and will be removed in Flask 2.4." + f" Use 'g' to store data, or '{self.name}_ctx' to access the current" + " context.", + DeprecationWarning, + stacklevel=2, + ) + return self.cv.get(None) + + +_no_app_msg = """\ +Working outside of application context. + +This typically means that you attempted to use functionality that needed +the current application. To solve this, set up an application context +with app.app_context(). See the documentation for more information.\ +""" +_cv_app: ContextVar[AppContext] = ContextVar("flask.app_ctx") +__app_ctx_stack = _FakeStack("app", _cv_app) +app_ctx: AppContext = LocalProxy( # type: ignore[assignment] + _cv_app, unbound_message=_no_app_msg +) +current_app: Flask = LocalProxy( # type: ignore[assignment] + _cv_app, "app", unbound_message=_no_app_msg +) +g: _AppCtxGlobals = LocalProxy( # type: ignore[assignment] + _cv_app, "g", unbound_message=_no_app_msg +) + +_no_req_msg = """\ +Working outside of request context. + +This typically means that you attempted to use functionality that needed +an active HTTP request. Consult the documentation on testing for +information about how to avoid this problem.\ +""" +_cv_request: ContextVar[RequestContext] = ContextVar("flask.request_ctx") +__request_ctx_stack = _FakeStack("request", _cv_request) +request_ctx: RequestContext = LocalProxy( # type: ignore[assignment] + _cv_request, unbound_message=_no_req_msg +) +request: Request = LocalProxy( # type: ignore[assignment] + _cv_request, "request", unbound_message=_no_req_msg +) +session: SessionMixin = LocalProxy( # type: ignore[assignment] + _cv_request, "session", unbound_message=_no_req_msg +) + + +def __getattr__(name: str) -> t.Any: + if name == "_app_ctx_stack": + import warnings + + warnings.warn( + "'_app_ctx_stack' is deprecated and will be removed in Flask 2.4.", + DeprecationWarning, + stacklevel=2, + ) + return __app_ctx_stack + + if name == "_request_ctx_stack": + import warnings + + warnings.warn( + "'_request_ctx_stack' is deprecated and will be removed in Flask 2.4.", + DeprecationWarning, + stacklevel=2, + ) + return __request_ctx_stack + + raise AttributeError(name) diff --git a/venv/Lib/site-packages/flask/helpers.py b/venv/Lib/site-packages/flask/helpers.py new file mode 100644 index 0000000000000000000000000000000000000000..284c36965b527553d55dcf058c51110483061134 --- /dev/null +++ b/venv/Lib/site-packages/flask/helpers.py @@ -0,0 +1,701 @@ +from __future__ import annotations + +import importlib.util +import os +import socket +import sys +import typing as t +import warnings +from datetime import datetime +from functools import lru_cache +from functools import update_wrapper +from threading import RLock + +import werkzeug.utils +from werkzeug.exceptions import abort as _wz_abort +from werkzeug.utils import redirect as _wz_redirect + +from .globals import _cv_request +from .globals import current_app +from .globals import request +from .globals import request_ctx +from .globals import session +from .signals import message_flashed + +if t.TYPE_CHECKING: # pragma: no cover + from werkzeug.wrappers import Response as BaseResponse + from .wrappers import Response + + +def get_debug_flag() -> bool: + """Get whether debug mode should be enabled for the app, indicated by the + :envvar:`FLASK_DEBUG` environment variable. The default is ``False``. + """ + val = os.environ.get("FLASK_DEBUG") + return bool(val and val.lower() not in {"0", "false", "no"}) + + +def get_load_dotenv(default: bool = True) -> bool: + """Get whether the user has disabled loading default dotenv files by + setting :envvar:`FLASK_SKIP_DOTENV`. The default is ``True``, load + the files. + + :param default: What to return if the env var isn't set. + """ + val = os.environ.get("FLASK_SKIP_DOTENV") + + if not val: + return default + + return val.lower() in ("0", "false", "no") + + +def stream_with_context( + generator_or_function: ( + t.Iterator[t.AnyStr] | t.Callable[..., t.Iterator[t.AnyStr]] + ) +) -> t.Iterator[t.AnyStr]: + """Request contexts disappear when the response is started on the server. + This is done for efficiency reasons and to make it less likely to encounter + memory leaks with badly written WSGI middlewares. The downside is that if + you are using streamed responses, the generator cannot access request bound + information any more. + + This function however can help you keep the context around for longer:: + + from flask import stream_with_context, request, Response + + @app.route('/stream') + def streamed_response(): + @stream_with_context + def generate(): + yield 'Hello ' + yield request.args['name'] + yield '!' + return Response(generate()) + + Alternatively it can also be used around a specific generator:: + + from flask import stream_with_context, request, Response + + @app.route('/stream') + def streamed_response(): + def generate(): + yield 'Hello ' + yield request.args['name'] + yield '!' + return Response(stream_with_context(generate())) + + .. versionadded:: 0.9 + """ + try: + gen = iter(generator_or_function) # type: ignore + except TypeError: + + def decorator(*args: t.Any, **kwargs: t.Any) -> t.Any: + gen = generator_or_function(*args, **kwargs) # type: ignore + return stream_with_context(gen) + + return update_wrapper(decorator, generator_or_function) # type: ignore + + def generator() -> t.Generator: + ctx = _cv_request.get(None) + if ctx is None: + raise RuntimeError( + "'stream_with_context' can only be used when a request" + " context is active, such as in a view function." + ) + with ctx: + # Dummy sentinel. Has to be inside the context block or we're + # not actually keeping the context around. + yield None + + # The try/finally is here so that if someone passes a WSGI level + # iterator in we're still running the cleanup logic. Generators + # don't need that because they are closed on their destruction + # automatically. + try: + yield from gen + finally: + if hasattr(gen, "close"): + gen.close() + + # The trick is to start the generator. Then the code execution runs until + # the first dummy None is yielded at which point the context was already + # pushed. This item is discarded. Then when the iteration continues the + # real generator is executed. + wrapped_g = generator() + next(wrapped_g) + return wrapped_g + + +def make_response(*args: t.Any) -> Response: + """Sometimes it is necessary to set additional headers in a view. Because + views do not have to return response objects but can return a value that + is converted into a response object by Flask itself, it becomes tricky to + add headers to it. This function can be called instead of using a return + and you will get a response object which you can use to attach headers. + + If view looked like this and you want to add a new header:: + + def index(): + return render_template('index.html', foo=42) + + You can now do something like this:: + + def index(): + response = make_response(render_template('index.html', foo=42)) + response.headers['X-Parachutes'] = 'parachutes are cool' + return response + + This function accepts the very same arguments you can return from a + view function. This for example creates a response with a 404 error + code:: + + response = make_response(render_template('not_found.html'), 404) + + The other use case of this function is to force the return value of a + view function into a response which is helpful with view + decorators:: + + response = make_response(view_function()) + response.headers['X-Parachutes'] = 'parachutes are cool' + + Internally this function does the following things: + + - if no arguments are passed, it creates a new response argument + - if one argument is passed, :meth:`flask.Flask.make_response` + is invoked with it. + - if more than one argument is passed, the arguments are passed + to the :meth:`flask.Flask.make_response` function as tuple. + + .. versionadded:: 0.6 + """ + if not args: + return current_app.response_class() + if len(args) == 1: + args = args[0] + return current_app.make_response(args) # type: ignore + + +def url_for( + endpoint: str, + *, + _anchor: str | None = None, + _method: str | None = None, + _scheme: str | None = None, + _external: bool | None = None, + **values: t.Any, +) -> str: + """Generate a URL to the given endpoint with the given values. + + This requires an active request or application context, and calls + :meth:`current_app.url_for() `. See that method + for full documentation. + + :param endpoint: The endpoint name associated with the URL to + generate. If this starts with a ``.``, the current blueprint + name (if any) will be used. + :param _anchor: If given, append this as ``#anchor`` to the URL. + :param _method: If given, generate the URL associated with this + method for the endpoint. + :param _scheme: If given, the URL will have this scheme if it is + external. + :param _external: If given, prefer the URL to be internal (False) or + require it to be external (True). External URLs include the + scheme and domain. When not in an active request, URLs are + external by default. + :param values: Values to use for the variable parts of the URL rule. + Unknown keys are appended as query string arguments, like + ``?a=b&c=d``. + + .. versionchanged:: 2.2 + Calls ``current_app.url_for``, allowing an app to override the + behavior. + + .. versionchanged:: 0.10 + The ``_scheme`` parameter was added. + + .. versionchanged:: 0.9 + The ``_anchor`` and ``_method`` parameters were added. + + .. versionchanged:: 0.9 + Calls ``app.handle_url_build_error`` on build errors. + """ + return current_app.url_for( + endpoint, + _anchor=_anchor, + _method=_method, + _scheme=_scheme, + _external=_external, + **values, + ) + + +def redirect( + location: str, code: int = 302, Response: type[BaseResponse] | None = None +) -> BaseResponse: + """Create a redirect response object. + + If :data:`~flask.current_app` is available, it will use its + :meth:`~flask.Flask.redirect` method, otherwise it will use + :func:`werkzeug.utils.redirect`. + + :param location: The URL to redirect to. + :param code: The status code for the redirect. + :param Response: The response class to use. Not used when + ``current_app`` is active, which uses ``app.response_class``. + + .. versionadded:: 2.2 + Calls ``current_app.redirect`` if available instead of always + using Werkzeug's default ``redirect``. + """ + if current_app: + return current_app.redirect(location, code=code) + + return _wz_redirect(location, code=code, Response=Response) + + +def abort(code: int | BaseResponse, *args: t.Any, **kwargs: t.Any) -> t.NoReturn: + """Raise an :exc:`~werkzeug.exceptions.HTTPException` for the given + status code. + + If :data:`~flask.current_app` is available, it will call its + :attr:`~flask.Flask.aborter` object, otherwise it will use + :func:`werkzeug.exceptions.abort`. + + :param code: The status code for the exception, which must be + registered in ``app.aborter``. + :param args: Passed to the exception. + :param kwargs: Passed to the exception. + + .. versionadded:: 2.2 + Calls ``current_app.aborter`` if available instead of always + using Werkzeug's default ``abort``. + """ + if current_app: + current_app.aborter(code, *args, **kwargs) + + _wz_abort(code, *args, **kwargs) + + +def get_template_attribute(template_name: str, attribute: str) -> t.Any: + """Loads a macro (or variable) a template exports. This can be used to + invoke a macro from within Python code. If you for example have a + template named :file:`_cider.html` with the following contents: + + .. sourcecode:: html+jinja + + {% macro hello(name) %}Hello {{ name }}!{% endmacro %} + + You can access this from Python code like this:: + + hello = get_template_attribute('_cider.html', 'hello') + return hello('World') + + .. versionadded:: 0.2 + + :param template_name: the name of the template + :param attribute: the name of the variable of macro to access + """ + return getattr(current_app.jinja_env.get_template(template_name).module, attribute) + + +def flash(message: str, category: str = "message") -> None: + """Flashes a message to the next request. In order to remove the + flashed message from the session and to display it to the user, + the template has to call :func:`get_flashed_messages`. + + .. versionchanged:: 0.3 + `category` parameter added. + + :param message: the message to be flashed. + :param category: the category for the message. The following values + are recommended: ``'message'`` for any kind of message, + ``'error'`` for errors, ``'info'`` for information + messages and ``'warning'`` for warnings. However any + kind of string can be used as category. + """ + # Original implementation: + # + # session.setdefault('_flashes', []).append((category, message)) + # + # This assumed that changes made to mutable structures in the session are + # always in sync with the session object, which is not true for session + # implementations that use external storage for keeping their keys/values. + flashes = session.get("_flashes", []) + flashes.append((category, message)) + session["_flashes"] = flashes + app = current_app._get_current_object() # type: ignore + message_flashed.send( + app, + _async_wrapper=app.ensure_sync, + message=message, + category=category, + ) + + +def get_flashed_messages( + with_categories: bool = False, category_filter: t.Iterable[str] = () +) -> list[str] | list[tuple[str, str]]: + """Pulls all flashed messages from the session and returns them. + Further calls in the same request to the function will return + the same messages. By default just the messages are returned, + but when `with_categories` is set to ``True``, the return value will + be a list of tuples in the form ``(category, message)`` instead. + + Filter the flashed messages to one or more categories by providing those + categories in `category_filter`. This allows rendering categories in + separate html blocks. The `with_categories` and `category_filter` + arguments are distinct: + + * `with_categories` controls whether categories are returned with message + text (``True`` gives a tuple, where ``False`` gives just the message text). + * `category_filter` filters the messages down to only those matching the + provided categories. + + See :doc:`/patterns/flashing` for examples. + + .. versionchanged:: 0.3 + `with_categories` parameter added. + + .. versionchanged:: 0.9 + `category_filter` parameter added. + + :param with_categories: set to ``True`` to also receive categories. + :param category_filter: filter of categories to limit return values. Only + categories in the list will be returned. + """ + flashes = request_ctx.flashes + if flashes is None: + flashes = session.pop("_flashes") if "_flashes" in session else [] + request_ctx.flashes = flashes + if category_filter: + flashes = list(filter(lambda f: f[0] in category_filter, flashes)) + if not with_categories: + return [x[1] for x in flashes] + return flashes + + +def _prepare_send_file_kwargs(**kwargs: t.Any) -> dict[str, t.Any]: + if kwargs.get("max_age") is None: + kwargs["max_age"] = current_app.get_send_file_max_age + + kwargs.update( + environ=request.environ, + use_x_sendfile=current_app.config["USE_X_SENDFILE"], + response_class=current_app.response_class, + _root_path=current_app.root_path, # type: ignore + ) + return kwargs + + +def send_file( + path_or_file: os.PathLike | str | t.BinaryIO, + mimetype: str | None = None, + as_attachment: bool = False, + download_name: str | None = None, + conditional: bool = True, + etag: bool | str = True, + last_modified: datetime | int | float | None = None, + max_age: None | (int | t.Callable[[str | None], int | None]) = None, +) -> Response: + """Send the contents of a file to the client. + + The first argument can be a file path or a file-like object. Paths + are preferred in most cases because Werkzeug can manage the file and + get extra information from the path. Passing a file-like object + requires that the file is opened in binary mode, and is mostly + useful when building a file in memory with :class:`io.BytesIO`. + + Never pass file paths provided by a user. The path is assumed to be + trusted, so a user could craft a path to access a file you didn't + intend. Use :func:`send_from_directory` to safely serve + user-requested paths from within a directory. + + If the WSGI server sets a ``file_wrapper`` in ``environ``, it is + used, otherwise Werkzeug's built-in wrapper is used. Alternatively, + if the HTTP server supports ``X-Sendfile``, configuring Flask with + ``USE_X_SENDFILE = True`` will tell the server to send the given + path, which is much more efficient than reading it in Python. + + :param path_or_file: The path to the file to send, relative to the + current working directory if a relative path is given. + Alternatively, a file-like object opened in binary mode. Make + sure the file pointer is seeked to the start of the data. + :param mimetype: The MIME type to send for the file. If not + provided, it will try to detect it from the file name. + :param as_attachment: Indicate to a browser that it should offer to + save the file instead of displaying it. + :param download_name: The default name browsers will use when saving + the file. Defaults to the passed file name. + :param conditional: Enable conditional and range responses based on + request headers. Requires passing a file path and ``environ``. + :param etag: Calculate an ETag for the file, which requires passing + a file path. Can also be a string to use instead. + :param last_modified: The last modified time to send for the file, + in seconds. If not provided, it will try to detect it from the + file path. + :param max_age: How long the client should cache the file, in + seconds. If set, ``Cache-Control`` will be ``public``, otherwise + it will be ``no-cache`` to prefer conditional caching. + + .. versionchanged:: 2.0 + ``download_name`` replaces the ``attachment_filename`` + parameter. If ``as_attachment=False``, it is passed with + ``Content-Disposition: inline`` instead. + + .. versionchanged:: 2.0 + ``max_age`` replaces the ``cache_timeout`` parameter. + ``conditional`` is enabled and ``max_age`` is not set by + default. + + .. versionchanged:: 2.0 + ``etag`` replaces the ``add_etags`` parameter. It can be a + string to use instead of generating one. + + .. versionchanged:: 2.0 + Passing a file-like object that inherits from + :class:`~io.TextIOBase` will raise a :exc:`ValueError` rather + than sending an empty file. + + .. versionadded:: 2.0 + Moved the implementation to Werkzeug. This is now a wrapper to + pass some Flask-specific arguments. + + .. versionchanged:: 1.1 + ``filename`` may be a :class:`~os.PathLike` object. + + .. versionchanged:: 1.1 + Passing a :class:`~io.BytesIO` object supports range requests. + + .. versionchanged:: 1.0.3 + Filenames are encoded with ASCII instead of Latin-1 for broader + compatibility with WSGI servers. + + .. versionchanged:: 1.0 + UTF-8 filenames as specified in :rfc:`2231` are supported. + + .. versionchanged:: 0.12 + The filename is no longer automatically inferred from file + objects. If you want to use automatic MIME and etag support, + pass a filename via ``filename_or_fp`` or + ``attachment_filename``. + + .. versionchanged:: 0.12 + ``attachment_filename`` is preferred over ``filename`` for MIME + detection. + + .. versionchanged:: 0.9 + ``cache_timeout`` defaults to + :meth:`Flask.get_send_file_max_age`. + + .. versionchanged:: 0.7 + MIME guessing and etag support for file-like objects was + deprecated because it was unreliable. Pass a filename if you are + able to, otherwise attach an etag yourself. + + .. versionchanged:: 0.5 + The ``add_etags``, ``cache_timeout`` and ``conditional`` + parameters were added. The default behavior is to add etags. + + .. versionadded:: 0.2 + """ + return werkzeug.utils.send_file( # type: ignore[return-value] + **_prepare_send_file_kwargs( + path_or_file=path_or_file, + environ=request.environ, + mimetype=mimetype, + as_attachment=as_attachment, + download_name=download_name, + conditional=conditional, + etag=etag, + last_modified=last_modified, + max_age=max_age, + ) + ) + + +def send_from_directory( + directory: os.PathLike | str, + path: os.PathLike | str, + **kwargs: t.Any, +) -> Response: + """Send a file from within a directory using :func:`send_file`. + + .. code-block:: python + + @app.route("/uploads/") + def download_file(name): + return send_from_directory( + app.config['UPLOAD_FOLDER'], name, as_attachment=True + ) + + This is a secure way to serve files from a folder, such as static + files or uploads. Uses :func:`~werkzeug.security.safe_join` to + ensure the path coming from the client is not maliciously crafted to + point outside the specified directory. + + If the final path does not point to an existing regular file, + raises a 404 :exc:`~werkzeug.exceptions.NotFound` error. + + :param directory: The directory that ``path`` must be located under, + relative to the current application's root path. + :param path: The path to the file to send, relative to + ``directory``. + :param kwargs: Arguments to pass to :func:`send_file`. + + .. versionchanged:: 2.0 + ``path`` replaces the ``filename`` parameter. + + .. versionadded:: 2.0 + Moved the implementation to Werkzeug. This is now a wrapper to + pass some Flask-specific arguments. + + .. versionadded:: 0.5 + """ + return werkzeug.utils.send_from_directory( # type: ignore[return-value] + directory, path, **_prepare_send_file_kwargs(**kwargs) + ) + + +def get_root_path(import_name: str) -> str: + """Find the root path of a package, or the path that contains a + module. If it cannot be found, returns the current working + directory. + + Not to be confused with the value returned by :func:`find_package`. + + :meta private: + """ + # Module already imported and has a file attribute. Use that first. + mod = sys.modules.get(import_name) + + if mod is not None and hasattr(mod, "__file__") and mod.__file__ is not None: + return os.path.dirname(os.path.abspath(mod.__file__)) + + # Next attempt: check the loader. + try: + spec = importlib.util.find_spec(import_name) + + if spec is None: + raise ValueError + except (ImportError, ValueError): + loader = None + else: + loader = spec.loader + + # Loader does not exist or we're referring to an unloaded main + # module or a main module without path (interactive sessions), go + # with the current working directory. + if loader is None: + return os.getcwd() + + if hasattr(loader, "get_filename"): + filepath = loader.get_filename(import_name) + else: + # Fall back to imports. + __import__(import_name) + mod = sys.modules[import_name] + filepath = getattr(mod, "__file__", None) + + # If we don't have a file path it might be because it is a + # namespace package. In this case pick the root path from the + # first module that is contained in the package. + if filepath is None: + raise RuntimeError( + "No root path can be found for the provided module" + f" {import_name!r}. This can happen because the module" + " came from an import hook that does not provide file" + " name information or because it's a namespace package." + " In this case the root path needs to be explicitly" + " provided." + ) + + # filepath is import_name.py for a module, or __init__.py for a package. + return os.path.dirname(os.path.abspath(filepath)) + + +class locked_cached_property(werkzeug.utils.cached_property): + """A :func:`property` that is only evaluated once. Like + :class:`werkzeug.utils.cached_property` except access uses a lock + for thread safety. + + .. deprecated:: 2.3 + Will be removed in Flask 2.4. Use a lock inside the decorated function if + locking is needed. + + .. versionchanged:: 2.0 + Inherits from Werkzeug's ``cached_property`` (and ``property``). + """ + + def __init__( + self, + fget: t.Callable[[t.Any], t.Any], + name: str | None = None, + doc: str | None = None, + ) -> None: + import warnings + + warnings.warn( + "'locked_cached_property' is deprecated and will be removed in Flask 2.4." + " Use a lock inside the decorated function if locking is needed.", + DeprecationWarning, + stacklevel=2, + ) + super().__init__(fget, name=name, doc=doc) + self.lock = RLock() + + def __get__(self, obj: object, type: type = None) -> t.Any: # type: ignore + if obj is None: + return self + + with self.lock: + return super().__get__(obj, type=type) + + def __set__(self, obj: object, value: t.Any) -> None: + with self.lock: + super().__set__(obj, value) + + def __delete__(self, obj: object) -> None: + with self.lock: + super().__delete__(obj) + + +def is_ip(value: str) -> bool: + """Determine if the given string is an IP address. + + :param value: value to check + :type value: str + + :return: True if string is an IP address + :rtype: bool + + .. deprecated:: 2.3 + Will be removed in Flask 2.4. + """ + warnings.warn( + "The 'is_ip' function is deprecated and will be removed in Flask 2.4.", + DeprecationWarning, + stacklevel=2, + ) + + for family in (socket.AF_INET, socket.AF_INET6): + try: + socket.inet_pton(family, value) + except OSError: + pass + else: + return True + + return False + + +@lru_cache(maxsize=None) +def _split_blueprint_path(name: str) -> list[str]: + out: list[str] = [name] + + if "." in name: + out.extend(_split_blueprint_path(name.rpartition(".")[0])) + + return out diff --git a/venv/Lib/site-packages/flask/json/__init__.py b/venv/Lib/site-packages/flask/json/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f15296fed0fbf3aa4157429aed9266b803370e3d --- /dev/null +++ b/venv/Lib/site-packages/flask/json/__init__.py @@ -0,0 +1,170 @@ +from __future__ import annotations + +import json as _json +import typing as t + +from ..globals import current_app +from .provider import _default + +if t.TYPE_CHECKING: # pragma: no cover + from ..wrappers import Response + + +def dumps(obj: t.Any, **kwargs: t.Any) -> str: + """Serialize data as JSON. + + If :data:`~flask.current_app` is available, it will use its + :meth:`app.json.dumps() ` + method, otherwise it will use :func:`json.dumps`. + + :param obj: The data to serialize. + :param kwargs: Arguments passed to the ``dumps`` implementation. + + .. versionchanged:: 2.3 + The ``app`` parameter was removed. + + .. versionchanged:: 2.2 + Calls ``current_app.json.dumps``, allowing an app to override + the behavior. + + .. versionchanged:: 2.0.2 + :class:`decimal.Decimal` is supported by converting to a string. + + .. versionchanged:: 2.0 + ``encoding`` will be removed in Flask 2.1. + + .. versionchanged:: 1.0.3 + ``app`` can be passed directly, rather than requiring an app + context for configuration. + """ + if current_app: + return current_app.json.dumps(obj, **kwargs) + + kwargs.setdefault("default", _default) + return _json.dumps(obj, **kwargs) + + +def dump(obj: t.Any, fp: t.IO[str], **kwargs: t.Any) -> None: + """Serialize data as JSON and write to a file. + + If :data:`~flask.current_app` is available, it will use its + :meth:`app.json.dump() ` + method, otherwise it will use :func:`json.dump`. + + :param obj: The data to serialize. + :param fp: A file opened for writing text. Should use the UTF-8 + encoding to be valid JSON. + :param kwargs: Arguments passed to the ``dump`` implementation. + + .. versionchanged:: 2.3 + The ``app`` parameter was removed. + + .. versionchanged:: 2.2 + Calls ``current_app.json.dump``, allowing an app to override + the behavior. + + .. versionchanged:: 2.0 + Writing to a binary file, and the ``encoding`` argument, will be + removed in Flask 2.1. + """ + if current_app: + current_app.json.dump(obj, fp, **kwargs) + else: + kwargs.setdefault("default", _default) + _json.dump(obj, fp, **kwargs) + + +def loads(s: str | bytes, **kwargs: t.Any) -> t.Any: + """Deserialize data as JSON. + + If :data:`~flask.current_app` is available, it will use its + :meth:`app.json.loads() ` + method, otherwise it will use :func:`json.loads`. + + :param s: Text or UTF-8 bytes. + :param kwargs: Arguments passed to the ``loads`` implementation. + + .. versionchanged:: 2.3 + The ``app`` parameter was removed. + + .. versionchanged:: 2.2 + Calls ``current_app.json.loads``, allowing an app to override + the behavior. + + .. versionchanged:: 2.0 + ``encoding`` will be removed in Flask 2.1. The data must be a + string or UTF-8 bytes. + + .. versionchanged:: 1.0.3 + ``app`` can be passed directly, rather than requiring an app + context for configuration. + """ + if current_app: + return current_app.json.loads(s, **kwargs) + + return _json.loads(s, **kwargs) + + +def load(fp: t.IO[t.AnyStr], **kwargs: t.Any) -> t.Any: + """Deserialize data as JSON read from a file. + + If :data:`~flask.current_app` is available, it will use its + :meth:`app.json.load() ` + method, otherwise it will use :func:`json.load`. + + :param fp: A file opened for reading text or UTF-8 bytes. + :param kwargs: Arguments passed to the ``load`` implementation. + + .. versionchanged:: 2.3 + The ``app`` parameter was removed. + + .. versionchanged:: 2.2 + Calls ``current_app.json.load``, allowing an app to override + the behavior. + + .. versionchanged:: 2.2 + The ``app`` parameter will be removed in Flask 2.3. + + .. versionchanged:: 2.0 + ``encoding`` will be removed in Flask 2.1. The file must be text + mode, or binary mode with UTF-8 bytes. + """ + if current_app: + return current_app.json.load(fp, **kwargs) + + return _json.load(fp, **kwargs) + + +def jsonify(*args: t.Any, **kwargs: t.Any) -> Response: + """Serialize the given arguments as JSON, and return a + :class:`~flask.Response` object with the ``application/json`` + mimetype. A dict or list returned from a view will be converted to a + JSON response automatically without needing to call this. + + This requires an active request or application context, and calls + :meth:`app.json.response() `. + + In debug mode, the output is formatted with indentation to make it + easier to read. This may also be controlled by the provider. + + Either positional or keyword arguments can be given, not both. + If no arguments are given, ``None`` is serialized. + + :param args: A single value to serialize, or multiple values to + treat as a list to serialize. + :param kwargs: Treat as a dict to serialize. + + .. versionchanged:: 2.2 + Calls ``current_app.json.response``, allowing an app to override + the behavior. + + .. versionchanged:: 2.0.2 + :class:`decimal.Decimal` is supported by converting to a string. + + .. versionchanged:: 0.11 + Added support for serializing top-level arrays. This was a + security risk in ancient browsers. See :ref:`security-json`. + + .. versionadded:: 0.2 + """ + return current_app.json.response(*args, **kwargs) diff --git a/venv/Lib/site-packages/flask/json/__pycache__/__init__.cpython-313.pyc b/venv/Lib/site-packages/flask/json/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5c8546f7dff85b3efa9db4fad58759518320e979 Binary files /dev/null and b/venv/Lib/site-packages/flask/json/__pycache__/__init__.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask/json/__pycache__/provider.cpython-313.pyc b/venv/Lib/site-packages/flask/json/__pycache__/provider.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..25cebb7b6c36de541a3a685c52a48933cd18891c Binary files /dev/null and b/venv/Lib/site-packages/flask/json/__pycache__/provider.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask/json/__pycache__/tag.cpython-313.pyc b/venv/Lib/site-packages/flask/json/__pycache__/tag.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2ae75964cac5271a88bec6c7a1f834ec17709420 Binary files /dev/null and b/venv/Lib/site-packages/flask/json/__pycache__/tag.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask/json/provider.py b/venv/Lib/site-packages/flask/json/provider.py new file mode 100644 index 0000000000000000000000000000000000000000..0edd3d58d7d9ca85e5fc216b24da0eacc16d47ec --- /dev/null +++ b/venv/Lib/site-packages/flask/json/provider.py @@ -0,0 +1,216 @@ +from __future__ import annotations + +import dataclasses +import decimal +import json +import typing as t +import uuid +import weakref +from datetime import date + +from werkzeug.http import http_date + +if t.TYPE_CHECKING: # pragma: no cover + from ..app import Flask + from ..wrappers import Response + + +class JSONProvider: + """A standard set of JSON operations for an application. Subclasses + of this can be used to customize JSON behavior or use different + JSON libraries. + + To implement a provider for a specific library, subclass this base + class and implement at least :meth:`dumps` and :meth:`loads`. All + other methods have default implementations. + + To use a different provider, either subclass ``Flask`` and set + :attr:`~flask.Flask.json_provider_class` to a provider class, or set + :attr:`app.json ` to an instance of the class. + + :param app: An application instance. This will be stored as a + :class:`weakref.proxy` on the :attr:`_app` attribute. + + .. versionadded:: 2.2 + """ + + def __init__(self, app: Flask) -> None: + self._app = weakref.proxy(app) + + def dumps(self, obj: t.Any, **kwargs: t.Any) -> str: + """Serialize data as JSON. + + :param obj: The data to serialize. + :param kwargs: May be passed to the underlying JSON library. + """ + raise NotImplementedError + + def dump(self, obj: t.Any, fp: t.IO[str], **kwargs: t.Any) -> None: + """Serialize data as JSON and write to a file. + + :param obj: The data to serialize. + :param fp: A file opened for writing text. Should use the UTF-8 + encoding to be valid JSON. + :param kwargs: May be passed to the underlying JSON library. + """ + fp.write(self.dumps(obj, **kwargs)) + + def loads(self, s: str | bytes, **kwargs: t.Any) -> t.Any: + """Deserialize data as JSON. + + :param s: Text or UTF-8 bytes. + :param kwargs: May be passed to the underlying JSON library. + """ + raise NotImplementedError + + def load(self, fp: t.IO[t.AnyStr], **kwargs: t.Any) -> t.Any: + """Deserialize data as JSON read from a file. + + :param fp: A file opened for reading text or UTF-8 bytes. + :param kwargs: May be passed to the underlying JSON library. + """ + return self.loads(fp.read(), **kwargs) + + def _prepare_response_obj( + self, args: tuple[t.Any, ...], kwargs: dict[str, t.Any] + ) -> t.Any: + if args and kwargs: + raise TypeError("app.json.response() takes either args or kwargs, not both") + + if not args and not kwargs: + return None + + if len(args) == 1: + return args[0] + + return args or kwargs + + def response(self, *args: t.Any, **kwargs: t.Any) -> Response: + """Serialize the given arguments as JSON, and return a + :class:`~flask.Response` object with the ``application/json`` + mimetype. + + The :func:`~flask.json.jsonify` function calls this method for + the current application. + + Either positional or keyword arguments can be given, not both. + If no arguments are given, ``None`` is serialized. + + :param args: A single value to serialize, or multiple values to + treat as a list to serialize. + :param kwargs: Treat as a dict to serialize. + """ + obj = self._prepare_response_obj(args, kwargs) + return self._app.response_class(self.dumps(obj), mimetype="application/json") + + +def _default(o: t.Any) -> t.Any: + if isinstance(o, date): + return http_date(o) + + if isinstance(o, (decimal.Decimal, uuid.UUID)): + return str(o) + + if dataclasses and dataclasses.is_dataclass(o): + return dataclasses.asdict(o) + + if hasattr(o, "__html__"): + return str(o.__html__()) + + raise TypeError(f"Object of type {type(o).__name__} is not JSON serializable") + + +class DefaultJSONProvider(JSONProvider): + """Provide JSON operations using Python's built-in :mod:`json` + library. Serializes the following additional data types: + + - :class:`datetime.datetime` and :class:`datetime.date` are + serialized to :rfc:`822` strings. This is the same as the HTTP + date format. + - :class:`uuid.UUID` is serialized to a string. + - :class:`dataclasses.dataclass` is passed to + :func:`dataclasses.asdict`. + - :class:`~markupsafe.Markup` (or any object with a ``__html__`` + method) will call the ``__html__`` method to get a string. + """ + + default: t.Callable[[t.Any], t.Any] = staticmethod( + _default + ) # type: ignore[assignment] + """Apply this function to any object that :meth:`json.dumps` does + not know how to serialize. It should return a valid JSON type or + raise a ``TypeError``. + """ + + ensure_ascii = True + """Replace non-ASCII characters with escape sequences. This may be + more compatible with some clients, but can be disabled for better + performance and size. + """ + + sort_keys = True + """Sort the keys in any serialized dicts. This may be useful for + some caching situations, but can be disabled for better performance. + When enabled, keys must all be strings, they are not converted + before sorting. + """ + + compact: bool | None = None + """If ``True``, or ``None`` out of debug mode, the :meth:`response` + output will not add indentation, newlines, or spaces. If ``False``, + or ``None`` in debug mode, it will use a non-compact representation. + """ + + mimetype = "application/json" + """The mimetype set in :meth:`response`.""" + + def dumps(self, obj: t.Any, **kwargs: t.Any) -> str: + """Serialize data as JSON to a string. + + Keyword arguments are passed to :func:`json.dumps`. Sets some + parameter defaults from the :attr:`default`, + :attr:`ensure_ascii`, and :attr:`sort_keys` attributes. + + :param obj: The data to serialize. + :param kwargs: Passed to :func:`json.dumps`. + """ + kwargs.setdefault("default", self.default) + kwargs.setdefault("ensure_ascii", self.ensure_ascii) + kwargs.setdefault("sort_keys", self.sort_keys) + return json.dumps(obj, **kwargs) + + def loads(self, s: str | bytes, **kwargs: t.Any) -> t.Any: + """Deserialize data as JSON from a string or bytes. + + :param s: Text or UTF-8 bytes. + :param kwargs: Passed to :func:`json.loads`. + """ + return json.loads(s, **kwargs) + + def response(self, *args: t.Any, **kwargs: t.Any) -> Response: + """Serialize the given arguments as JSON, and return a + :class:`~flask.Response` object with it. The response mimetype + will be "application/json" and can be changed with + :attr:`mimetype`. + + If :attr:`compact` is ``False`` or debug mode is enabled, the + output will be formatted to be easier to read. + + Either positional or keyword arguments can be given, not both. + If no arguments are given, ``None`` is serialized. + + :param args: A single value to serialize, or multiple values to + treat as a list to serialize. + :param kwargs: Treat as a dict to serialize. + """ + obj = self._prepare_response_obj(args, kwargs) + dump_args: dict[str, t.Any] = {} + + if (self.compact is None and self._app.debug) or self.compact is False: + dump_args.setdefault("indent", 2) + else: + dump_args.setdefault("separators", (",", ":")) + + return self._app.response_class( + f"{self.dumps(obj, **dump_args)}\n", mimetype=self.mimetype + ) diff --git a/venv/Lib/site-packages/flask/json/tag.py b/venv/Lib/site-packages/flask/json/tag.py new file mode 100644 index 0000000000000000000000000000000000000000..91cc4412d69b22bedc260d3cf598d135d706ed8f --- /dev/null +++ b/venv/Lib/site-packages/flask/json/tag.py @@ -0,0 +1,314 @@ +""" +Tagged JSON +~~~~~~~~~~~ + +A compact representation for lossless serialization of non-standard JSON +types. :class:`~flask.sessions.SecureCookieSessionInterface` uses this +to serialize the session data, but it may be useful in other places. It +can be extended to support other types. + +.. autoclass:: TaggedJSONSerializer + :members: + +.. autoclass:: JSONTag + :members: + +Let's see an example that adds support for +:class:`~collections.OrderedDict`. Dicts don't have an order in JSON, so +to handle this we will dump the items as a list of ``[key, value]`` +pairs. Subclass :class:`JSONTag` and give it the new key ``' od'`` to +identify the type. The session serializer processes dicts first, so +insert the new tag at the front of the order since ``OrderedDict`` must +be processed before ``dict``. + +.. code-block:: python + + from flask.json.tag import JSONTag + + class TagOrderedDict(JSONTag): + __slots__ = ('serializer',) + key = ' od' + + def check(self, value): + return isinstance(value, OrderedDict) + + def to_json(self, value): + return [[k, self.serializer.tag(v)] for k, v in iteritems(value)] + + def to_python(self, value): + return OrderedDict(value) + + app.session_interface.serializer.register(TagOrderedDict, index=0) +""" +from __future__ import annotations + +import typing as t +from base64 import b64decode +from base64 import b64encode +from datetime import datetime +from uuid import UUID + +from markupsafe import Markup +from werkzeug.http import http_date +from werkzeug.http import parse_date + +from ..json import dumps +from ..json import loads + + +class JSONTag: + """Base class for defining type tags for :class:`TaggedJSONSerializer`.""" + + __slots__ = ("serializer",) + + #: The tag to mark the serialized object with. If ``None``, this tag is + #: only used as an intermediate step during tagging. + key: str | None = None + + def __init__(self, serializer: TaggedJSONSerializer) -> None: + """Create a tagger for the given serializer.""" + self.serializer = serializer + + def check(self, value: t.Any) -> bool: + """Check if the given value should be tagged by this tag.""" + raise NotImplementedError + + def to_json(self, value: t.Any) -> t.Any: + """Convert the Python object to an object that is a valid JSON type. + The tag will be added later.""" + raise NotImplementedError + + def to_python(self, value: t.Any) -> t.Any: + """Convert the JSON representation back to the correct type. The tag + will already be removed.""" + raise NotImplementedError + + def tag(self, value: t.Any) -> t.Any: + """Convert the value to a valid JSON type and add the tag structure + around it.""" + return {self.key: self.to_json(value)} + + +class TagDict(JSONTag): + """Tag for 1-item dicts whose only key matches a registered tag. + + Internally, the dict key is suffixed with `__`, and the suffix is removed + when deserializing. + """ + + __slots__ = () + key = " di" + + def check(self, value: t.Any) -> bool: + return ( + isinstance(value, dict) + and len(value) == 1 + and next(iter(value)) in self.serializer.tags + ) + + def to_json(self, value: t.Any) -> t.Any: + key = next(iter(value)) + return {f"{key}__": self.serializer.tag(value[key])} + + def to_python(self, value: t.Any) -> t.Any: + key = next(iter(value)) + return {key[:-2]: value[key]} + + +class PassDict(JSONTag): + __slots__ = () + + def check(self, value: t.Any) -> bool: + return isinstance(value, dict) + + def to_json(self, value: t.Any) -> t.Any: + # JSON objects may only have string keys, so don't bother tagging the + # key here. + return {k: self.serializer.tag(v) for k, v in value.items()} + + tag = to_json + + +class TagTuple(JSONTag): + __slots__ = () + key = " t" + + def check(self, value: t.Any) -> bool: + return isinstance(value, tuple) + + def to_json(self, value: t.Any) -> t.Any: + return [self.serializer.tag(item) for item in value] + + def to_python(self, value: t.Any) -> t.Any: + return tuple(value) + + +class PassList(JSONTag): + __slots__ = () + + def check(self, value: t.Any) -> bool: + return isinstance(value, list) + + def to_json(self, value: t.Any) -> t.Any: + return [self.serializer.tag(item) for item in value] + + tag = to_json + + +class TagBytes(JSONTag): + __slots__ = () + key = " b" + + def check(self, value: t.Any) -> bool: + return isinstance(value, bytes) + + def to_json(self, value: t.Any) -> t.Any: + return b64encode(value).decode("ascii") + + def to_python(self, value: t.Any) -> t.Any: + return b64decode(value) + + +class TagMarkup(JSONTag): + """Serialize anything matching the :class:`~markupsafe.Markup` API by + having a ``__html__`` method to the result of that method. Always + deserializes to an instance of :class:`~markupsafe.Markup`.""" + + __slots__ = () + key = " m" + + def check(self, value: t.Any) -> bool: + return callable(getattr(value, "__html__", None)) + + def to_json(self, value: t.Any) -> t.Any: + return str(value.__html__()) + + def to_python(self, value: t.Any) -> t.Any: + return Markup(value) + + +class TagUUID(JSONTag): + __slots__ = () + key = " u" + + def check(self, value: t.Any) -> bool: + return isinstance(value, UUID) + + def to_json(self, value: t.Any) -> t.Any: + return value.hex + + def to_python(self, value: t.Any) -> t.Any: + return UUID(value) + + +class TagDateTime(JSONTag): + __slots__ = () + key = " d" + + def check(self, value: t.Any) -> bool: + return isinstance(value, datetime) + + def to_json(self, value: t.Any) -> t.Any: + return http_date(value) + + def to_python(self, value: t.Any) -> t.Any: + return parse_date(value) + + +class TaggedJSONSerializer: + """Serializer that uses a tag system to compactly represent objects that + are not JSON types. Passed as the intermediate serializer to + :class:`itsdangerous.Serializer`. + + The following extra types are supported: + + * :class:`dict` + * :class:`tuple` + * :class:`bytes` + * :class:`~markupsafe.Markup` + * :class:`~uuid.UUID` + * :class:`~datetime.datetime` + """ + + __slots__ = ("tags", "order") + + #: Tag classes to bind when creating the serializer. Other tags can be + #: added later using :meth:`~register`. + default_tags = [ + TagDict, + PassDict, + TagTuple, + PassList, + TagBytes, + TagMarkup, + TagUUID, + TagDateTime, + ] + + def __init__(self) -> None: + self.tags: dict[str, JSONTag] = {} + self.order: list[JSONTag] = [] + + for cls in self.default_tags: + self.register(cls) + + def register( + self, + tag_class: type[JSONTag], + force: bool = False, + index: int | None = None, + ) -> None: + """Register a new tag with this serializer. + + :param tag_class: tag class to register. Will be instantiated with this + serializer instance. + :param force: overwrite an existing tag. If false (default), a + :exc:`KeyError` is raised. + :param index: index to insert the new tag in the tag order. Useful when + the new tag is a special case of an existing tag. If ``None`` + (default), the tag is appended to the end of the order. + + :raise KeyError: if the tag key is already registered and ``force`` is + not true. + """ + tag = tag_class(self) + key = tag.key + + if key is not None: + if not force and key in self.tags: + raise KeyError(f"Tag '{key}' is already registered.") + + self.tags[key] = tag + + if index is None: + self.order.append(tag) + else: + self.order.insert(index, tag) + + def tag(self, value: t.Any) -> dict[str, t.Any]: + """Convert a value to a tagged representation if necessary.""" + for tag in self.order: + if tag.check(value): + return tag.tag(value) + + return value + + def untag(self, value: dict[str, t.Any]) -> t.Any: + """Convert a tagged representation back to the original type.""" + if len(value) != 1: + return value + + key = next(iter(value)) + + if key not in self.tags: + return value + + return self.tags[key].to_python(value[key]) + + def dumps(self, value: t.Any) -> str: + """Tag the value and dump it to a compact JSON string.""" + return dumps(self.tag(value), separators=(",", ":")) + + def loads(self, value: str) -> t.Any: + """Load data from a JSON string and deserialized any tagged objects.""" + return loads(value, object_hook=self.untag) diff --git a/venv/Lib/site-packages/flask/logging.py b/venv/Lib/site-packages/flask/logging.py new file mode 100644 index 0000000000000000000000000000000000000000..99f6be85be8cf576729086d47e79d44aec53d6f5 --- /dev/null +++ b/venv/Lib/site-packages/flask/logging.py @@ -0,0 +1,76 @@ +from __future__ import annotations + +import logging +import sys +import typing as t + +from werkzeug.local import LocalProxy + +from .globals import request + +if t.TYPE_CHECKING: # pragma: no cover + from .app import Flask + + +@LocalProxy +def wsgi_errors_stream() -> t.TextIO: + """Find the most appropriate error stream for the application. If a request + is active, log to ``wsgi.errors``, otherwise use ``sys.stderr``. + + If you configure your own :class:`logging.StreamHandler`, you may want to + use this for the stream. If you are using file or dict configuration and + can't import this directly, you can refer to it as + ``ext://flask.logging.wsgi_errors_stream``. + """ + return request.environ["wsgi.errors"] if request else sys.stderr + + +def has_level_handler(logger: logging.Logger) -> bool: + """Check if there is a handler in the logging chain that will handle the + given logger's :meth:`effective level <~logging.Logger.getEffectiveLevel>`. + """ + level = logger.getEffectiveLevel() + current = logger + + while current: + if any(handler.level <= level for handler in current.handlers): + return True + + if not current.propagate: + break + + current = current.parent # type: ignore + + return False + + +#: Log messages to :func:`~flask.logging.wsgi_errors_stream` with the format +#: ``[%(asctime)s] %(levelname)s in %(module)s: %(message)s``. +default_handler = logging.StreamHandler(wsgi_errors_stream) # type: ignore +default_handler.setFormatter( + logging.Formatter("[%(asctime)s] %(levelname)s in %(module)s: %(message)s") +) + + +def create_logger(app: Flask) -> logging.Logger: + """Get the Flask app's logger and configure it if needed. + + The logger name will be the same as + :attr:`app.import_name `. + + When :attr:`~flask.Flask.debug` is enabled, set the logger level to + :data:`logging.DEBUG` if it is not set. + + If there is no handler for the logger's effective level, add a + :class:`~logging.StreamHandler` for + :func:`~flask.logging.wsgi_errors_stream` with a basic format. + """ + logger = logging.getLogger(app.name) + + if app.debug and not logger.level: + logger.setLevel(logging.DEBUG) + + if not has_level_handler(logger): + logger.addHandler(default_handler) + + return logger diff --git a/venv/Lib/site-packages/flask/py.typed b/venv/Lib/site-packages/flask/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/venv/Lib/site-packages/flask/scaffold.py b/venv/Lib/site-packages/flask/scaffold.py new file mode 100644 index 0000000000000000000000000000000000000000..d15b87338d7da90229dc6b9bdc5b684d71b5fb1b --- /dev/null +++ b/venv/Lib/site-packages/flask/scaffold.py @@ -0,0 +1,873 @@ +from __future__ import annotations + +import importlib.util +import os +import pathlib +import sys +import typing as t +from collections import defaultdict +from datetime import timedelta +from functools import update_wrapper + +from jinja2 import FileSystemLoader +from werkzeug.exceptions import default_exceptions +from werkzeug.exceptions import HTTPException +from werkzeug.utils import cached_property + +from . import typing as ft +from .cli import AppGroup +from .globals import current_app +from .helpers import get_root_path +from .helpers import send_from_directory +from .templating import _default_template_ctx_processor + +if t.TYPE_CHECKING: # pragma: no cover + from .wrappers import Response + +# a singleton sentinel value for parameter defaults +_sentinel = object() + +F = t.TypeVar("F", bound=t.Callable[..., t.Any]) +T_after_request = t.TypeVar("T_after_request", bound=ft.AfterRequestCallable) +T_before_request = t.TypeVar("T_before_request", bound=ft.BeforeRequestCallable) +T_error_handler = t.TypeVar("T_error_handler", bound=ft.ErrorHandlerCallable) +T_teardown = t.TypeVar("T_teardown", bound=ft.TeardownCallable) +T_template_context_processor = t.TypeVar( + "T_template_context_processor", bound=ft.TemplateContextProcessorCallable +) +T_url_defaults = t.TypeVar("T_url_defaults", bound=ft.URLDefaultCallable) +T_url_value_preprocessor = t.TypeVar( + "T_url_value_preprocessor", bound=ft.URLValuePreprocessorCallable +) +T_route = t.TypeVar("T_route", bound=ft.RouteCallable) + + +def setupmethod(f: F) -> F: + f_name = f.__name__ + + def wrapper_func(self, *args: t.Any, **kwargs: t.Any) -> t.Any: + self._check_setup_finished(f_name) + return f(self, *args, **kwargs) + + return t.cast(F, update_wrapper(wrapper_func, f)) + + +class Scaffold: + """Common behavior shared between :class:`~flask.Flask` and + :class:`~flask.blueprints.Blueprint`. + + :param import_name: The import name of the module where this object + is defined. Usually :attr:`__name__` should be used. + :param static_folder: Path to a folder of static files to serve. + If this is set, a static route will be added. + :param static_url_path: URL prefix for the static route. + :param template_folder: Path to a folder containing template files. + for rendering. If this is set, a Jinja loader will be added. + :param root_path: The path that static, template, and resource files + are relative to. Typically not set, it is discovered based on + the ``import_name``. + + .. versionadded:: 2.0 + """ + + name: str + _static_folder: str | None = None + _static_url_path: str | None = None + + def __init__( + self, + import_name: str, + static_folder: str | os.PathLike | None = None, + static_url_path: str | None = None, + template_folder: str | os.PathLike | None = None, + root_path: str | None = None, + ): + #: The name of the package or module that this object belongs + #: to. Do not change this once it is set by the constructor. + self.import_name = import_name + + self.static_folder = static_folder # type: ignore + self.static_url_path = static_url_path + + #: The path to the templates folder, relative to + #: :attr:`root_path`, to add to the template loader. ``None`` if + #: templates should not be added. + self.template_folder = template_folder + + if root_path is None: + root_path = get_root_path(self.import_name) + + #: Absolute path to the package on the filesystem. Used to look + #: up resources contained in the package. + self.root_path = root_path + + #: The Click command group for registering CLI commands for this + #: object. The commands are available from the ``flask`` command + #: once the application has been discovered and blueprints have + #: been registered. + self.cli = AppGroup() + + #: A dictionary mapping endpoint names to view functions. + #: + #: To register a view function, use the :meth:`route` decorator. + #: + #: This data structure is internal. It should not be modified + #: directly and its format may change at any time. + self.view_functions: dict[str, t.Callable] = {} + + #: A data structure of registered error handlers, in the format + #: ``{scope: {code: {class: handler}}}``. The ``scope`` key is + #: the name of a blueprint the handlers are active for, or + #: ``None`` for all requests. The ``code`` key is the HTTP + #: status code for ``HTTPException``, or ``None`` for + #: other exceptions. The innermost dictionary maps exception + #: classes to handler functions. + #: + #: To register an error handler, use the :meth:`errorhandler` + #: decorator. + #: + #: This data structure is internal. It should not be modified + #: directly and its format may change at any time. + self.error_handler_spec: dict[ + ft.AppOrBlueprintKey, + dict[int | None, dict[type[Exception], ft.ErrorHandlerCallable]], + ] = defaultdict(lambda: defaultdict(dict)) + + #: A data structure of functions to call at the beginning of + #: each request, in the format ``{scope: [functions]}``. The + #: ``scope`` key is the name of a blueprint the functions are + #: active for, or ``None`` for all requests. + #: + #: To register a function, use the :meth:`before_request` + #: decorator. + #: + #: This data structure is internal. It should not be modified + #: directly and its format may change at any time. + self.before_request_funcs: dict[ + ft.AppOrBlueprintKey, list[ft.BeforeRequestCallable] + ] = defaultdict(list) + + #: A data structure of functions to call at the end of each + #: request, in the format ``{scope: [functions]}``. The + #: ``scope`` key is the name of a blueprint the functions are + #: active for, or ``None`` for all requests. + #: + #: To register a function, use the :meth:`after_request` + #: decorator. + #: + #: This data structure is internal. It should not be modified + #: directly and its format may change at any time. + self.after_request_funcs: dict[ + ft.AppOrBlueprintKey, list[ft.AfterRequestCallable] + ] = defaultdict(list) + + #: A data structure of functions to call at the end of each + #: request even if an exception is raised, in the format + #: ``{scope: [functions]}``. The ``scope`` key is the name of a + #: blueprint the functions are active for, or ``None`` for all + #: requests. + #: + #: To register a function, use the :meth:`teardown_request` + #: decorator. + #: + #: This data structure is internal. It should not be modified + #: directly and its format may change at any time. + self.teardown_request_funcs: dict[ + ft.AppOrBlueprintKey, list[ft.TeardownCallable] + ] = defaultdict(list) + + #: A data structure of functions to call to pass extra context + #: values when rendering templates, in the format + #: ``{scope: [functions]}``. The ``scope`` key is the name of a + #: blueprint the functions are active for, or ``None`` for all + #: requests. + #: + #: To register a function, use the :meth:`context_processor` + #: decorator. + #: + #: This data structure is internal. It should not be modified + #: directly and its format may change at any time. + self.template_context_processors: dict[ + ft.AppOrBlueprintKey, list[ft.TemplateContextProcessorCallable] + ] = defaultdict(list, {None: [_default_template_ctx_processor]}) + + #: A data structure of functions to call to modify the keyword + #: arguments passed to the view function, in the format + #: ``{scope: [functions]}``. The ``scope`` key is the name of a + #: blueprint the functions are active for, or ``None`` for all + #: requests. + #: + #: To register a function, use the + #: :meth:`url_value_preprocessor` decorator. + #: + #: This data structure is internal. It should not be modified + #: directly and its format may change at any time. + self.url_value_preprocessors: dict[ + ft.AppOrBlueprintKey, + list[ft.URLValuePreprocessorCallable], + ] = defaultdict(list) + + #: A data structure of functions to call to modify the keyword + #: arguments when generating URLs, in the format + #: ``{scope: [functions]}``. The ``scope`` key is the name of a + #: blueprint the functions are active for, or ``None`` for all + #: requests. + #: + #: To register a function, use the :meth:`url_defaults` + #: decorator. + #: + #: This data structure is internal. It should not be modified + #: directly and its format may change at any time. + self.url_default_functions: dict[ + ft.AppOrBlueprintKey, list[ft.URLDefaultCallable] + ] = defaultdict(list) + + def __repr__(self) -> str: + return f"<{type(self).__name__} {self.name!r}>" + + def _check_setup_finished(self, f_name: str) -> None: + raise NotImplementedError + + @property + def static_folder(self) -> str | None: + """The absolute path to the configured static folder. ``None`` + if no static folder is set. + """ + if self._static_folder is not None: + return os.path.join(self.root_path, self._static_folder) + else: + return None + + @static_folder.setter + def static_folder(self, value: str | os.PathLike | None) -> None: + if value is not None: + value = os.fspath(value).rstrip(r"\/") + + self._static_folder = value + + @property + def has_static_folder(self) -> bool: + """``True`` if :attr:`static_folder` is set. + + .. versionadded:: 0.5 + """ + return self.static_folder is not None + + @property + def static_url_path(self) -> str | None: + """The URL prefix that the static route will be accessible from. + + If it was not configured during init, it is derived from + :attr:`static_folder`. + """ + if self._static_url_path is not None: + return self._static_url_path + + if self.static_folder is not None: + basename = os.path.basename(self.static_folder) + return f"/{basename}".rstrip("/") + + return None + + @static_url_path.setter + def static_url_path(self, value: str | None) -> None: + if value is not None: + value = value.rstrip("/") + + self._static_url_path = value + + def get_send_file_max_age(self, filename: str | None) -> int | None: + """Used by :func:`send_file` to determine the ``max_age`` cache + value for a given file path if it wasn't passed. + + By default, this returns :data:`SEND_FILE_MAX_AGE_DEFAULT` from + the configuration of :data:`~flask.current_app`. This defaults + to ``None``, which tells the browser to use conditional requests + instead of a timed cache, which is usually preferable. + + .. versionchanged:: 2.0 + The default configuration is ``None`` instead of 12 hours. + + .. versionadded:: 0.9 + """ + value = current_app.config["SEND_FILE_MAX_AGE_DEFAULT"] + + if value is None: + return None + + if isinstance(value, timedelta): + return int(value.total_seconds()) + + return value + + def send_static_file(self, filename: str) -> Response: + """The view function used to serve files from + :attr:`static_folder`. A route is automatically registered for + this view at :attr:`static_url_path` if :attr:`static_folder` is + set. + + .. versionadded:: 0.5 + """ + if not self.has_static_folder: + raise RuntimeError("'static_folder' must be set to serve static_files.") + + # send_file only knows to call get_send_file_max_age on the app, + # call it here so it works for blueprints too. + max_age = self.get_send_file_max_age(filename) + return send_from_directory( + t.cast(str, self.static_folder), filename, max_age=max_age + ) + + @cached_property + def jinja_loader(self) -> FileSystemLoader | None: + """The Jinja loader for this object's templates. By default this + is a class :class:`jinja2.loaders.FileSystemLoader` to + :attr:`template_folder` if it is set. + + .. versionadded:: 0.5 + """ + if self.template_folder is not None: + return FileSystemLoader(os.path.join(self.root_path, self.template_folder)) + else: + return None + + def open_resource(self, resource: str, mode: str = "rb") -> t.IO[t.AnyStr]: + """Open a resource file relative to :attr:`root_path` for + reading. + + For example, if the file ``schema.sql`` is next to the file + ``app.py`` where the ``Flask`` app is defined, it can be opened + with: + + .. code-block:: python + + with app.open_resource("schema.sql") as f: + conn.executescript(f.read()) + + :param resource: Path to the resource relative to + :attr:`root_path`. + :param mode: Open the file in this mode. Only reading is + supported, valid values are "r" (or "rt") and "rb". + """ + if mode not in {"r", "rt", "rb"}: + raise ValueError("Resources can only be opened for reading.") + + return open(os.path.join(self.root_path, resource), mode) + + def _method_route( + self, + method: str, + rule: str, + options: dict, + ) -> t.Callable[[T_route], T_route]: + if "methods" in options: + raise TypeError("Use the 'route' decorator to use the 'methods' argument.") + + return self.route(rule, methods=[method], **options) + + @setupmethod + def get(self, rule: str, **options: t.Any) -> t.Callable[[T_route], T_route]: + """Shortcut for :meth:`route` with ``methods=["GET"]``. + + .. versionadded:: 2.0 + """ + return self._method_route("GET", rule, options) + + @setupmethod + def post(self, rule: str, **options: t.Any) -> t.Callable[[T_route], T_route]: + """Shortcut for :meth:`route` with ``methods=["POST"]``. + + .. versionadded:: 2.0 + """ + return self._method_route("POST", rule, options) + + @setupmethod + def put(self, rule: str, **options: t.Any) -> t.Callable[[T_route], T_route]: + """Shortcut for :meth:`route` with ``methods=["PUT"]``. + + .. versionadded:: 2.0 + """ + return self._method_route("PUT", rule, options) + + @setupmethod + def delete(self, rule: str, **options: t.Any) -> t.Callable[[T_route], T_route]: + """Shortcut for :meth:`route` with ``methods=["DELETE"]``. + + .. versionadded:: 2.0 + """ + return self._method_route("DELETE", rule, options) + + @setupmethod + def patch(self, rule: str, **options: t.Any) -> t.Callable[[T_route], T_route]: + """Shortcut for :meth:`route` with ``methods=["PATCH"]``. + + .. versionadded:: 2.0 + """ + return self._method_route("PATCH", rule, options) + + @setupmethod + def route(self, rule: str, **options: t.Any) -> t.Callable[[T_route], T_route]: + """Decorate a view function to register it with the given URL + rule and options. Calls :meth:`add_url_rule`, which has more + details about the implementation. + + .. code-block:: python + + @app.route("/") + def index(): + return "Hello, World!" + + See :ref:`url-route-registrations`. + + The endpoint name for the route defaults to the name of the view + function if the ``endpoint`` parameter isn't passed. + + The ``methods`` parameter defaults to ``["GET"]``. ``HEAD`` and + ``OPTIONS`` are added automatically. + + :param rule: The URL rule string. + :param options: Extra options passed to the + :class:`~werkzeug.routing.Rule` object. + """ + + def decorator(f: T_route) -> T_route: + endpoint = options.pop("endpoint", None) + self.add_url_rule(rule, endpoint, f, **options) + return f + + return decorator + + @setupmethod + def add_url_rule( + self, + rule: str, + endpoint: str | None = None, + view_func: ft.RouteCallable | None = None, + provide_automatic_options: bool | None = None, + **options: t.Any, + ) -> None: + """Register a rule for routing incoming requests and building + URLs. The :meth:`route` decorator is a shortcut to call this + with the ``view_func`` argument. These are equivalent: + + .. code-block:: python + + @app.route("/") + def index(): + ... + + .. code-block:: python + + def index(): + ... + + app.add_url_rule("/", view_func=index) + + See :ref:`url-route-registrations`. + + The endpoint name for the route defaults to the name of the view + function if the ``endpoint`` parameter isn't passed. An error + will be raised if a function has already been registered for the + endpoint. + + The ``methods`` parameter defaults to ``["GET"]``. ``HEAD`` is + always added automatically, and ``OPTIONS`` is added + automatically by default. + + ``view_func`` does not necessarily need to be passed, but if the + rule should participate in routing an endpoint name must be + associated with a view function at some point with the + :meth:`endpoint` decorator. + + .. code-block:: python + + app.add_url_rule("/", endpoint="index") + + @app.endpoint("index") + def index(): + ... + + If ``view_func`` has a ``required_methods`` attribute, those + methods are added to the passed and automatic methods. If it + has a ``provide_automatic_methods`` attribute, it is used as the + default if the parameter is not passed. + + :param rule: The URL rule string. + :param endpoint: The endpoint name to associate with the rule + and view function. Used when routing and building URLs. + Defaults to ``view_func.__name__``. + :param view_func: The view function to associate with the + endpoint name. + :param provide_automatic_options: Add the ``OPTIONS`` method and + respond to ``OPTIONS`` requests automatically. + :param options: Extra options passed to the + :class:`~werkzeug.routing.Rule` object. + """ + raise NotImplementedError + + @setupmethod + def endpoint(self, endpoint: str) -> t.Callable[[F], F]: + """Decorate a view function to register it for the given + endpoint. Used if a rule is added without a ``view_func`` with + :meth:`add_url_rule`. + + .. code-block:: python + + app.add_url_rule("/ex", endpoint="example") + + @app.endpoint("example") + def example(): + ... + + :param endpoint: The endpoint name to associate with the view + function. + """ + + def decorator(f: F) -> F: + self.view_functions[endpoint] = f + return f + + return decorator + + @setupmethod + def before_request(self, f: T_before_request) -> T_before_request: + """Register a function to run before each request. + + For example, this can be used to open a database connection, or + to load the logged in user from the session. + + .. code-block:: python + + @app.before_request + def load_user(): + if "user_id" in session: + g.user = db.session.get(session["user_id"]) + + The function will be called without any arguments. If it returns + a non-``None`` value, the value is handled as if it was the + return value from the view, and further request handling is + stopped. + + This is available on both app and blueprint objects. When used on an app, this + executes before every request. When used on a blueprint, this executes before + every request that the blueprint handles. To register with a blueprint and + execute before every request, use :meth:`.Blueprint.before_app_request`. + """ + self.before_request_funcs.setdefault(None, []).append(f) + return f + + @setupmethod + def after_request(self, f: T_after_request) -> T_after_request: + """Register a function to run after each request to this object. + + The function is called with the response object, and must return + a response object. This allows the functions to modify or + replace the response before it is sent. + + If a function raises an exception, any remaining + ``after_request`` functions will not be called. Therefore, this + should not be used for actions that must execute, such as to + close resources. Use :meth:`teardown_request` for that. + + This is available on both app and blueprint objects. When used on an app, this + executes after every request. When used on a blueprint, this executes after + every request that the blueprint handles. To register with a blueprint and + execute after every request, use :meth:`.Blueprint.after_app_request`. + """ + self.after_request_funcs.setdefault(None, []).append(f) + return f + + @setupmethod + def teardown_request(self, f: T_teardown) -> T_teardown: + """Register a function to be called when the request context is + popped. Typically this happens at the end of each request, but + contexts may be pushed manually as well during testing. + + .. code-block:: python + + with app.test_request_context(): + ... + + When the ``with`` block exits (or ``ctx.pop()`` is called), the + teardown functions are called just before the request context is + made inactive. + + When a teardown function was called because of an unhandled + exception it will be passed an error object. If an + :meth:`errorhandler` is registered, it will handle the exception + and the teardown will not receive it. + + Teardown functions must avoid raising exceptions. If they + execute code that might fail they must surround that code with a + ``try``/``except`` block and log any errors. + + The return values of teardown functions are ignored. + + This is available on both app and blueprint objects. When used on an app, this + executes after every request. When used on a blueprint, this executes after + every request that the blueprint handles. To register with a blueprint and + execute after every request, use :meth:`.Blueprint.teardown_app_request`. + """ + self.teardown_request_funcs.setdefault(None, []).append(f) + return f + + @setupmethod + def context_processor( + self, + f: T_template_context_processor, + ) -> T_template_context_processor: + """Registers a template context processor function. These functions run before + rendering a template. The keys of the returned dict are added as variables + available in the template. + + This is available on both app and blueprint objects. When used on an app, this + is called for every rendered template. When used on a blueprint, this is called + for templates rendered from the blueprint's views. To register with a blueprint + and affect every template, use :meth:`.Blueprint.app_context_processor`. + """ + self.template_context_processors[None].append(f) + return f + + @setupmethod + def url_value_preprocessor( + self, + f: T_url_value_preprocessor, + ) -> T_url_value_preprocessor: + """Register a URL value preprocessor function for all view + functions in the application. These functions will be called before the + :meth:`before_request` functions. + + The function can modify the values captured from the matched url before + they are passed to the view. For example, this can be used to pop a + common language code value and place it in ``g`` rather than pass it to + every view. + + The function is passed the endpoint name and values dict. The return + value is ignored. + + This is available on both app and blueprint objects. When used on an app, this + is called for every request. When used on a blueprint, this is called for + requests that the blueprint handles. To register with a blueprint and affect + every request, use :meth:`.Blueprint.app_url_value_preprocessor`. + """ + self.url_value_preprocessors[None].append(f) + return f + + @setupmethod + def url_defaults(self, f: T_url_defaults) -> T_url_defaults: + """Callback function for URL defaults for all view functions of the + application. It's called with the endpoint and values and should + update the values passed in place. + + This is available on both app and blueprint objects. When used on an app, this + is called for every request. When used on a blueprint, this is called for + requests that the blueprint handles. To register with a blueprint and affect + every request, use :meth:`.Blueprint.app_url_defaults`. + """ + self.url_default_functions[None].append(f) + return f + + @setupmethod + def errorhandler( + self, code_or_exception: type[Exception] | int + ) -> t.Callable[[T_error_handler], T_error_handler]: + """Register a function to handle errors by code or exception class. + + A decorator that is used to register a function given an + error code. Example:: + + @app.errorhandler(404) + def page_not_found(error): + return 'This page does not exist', 404 + + You can also register handlers for arbitrary exceptions:: + + @app.errorhandler(DatabaseError) + def special_exception_handler(error): + return 'Database connection failed', 500 + + This is available on both app and blueprint objects. When used on an app, this + can handle errors from every request. When used on a blueprint, this can handle + errors from requests that the blueprint handles. To register with a blueprint + and affect every request, use :meth:`.Blueprint.app_errorhandler`. + + .. versionadded:: 0.7 + Use :meth:`register_error_handler` instead of modifying + :attr:`error_handler_spec` directly, for application wide error + handlers. + + .. versionadded:: 0.7 + One can now additionally also register custom exception types + that do not necessarily have to be a subclass of the + :class:`~werkzeug.exceptions.HTTPException` class. + + :param code_or_exception: the code as integer for the handler, or + an arbitrary exception + """ + + def decorator(f: T_error_handler) -> T_error_handler: + self.register_error_handler(code_or_exception, f) + return f + + return decorator + + @setupmethod + def register_error_handler( + self, + code_or_exception: type[Exception] | int, + f: ft.ErrorHandlerCallable, + ) -> None: + """Alternative error attach function to the :meth:`errorhandler` + decorator that is more straightforward to use for non decorator + usage. + + .. versionadded:: 0.7 + """ + exc_class, code = self._get_exc_class_and_code(code_or_exception) + self.error_handler_spec[None][code][exc_class] = f + + @staticmethod + def _get_exc_class_and_code( + exc_class_or_code: type[Exception] | int, + ) -> tuple[type[Exception], int | None]: + """Get the exception class being handled. For HTTP status codes + or ``HTTPException`` subclasses, return both the exception and + status code. + + :param exc_class_or_code: Any exception class, or an HTTP status + code as an integer. + """ + exc_class: type[Exception] + + if isinstance(exc_class_or_code, int): + try: + exc_class = default_exceptions[exc_class_or_code] + except KeyError: + raise ValueError( + f"'{exc_class_or_code}' is not a recognized HTTP" + " error code. Use a subclass of HTTPException with" + " that code instead." + ) from None + else: + exc_class = exc_class_or_code + + if isinstance(exc_class, Exception): + raise TypeError( + f"{exc_class!r} is an instance, not a class. Handlers" + " can only be registered for Exception classes or HTTP" + " error codes." + ) + + if not issubclass(exc_class, Exception): + raise ValueError( + f"'{exc_class.__name__}' is not a subclass of Exception." + " Handlers can only be registered for Exception classes" + " or HTTP error codes." + ) + + if issubclass(exc_class, HTTPException): + return exc_class, exc_class.code + else: + return exc_class, None + + +def _endpoint_from_view_func(view_func: t.Callable) -> str: + """Internal helper that returns the default endpoint for a given + function. This always is the function name. + """ + assert view_func is not None, "expected view func if endpoint is not provided." + return view_func.__name__ + + +def _path_is_relative_to(path: pathlib.PurePath, base: str) -> bool: + # Path.is_relative_to doesn't exist until Python 3.9 + try: + path.relative_to(base) + return True + except ValueError: + return False + + +def _find_package_path(import_name): + """Find the path that contains the package or module.""" + root_mod_name, _, _ = import_name.partition(".") + + try: + root_spec = importlib.util.find_spec(root_mod_name) + + if root_spec is None: + raise ValueError("not found") + except (ImportError, ValueError): + # ImportError: the machinery told us it does not exist + # ValueError: + # - the module name was invalid + # - the module name is __main__ + # - we raised `ValueError` due to `root_spec` being `None` + return os.getcwd() + + if root_spec.origin in {"namespace", None}: + # namespace package + package_spec = importlib.util.find_spec(import_name) + + if package_spec is not None and package_spec.submodule_search_locations: + # Pick the path in the namespace that contains the submodule. + package_path = pathlib.Path( + os.path.commonpath(package_spec.submodule_search_locations) + ) + search_location = next( + location + for location in root_spec.submodule_search_locations + if _path_is_relative_to(package_path, location) + ) + else: + # Pick the first path. + search_location = root_spec.submodule_search_locations[0] + + return os.path.dirname(search_location) + elif root_spec.submodule_search_locations: + # package with __init__.py + return os.path.dirname(os.path.dirname(root_spec.origin)) + else: + # module + return os.path.dirname(root_spec.origin) + + +def find_package(import_name: str): + """Find the prefix that a package is installed under, and the path + that it would be imported from. + + The prefix is the directory containing the standard directory + hierarchy (lib, bin, etc.). If the package is not installed to the + system (:attr:`sys.prefix`) or a virtualenv (``site-packages``), + ``None`` is returned. + + The path is the entry in :attr:`sys.path` that contains the package + for import. If the package is not installed, it's assumed that the + package was imported from the current working directory. + """ + package_path = _find_package_path(import_name) + py_prefix = os.path.abspath(sys.prefix) + + # installed to the system + if _path_is_relative_to(pathlib.PurePath(package_path), py_prefix): + return py_prefix, package_path + + site_parent, site_folder = os.path.split(package_path) + + # installed to a virtualenv + if site_folder.lower() == "site-packages": + parent, folder = os.path.split(site_parent) + + # Windows (prefix/lib/site-packages) + if folder.lower() == "lib": + return parent, package_path + + # Unix (prefix/lib/pythonX.Y/site-packages) + if os.path.basename(parent).lower() == "lib": + return os.path.dirname(parent), package_path + + # something else (prefix/site-packages) + return site_parent, package_path + + # not installed + return None, package_path diff --git a/venv/Lib/site-packages/flask/sessions.py b/venv/Lib/site-packages/flask/sessions.py new file mode 100644 index 0000000000000000000000000000000000000000..e5650d6862ba235cda3f935e21679cc9d866958c --- /dev/null +++ b/venv/Lib/site-packages/flask/sessions.py @@ -0,0 +1,367 @@ +from __future__ import annotations + +import hashlib +import typing as t +from collections.abc import MutableMapping +from datetime import datetime +from datetime import timezone + +from itsdangerous import BadSignature +from itsdangerous import URLSafeTimedSerializer +from werkzeug.datastructures import CallbackDict + +from .json.tag import TaggedJSONSerializer + +if t.TYPE_CHECKING: # pragma: no cover + from .app import Flask + from .wrappers import Request, Response + + +class SessionMixin(MutableMapping): + """Expands a basic dictionary with session attributes.""" + + @property + def permanent(self) -> bool: + """This reflects the ``'_permanent'`` key in the dict.""" + return self.get("_permanent", False) + + @permanent.setter + def permanent(self, value: bool) -> None: + self["_permanent"] = bool(value) + + #: Some implementations can detect whether a session is newly + #: created, but that is not guaranteed. Use with caution. The mixin + # default is hard-coded ``False``. + new = False + + #: Some implementations can detect changes to the session and set + #: this when that happens. The mixin default is hard coded to + #: ``True``. + modified = True + + #: Some implementations can detect when session data is read or + #: written and set this when that happens. The mixin default is hard + #: coded to ``True``. + accessed = True + + +class SecureCookieSession(CallbackDict, SessionMixin): + """Base class for sessions based on signed cookies. + + This session backend will set the :attr:`modified` and + :attr:`accessed` attributes. It cannot reliably track whether a + session is new (vs. empty), so :attr:`new` remains hard coded to + ``False``. + """ + + #: When data is changed, this is set to ``True``. Only the session + #: dictionary itself is tracked; if the session contains mutable + #: data (for example a nested dict) then this must be set to + #: ``True`` manually when modifying that data. The session cookie + #: will only be written to the response if this is ``True``. + modified = False + + #: When data is read or written, this is set to ``True``. Used by + # :class:`.SecureCookieSessionInterface` to add a ``Vary: Cookie`` + #: header, which allows caching proxies to cache different pages for + #: different users. + accessed = False + + def __init__(self, initial: t.Any = None) -> None: + def on_update(self) -> None: + self.modified = True + self.accessed = True + + super().__init__(initial, on_update) + + def __getitem__(self, key: str) -> t.Any: + self.accessed = True + return super().__getitem__(key) + + def get(self, key: str, default: t.Any = None) -> t.Any: + self.accessed = True + return super().get(key, default) + + def setdefault(self, key: str, default: t.Any = None) -> t.Any: + self.accessed = True + return super().setdefault(key, default) + + +class NullSession(SecureCookieSession): + """Class used to generate nicer error messages if sessions are not + available. Will still allow read-only access to the empty session + but fail on setting. + """ + + def _fail(self, *args: t.Any, **kwargs: t.Any) -> t.NoReturn: + raise RuntimeError( + "The session is unavailable because no secret " + "key was set. Set the secret_key on the " + "application to something unique and secret." + ) + + __setitem__ = __delitem__ = clear = pop = popitem = update = setdefault = _fail # type: ignore # noqa: B950 + del _fail + + +class SessionInterface: + """The basic interface you have to implement in order to replace the + default session interface which uses werkzeug's securecookie + implementation. The only methods you have to implement are + :meth:`open_session` and :meth:`save_session`, the others have + useful defaults which you don't need to change. + + The session object returned by the :meth:`open_session` method has to + provide a dictionary like interface plus the properties and methods + from the :class:`SessionMixin`. We recommend just subclassing a dict + and adding that mixin:: + + class Session(dict, SessionMixin): + pass + + If :meth:`open_session` returns ``None`` Flask will call into + :meth:`make_null_session` to create a session that acts as replacement + if the session support cannot work because some requirement is not + fulfilled. The default :class:`NullSession` class that is created + will complain that the secret key was not set. + + To replace the session interface on an application all you have to do + is to assign :attr:`flask.Flask.session_interface`:: + + app = Flask(__name__) + app.session_interface = MySessionInterface() + + Multiple requests with the same session may be sent and handled + concurrently. When implementing a new session interface, consider + whether reads or writes to the backing store must be synchronized. + There is no guarantee on the order in which the session for each + request is opened or saved, it will occur in the order that requests + begin and end processing. + + .. versionadded:: 0.8 + """ + + #: :meth:`make_null_session` will look here for the class that should + #: be created when a null session is requested. Likewise the + #: :meth:`is_null_session` method will perform a typecheck against + #: this type. + null_session_class = NullSession + + #: A flag that indicates if the session interface is pickle based. + #: This can be used by Flask extensions to make a decision in regards + #: to how to deal with the session object. + #: + #: .. versionadded:: 0.10 + pickle_based = False + + def make_null_session(self, app: Flask) -> NullSession: + """Creates a null session which acts as a replacement object if the + real session support could not be loaded due to a configuration + error. This mainly aids the user experience because the job of the + null session is to still support lookup without complaining but + modifications are answered with a helpful error message of what + failed. + + This creates an instance of :attr:`null_session_class` by default. + """ + return self.null_session_class() + + def is_null_session(self, obj: object) -> bool: + """Checks if a given object is a null session. Null sessions are + not asked to be saved. + + This checks if the object is an instance of :attr:`null_session_class` + by default. + """ + return isinstance(obj, self.null_session_class) + + def get_cookie_name(self, app: Flask) -> str: + """The name of the session cookie. Uses``app.config["SESSION_COOKIE_NAME"]``.""" + return app.config["SESSION_COOKIE_NAME"] + + def get_cookie_domain(self, app: Flask) -> str | None: + """The value of the ``Domain`` parameter on the session cookie. If not set, + browsers will only send the cookie to the exact domain it was set from. + Otherwise, they will send it to any subdomain of the given value as well. + + Uses the :data:`SESSION_COOKIE_DOMAIN` config. + + .. versionchanged:: 2.3 + Not set by default, does not fall back to ``SERVER_NAME``. + """ + rv = app.config["SESSION_COOKIE_DOMAIN"] + return rv if rv else None + + def get_cookie_path(self, app: Flask) -> str: + """Returns the path for which the cookie should be valid. The + default implementation uses the value from the ``SESSION_COOKIE_PATH`` + config var if it's set, and falls back to ``APPLICATION_ROOT`` or + uses ``/`` if it's ``None``. + """ + return app.config["SESSION_COOKIE_PATH"] or app.config["APPLICATION_ROOT"] + + def get_cookie_httponly(self, app: Flask) -> bool: + """Returns True if the session cookie should be httponly. This + currently just returns the value of the ``SESSION_COOKIE_HTTPONLY`` + config var. + """ + return app.config["SESSION_COOKIE_HTTPONLY"] + + def get_cookie_secure(self, app: Flask) -> bool: + """Returns True if the cookie should be secure. This currently + just returns the value of the ``SESSION_COOKIE_SECURE`` setting. + """ + return app.config["SESSION_COOKIE_SECURE"] + + def get_cookie_samesite(self, app: Flask) -> str: + """Return ``'Strict'`` or ``'Lax'`` if the cookie should use the + ``SameSite`` attribute. This currently just returns the value of + the :data:`SESSION_COOKIE_SAMESITE` setting. + """ + return app.config["SESSION_COOKIE_SAMESITE"] + + def get_expiration_time(self, app: Flask, session: SessionMixin) -> datetime | None: + """A helper method that returns an expiration date for the session + or ``None`` if the session is linked to the browser session. The + default implementation returns now + the permanent session + lifetime configured on the application. + """ + if session.permanent: + return datetime.now(timezone.utc) + app.permanent_session_lifetime + return None + + def should_set_cookie(self, app: Flask, session: SessionMixin) -> bool: + """Used by session backends to determine if a ``Set-Cookie`` header + should be set for this session cookie for this response. If the session + has been modified, the cookie is set. If the session is permanent and + the ``SESSION_REFRESH_EACH_REQUEST`` config is true, the cookie is + always set. + + This check is usually skipped if the session was deleted. + + .. versionadded:: 0.11 + """ + + return session.modified or ( + session.permanent and app.config["SESSION_REFRESH_EACH_REQUEST"] + ) + + def open_session(self, app: Flask, request: Request) -> SessionMixin | None: + """This is called at the beginning of each request, after + pushing the request context, before matching the URL. + + This must return an object which implements a dictionary-like + interface as well as the :class:`SessionMixin` interface. + + This will return ``None`` to indicate that loading failed in + some way that is not immediately an error. The request + context will fall back to using :meth:`make_null_session` + in this case. + """ + raise NotImplementedError() + + def save_session( + self, app: Flask, session: SessionMixin, response: Response + ) -> None: + """This is called at the end of each request, after generating + a response, before removing the request context. It is skipped + if :meth:`is_null_session` returns ``True``. + """ + raise NotImplementedError() + + +session_json_serializer = TaggedJSONSerializer() + + +class SecureCookieSessionInterface(SessionInterface): + """The default session interface that stores sessions in signed cookies + through the :mod:`itsdangerous` module. + """ + + #: the salt that should be applied on top of the secret key for the + #: signing of cookie based sessions. + salt = "cookie-session" + #: the hash function to use for the signature. The default is sha1 + digest_method = staticmethod(hashlib.sha1) + #: the name of the itsdangerous supported key derivation. The default + #: is hmac. + key_derivation = "hmac" + #: A python serializer for the payload. The default is a compact + #: JSON derived serializer with support for some extra Python types + #: such as datetime objects or tuples. + serializer = session_json_serializer + session_class = SecureCookieSession + + def get_signing_serializer(self, app: Flask) -> URLSafeTimedSerializer | None: + if not app.secret_key: + return None + signer_kwargs = dict( + key_derivation=self.key_derivation, digest_method=self.digest_method + ) + return URLSafeTimedSerializer( + app.secret_key, + salt=self.salt, + serializer=self.serializer, + signer_kwargs=signer_kwargs, + ) + + def open_session(self, app: Flask, request: Request) -> SecureCookieSession | None: + s = self.get_signing_serializer(app) + if s is None: + return None + val = request.cookies.get(self.get_cookie_name(app)) + if not val: + return self.session_class() + max_age = int(app.permanent_session_lifetime.total_seconds()) + try: + data = s.loads(val, max_age=max_age) + return self.session_class(data) + except BadSignature: + return self.session_class() + + def save_session( + self, app: Flask, session: SessionMixin, response: Response + ) -> None: + name = self.get_cookie_name(app) + domain = self.get_cookie_domain(app) + path = self.get_cookie_path(app) + secure = self.get_cookie_secure(app) + samesite = self.get_cookie_samesite(app) + httponly = self.get_cookie_httponly(app) + + # Add a "Vary: Cookie" header if the session was accessed at all. + if session.accessed: + response.vary.add("Cookie") + + # If the session is modified to be empty, remove the cookie. + # If the session is empty, return without setting the cookie. + if not session: + if session.modified: + response.delete_cookie( + name, + domain=domain, + path=path, + secure=secure, + samesite=samesite, + httponly=httponly, + ) + response.vary.add("Cookie") + + return + + if not self.should_set_cookie(app, session): + return + + expires = self.get_expiration_time(app, session) + val = self.get_signing_serializer(app).dumps(dict(session)) # type: ignore + response.set_cookie( + name, + val, # type: ignore + expires=expires, + httponly=httponly, + domain=domain, + path=path, + secure=secure, + samesite=samesite, + ) + response.vary.add("Cookie") diff --git a/venv/Lib/site-packages/flask/signals.py b/venv/Lib/site-packages/flask/signals.py new file mode 100644 index 0000000000000000000000000000000000000000..d79f21f9396026c18428b149edd67d1debbeb07b --- /dev/null +++ b/venv/Lib/site-packages/flask/signals.py @@ -0,0 +1,33 @@ +from __future__ import annotations + +import typing as t +import warnings + +from blinker import Namespace + +# This namespace is only for signals provided by Flask itself. +_signals = Namespace() + +template_rendered = _signals.signal("template-rendered") +before_render_template = _signals.signal("before-render-template") +request_started = _signals.signal("request-started") +request_finished = _signals.signal("request-finished") +request_tearing_down = _signals.signal("request-tearing-down") +got_request_exception = _signals.signal("got-request-exception") +appcontext_tearing_down = _signals.signal("appcontext-tearing-down") +appcontext_pushed = _signals.signal("appcontext-pushed") +appcontext_popped = _signals.signal("appcontext-popped") +message_flashed = _signals.signal("message-flashed") + + +def __getattr__(name: str) -> t.Any: + if name == "signals_available": + warnings.warn( + "The 'signals_available' attribute is deprecated and will be removed in" + " Flask 2.4. Signals are always available.", + DeprecationWarning, + stacklevel=2, + ) + return True + + raise AttributeError(name) diff --git a/venv/Lib/site-packages/flask/templating.py b/venv/Lib/site-packages/flask/templating.py new file mode 100644 index 0000000000000000000000000000000000000000..769108f755229f6e5785718e2e48836f9b58223c --- /dev/null +++ b/venv/Lib/site-packages/flask/templating.py @@ -0,0 +1,220 @@ +from __future__ import annotations + +import typing as t + +from jinja2 import BaseLoader +from jinja2 import Environment as BaseEnvironment +from jinja2 import Template +from jinja2 import TemplateNotFound + +from .globals import _cv_app +from .globals import _cv_request +from .globals import current_app +from .globals import request +from .helpers import stream_with_context +from .signals import before_render_template +from .signals import template_rendered + +if t.TYPE_CHECKING: # pragma: no cover + from .app import Flask + from .scaffold import Scaffold + + +def _default_template_ctx_processor() -> dict[str, t.Any]: + """Default template context processor. Injects `request`, + `session` and `g`. + """ + appctx = _cv_app.get(None) + reqctx = _cv_request.get(None) + rv: dict[str, t.Any] = {} + if appctx is not None: + rv["g"] = appctx.g + if reqctx is not None: + rv["request"] = reqctx.request + rv["session"] = reqctx.session + return rv + + +class Environment(BaseEnvironment): + """Works like a regular Jinja2 environment but has some additional + knowledge of how Flask's blueprint works so that it can prepend the + name of the blueprint to referenced templates if necessary. + """ + + def __init__(self, app: Flask, **options: t.Any) -> None: + if "loader" not in options: + options["loader"] = app.create_global_jinja_loader() + BaseEnvironment.__init__(self, **options) + self.app = app + + +class DispatchingJinjaLoader(BaseLoader): + """A loader that looks for templates in the application and all + the blueprint folders. + """ + + def __init__(self, app: Flask) -> None: + self.app = app + + def get_source( # type: ignore + self, environment: Environment, template: str + ) -> tuple[str, str | None, t.Callable | None]: + if self.app.config["EXPLAIN_TEMPLATE_LOADING"]: + return self._get_source_explained(environment, template) + return self._get_source_fast(environment, template) + + def _get_source_explained( + self, environment: Environment, template: str + ) -> tuple[str, str | None, t.Callable | None]: + attempts = [] + rv: tuple[str, str | None, t.Callable[[], bool] | None] | None + trv: None | (tuple[str, str | None, t.Callable[[], bool] | None]) = None + + for srcobj, loader in self._iter_loaders(template): + try: + rv = loader.get_source(environment, template) + if trv is None: + trv = rv + except TemplateNotFound: + rv = None + attempts.append((loader, srcobj, rv)) + + from .debughelpers import explain_template_loading_attempts + + explain_template_loading_attempts(self.app, template, attempts) + + if trv is not None: + return trv + raise TemplateNotFound(template) + + def _get_source_fast( + self, environment: Environment, template: str + ) -> tuple[str, str | None, t.Callable | None]: + for _srcobj, loader in self._iter_loaders(template): + try: + return loader.get_source(environment, template) + except TemplateNotFound: + continue + raise TemplateNotFound(template) + + def _iter_loaders( + self, template: str + ) -> t.Generator[tuple[Scaffold, BaseLoader], None, None]: + loader = self.app.jinja_loader + if loader is not None: + yield self.app, loader + + for blueprint in self.app.iter_blueprints(): + loader = blueprint.jinja_loader + if loader is not None: + yield blueprint, loader + + def list_templates(self) -> list[str]: + result = set() + loader = self.app.jinja_loader + if loader is not None: + result.update(loader.list_templates()) + + for blueprint in self.app.iter_blueprints(): + loader = blueprint.jinja_loader + if loader is not None: + for template in loader.list_templates(): + result.add(template) + + return list(result) + + +def _render(app: Flask, template: Template, context: dict[str, t.Any]) -> str: + app.update_template_context(context) + before_render_template.send( + app, _async_wrapper=app.ensure_sync, template=template, context=context + ) + rv = template.render(context) + template_rendered.send( + app, _async_wrapper=app.ensure_sync, template=template, context=context + ) + return rv + + +def render_template( + template_name_or_list: str | Template | list[str | Template], + **context: t.Any, +) -> str: + """Render a template by name with the given context. + + :param template_name_or_list: The name of the template to render. If + a list is given, the first name to exist will be rendered. + :param context: The variables to make available in the template. + """ + app = current_app._get_current_object() # type: ignore[attr-defined] + template = app.jinja_env.get_or_select_template(template_name_or_list) + return _render(app, template, context) + + +def render_template_string(source: str, **context: t.Any) -> str: + """Render a template from the given source string with the given + context. + + :param source: The source code of the template to render. + :param context: The variables to make available in the template. + """ + app = current_app._get_current_object() # type: ignore[attr-defined] + template = app.jinja_env.from_string(source) + return _render(app, template, context) + + +def _stream( + app: Flask, template: Template, context: dict[str, t.Any] +) -> t.Iterator[str]: + app.update_template_context(context) + before_render_template.send( + app, _async_wrapper=app.ensure_sync, template=template, context=context + ) + + def generate() -> t.Iterator[str]: + yield from template.generate(context) + template_rendered.send( + app, _async_wrapper=app.ensure_sync, template=template, context=context + ) + + rv = generate() + + # If a request context is active, keep it while generating. + if request: + rv = stream_with_context(rv) + + return rv + + +def stream_template( + template_name_or_list: str | Template | list[str | Template], + **context: t.Any, +) -> t.Iterator[str]: + """Render a template by name with the given context as a stream. + This returns an iterator of strings, which can be used as a + streaming response from a view. + + :param template_name_or_list: The name of the template to render. If + a list is given, the first name to exist will be rendered. + :param context: The variables to make available in the template. + + .. versionadded:: 2.2 + """ + app = current_app._get_current_object() # type: ignore[attr-defined] + template = app.jinja_env.get_or_select_template(template_name_or_list) + return _stream(app, template, context) + + +def stream_template_string(source: str, **context: t.Any) -> t.Iterator[str]: + """Render a template from the given source string with the given + context as a stream. This returns an iterator of strings, which can + be used as a streaming response from a view. + + :param source: The source code of the template to render. + :param context: The variables to make available in the template. + + .. versionadded:: 2.2 + """ + app = current_app._get_current_object() # type: ignore[attr-defined] + template = app.jinja_env.from_string(source) + return _stream(app, template, context) diff --git a/venv/Lib/site-packages/flask/testing.py b/venv/Lib/site-packages/flask/testing.py new file mode 100644 index 0000000000000000000000000000000000000000..69aa7851889fe02cbb5ee3649c32ed8a950a5280 --- /dev/null +++ b/venv/Lib/site-packages/flask/testing.py @@ -0,0 +1,295 @@ +from __future__ import annotations + +import importlib.metadata +import typing as t +from contextlib import contextmanager +from contextlib import ExitStack +from copy import copy +from types import TracebackType +from urllib.parse import urlsplit + +import werkzeug.test +from click.testing import CliRunner +from werkzeug.test import Client +from werkzeug.wrappers import Request as BaseRequest + +from .cli import ScriptInfo +from .sessions import SessionMixin + +if t.TYPE_CHECKING: # pragma: no cover + from werkzeug.test import TestResponse + + from .app import Flask + + +class EnvironBuilder(werkzeug.test.EnvironBuilder): + """An :class:`~werkzeug.test.EnvironBuilder`, that takes defaults from the + application. + + :param app: The Flask application to configure the environment from. + :param path: URL path being requested. + :param base_url: Base URL where the app is being served, which + ``path`` is relative to. If not given, built from + :data:`PREFERRED_URL_SCHEME`, ``subdomain``, + :data:`SERVER_NAME`, and :data:`APPLICATION_ROOT`. + :param subdomain: Subdomain name to append to :data:`SERVER_NAME`. + :param url_scheme: Scheme to use instead of + :data:`PREFERRED_URL_SCHEME`. + :param json: If given, this is serialized as JSON and passed as + ``data``. Also defaults ``content_type`` to + ``application/json``. + :param args: other positional arguments passed to + :class:`~werkzeug.test.EnvironBuilder`. + :param kwargs: other keyword arguments passed to + :class:`~werkzeug.test.EnvironBuilder`. + """ + + def __init__( + self, + app: Flask, + path: str = "/", + base_url: str | None = None, + subdomain: str | None = None, + url_scheme: str | None = None, + *args: t.Any, + **kwargs: t.Any, + ) -> None: + assert not (base_url or subdomain or url_scheme) or ( + base_url is not None + ) != bool( + subdomain or url_scheme + ), 'Cannot pass "subdomain" or "url_scheme" with "base_url".' + + if base_url is None: + http_host = app.config.get("SERVER_NAME") or "localhost" + app_root = app.config["APPLICATION_ROOT"] + + if subdomain: + http_host = f"{subdomain}.{http_host}" + + if url_scheme is None: + url_scheme = app.config["PREFERRED_URL_SCHEME"] + + url = urlsplit(path) + base_url = ( + f"{url.scheme or url_scheme}://{url.netloc or http_host}" + f"/{app_root.lstrip('/')}" + ) + path = url.path + + if url.query: + sep = b"?" if isinstance(url.query, bytes) else "?" + path += sep + url.query + + self.app = app + super().__init__(path, base_url, *args, **kwargs) + + def json_dumps(self, obj: t.Any, **kwargs: t.Any) -> str: # type: ignore + """Serialize ``obj`` to a JSON-formatted string. + + The serialization will be configured according to the config associated + with this EnvironBuilder's ``app``. + """ + return self.app.json.dumps(obj, **kwargs) + + +_werkzeug_version = "" + + +def _get_werkzeug_version() -> str: + global _werkzeug_version + + if not _werkzeug_version: + _werkzeug_version = importlib.metadata.version("werkzeug") + + return _werkzeug_version + + +class FlaskClient(Client): + """Works like a regular Werkzeug test client but has knowledge about + Flask's contexts to defer the cleanup of the request context until + the end of a ``with`` block. For general information about how to + use this class refer to :class:`werkzeug.test.Client`. + + .. versionchanged:: 0.12 + `app.test_client()` includes preset default environment, which can be + set after instantiation of the `app.test_client()` object in + `client.environ_base`. + + Basic usage is outlined in the :doc:`/testing` chapter. + """ + + application: Flask + + def __init__(self, *args: t.Any, **kwargs: t.Any) -> None: + super().__init__(*args, **kwargs) + self.preserve_context = False + self._new_contexts: list[t.ContextManager[t.Any]] = [] + self._context_stack = ExitStack() + self.environ_base = { + "REMOTE_ADDR": "127.0.0.1", + "HTTP_USER_AGENT": f"Werkzeug/{_get_werkzeug_version()}", + } + + @contextmanager + def session_transaction( + self, *args: t.Any, **kwargs: t.Any + ) -> t.Generator[SessionMixin, None, None]: + """When used in combination with a ``with`` statement this opens a + session transaction. This can be used to modify the session that + the test client uses. Once the ``with`` block is left the session is + stored back. + + :: + + with client.session_transaction() as session: + session['value'] = 42 + + Internally this is implemented by going through a temporary test + request context and since session handling could depend on + request variables this function accepts the same arguments as + :meth:`~flask.Flask.test_request_context` which are directly + passed through. + """ + if self._cookies is None: + raise TypeError( + "Cookies are disabled. Create a client with 'use_cookies=True'." + ) + + app = self.application + ctx = app.test_request_context(*args, **kwargs) + self._add_cookies_to_wsgi(ctx.request.environ) + + with ctx: + sess = app.session_interface.open_session(app, ctx.request) + + if sess is None: + raise RuntimeError("Session backend did not open a session.") + + yield sess + resp = app.response_class() + + if app.session_interface.is_null_session(sess): + return + + with ctx: + app.session_interface.save_session(app, sess, resp) + + self._update_cookies_from_response( + ctx.request.host.partition(":")[0], + ctx.request.path, + resp.headers.getlist("Set-Cookie"), + ) + + def _copy_environ(self, other): + out = {**self.environ_base, **other} + + if self.preserve_context: + out["werkzeug.debug.preserve_context"] = self._new_contexts.append + + return out + + def _request_from_builder_args(self, args, kwargs): + kwargs["environ_base"] = self._copy_environ(kwargs.get("environ_base", {})) + builder = EnvironBuilder(self.application, *args, **kwargs) + + try: + return builder.get_request() + finally: + builder.close() + + def open( + self, + *args: t.Any, + buffered: bool = False, + follow_redirects: bool = False, + **kwargs: t.Any, + ) -> TestResponse: + if args and isinstance( + args[0], (werkzeug.test.EnvironBuilder, dict, BaseRequest) + ): + if isinstance(args[0], werkzeug.test.EnvironBuilder): + builder = copy(args[0]) + builder.environ_base = self._copy_environ(builder.environ_base or {}) + request = builder.get_request() + elif isinstance(args[0], dict): + request = EnvironBuilder.from_environ( + args[0], app=self.application, environ_base=self._copy_environ({}) + ).get_request() + else: + # isinstance(args[0], BaseRequest) + request = copy(args[0]) + request.environ = self._copy_environ(request.environ) + else: + # request is None + request = self._request_from_builder_args(args, kwargs) + + # Pop any previously preserved contexts. This prevents contexts + # from being preserved across redirects or multiple requests + # within a single block. + self._context_stack.close() + + response = super().open( + request, + buffered=buffered, + follow_redirects=follow_redirects, + ) + response.json_module = self.application.json # type: ignore[assignment] + + # Re-push contexts that were preserved during the request. + while self._new_contexts: + cm = self._new_contexts.pop() + self._context_stack.enter_context(cm) + + return response + + def __enter__(self) -> FlaskClient: + if self.preserve_context: + raise RuntimeError("Cannot nest client invocations") + self.preserve_context = True + return self + + def __exit__( + self, + exc_type: type | None, + exc_value: BaseException | None, + tb: TracebackType | None, + ) -> None: + self.preserve_context = False + self._context_stack.close() + + +class FlaskCliRunner(CliRunner): + """A :class:`~click.testing.CliRunner` for testing a Flask app's + CLI commands. Typically created using + :meth:`~flask.Flask.test_cli_runner`. See :ref:`testing-cli`. + """ + + def __init__(self, app: Flask, **kwargs: t.Any) -> None: + self.app = app + super().__init__(**kwargs) + + def invoke( # type: ignore + self, cli: t.Any = None, args: t.Any = None, **kwargs: t.Any + ) -> t.Any: + """Invokes a CLI command in an isolated environment. See + :meth:`CliRunner.invoke ` for + full method documentation. See :ref:`testing-cli` for examples. + + If the ``obj`` argument is not given, passes an instance of + :class:`~flask.cli.ScriptInfo` that knows how to load the Flask + app being tested. + + :param cli: Command object to invoke. Default is the app's + :attr:`~flask.app.Flask.cli` group. + :param args: List of strings to invoke the command with. + + :return: a :class:`~click.testing.Result` object. + """ + if cli is None: + cli = self.app.cli # type: ignore + + if "obj" not in kwargs: + kwargs["obj"] = ScriptInfo(create_app=lambda: self.app) + + return super().invoke(cli, args, **kwargs) diff --git a/venv/Lib/site-packages/flask/typing.py b/venv/Lib/site-packages/flask/typing.py new file mode 100644 index 0000000000000000000000000000000000000000..50aef7f463361f2f2d10096e5472ef9768cab743 --- /dev/null +++ b/venv/Lib/site-packages/flask/typing.py @@ -0,0 +1,82 @@ +from __future__ import annotations + +import typing as t + +if t.TYPE_CHECKING: # pragma: no cover + from _typeshed.wsgi import WSGIApplication # noqa: F401 + from werkzeug.datastructures import Headers # noqa: F401 + from werkzeug.wrappers import Response # noqa: F401 + +# The possible types that are directly convertible or are a Response object. +ResponseValue = t.Union[ + "Response", + str, + bytes, + t.List[t.Any], + # Only dict is actually accepted, but Mapping allows for TypedDict. + t.Mapping[str, t.Any], + t.Iterator[str], + t.Iterator[bytes], +] + +# the possible types for an individual HTTP header +# This should be a Union, but mypy doesn't pass unless it's a TypeVar. +HeaderValue = t.Union[str, t.List[str], t.Tuple[str, ...]] + +# the possible types for HTTP headers +HeadersValue = t.Union[ + "Headers", + t.Mapping[str, HeaderValue], + t.Sequence[t.Tuple[str, HeaderValue]], +] + +# The possible types returned by a route function. +ResponseReturnValue = t.Union[ + ResponseValue, + t.Tuple[ResponseValue, HeadersValue], + t.Tuple[ResponseValue, int], + t.Tuple[ResponseValue, int, HeadersValue], + "WSGIApplication", +] + +# Allow any subclass of werkzeug.Response, such as the one from Flask, +# as a callback argument. Using werkzeug.Response directly makes a +# callback annotated with flask.Response fail type checking. +ResponseClass = t.TypeVar("ResponseClass", bound="Response") + +AppOrBlueprintKey = t.Optional[str] # The App key is None, whereas blueprints are named +AfterRequestCallable = t.Union[ + t.Callable[[ResponseClass], ResponseClass], + t.Callable[[ResponseClass], t.Awaitable[ResponseClass]], +] +BeforeFirstRequestCallable = t.Union[ + t.Callable[[], None], t.Callable[[], t.Awaitable[None]] +] +BeforeRequestCallable = t.Union[ + t.Callable[[], t.Optional[ResponseReturnValue]], + t.Callable[[], t.Awaitable[t.Optional[ResponseReturnValue]]], +] +ShellContextProcessorCallable = t.Callable[[], t.Dict[str, t.Any]] +TeardownCallable = t.Union[ + t.Callable[[t.Optional[BaseException]], None], + t.Callable[[t.Optional[BaseException]], t.Awaitable[None]], +] +TemplateContextProcessorCallable = t.Callable[[], t.Dict[str, t.Any]] +TemplateFilterCallable = t.Callable[..., t.Any] +TemplateGlobalCallable = t.Callable[..., t.Any] +TemplateTestCallable = t.Callable[..., bool] +URLDefaultCallable = t.Callable[[str, dict], None] +URLValuePreprocessorCallable = t.Callable[[t.Optional[str], t.Optional[dict]], None] + +# This should take Exception, but that either breaks typing the argument +# with a specific exception, or decorating multiple times with different +# exceptions (and using a union type on the argument). +# https://github.com/pallets/flask/issues/4095 +# https://github.com/pallets/flask/issues/4295 +# https://github.com/pallets/flask/issues/4297 +ErrorHandlerCallable = t.Callable[[t.Any], ResponseReturnValue] + +RouteCallable = t.Union[ + t.Callable[..., ResponseReturnValue], + t.Callable[..., t.Awaitable[ResponseReturnValue]], +] diff --git a/venv/Lib/site-packages/flask/views.py b/venv/Lib/site-packages/flask/views.py new file mode 100644 index 0000000000000000000000000000000000000000..c7a2b621c89604cdd2f1278404c2d01ff1932083 --- /dev/null +++ b/venv/Lib/site-packages/flask/views.py @@ -0,0 +1,190 @@ +from __future__ import annotations + +import typing as t + +from . import typing as ft +from .globals import current_app +from .globals import request + + +http_method_funcs = frozenset( + ["get", "post", "head", "options", "delete", "put", "trace", "patch"] +) + + +class View: + """Subclass this class and override :meth:`dispatch_request` to + create a generic class-based view. Call :meth:`as_view` to create a + view function that creates an instance of the class with the given + arguments and calls its ``dispatch_request`` method with any URL + variables. + + See :doc:`views` for a detailed guide. + + .. code-block:: python + + class Hello(View): + init_every_request = False + + def dispatch_request(self, name): + return f"Hello, {name}!" + + app.add_url_rule( + "/hello/", view_func=Hello.as_view("hello") + ) + + Set :attr:`methods` on the class to change what methods the view + accepts. + + Set :attr:`decorators` on the class to apply a list of decorators to + the generated view function. Decorators applied to the class itself + will not be applied to the generated view function! + + Set :attr:`init_every_request` to ``False`` for efficiency, unless + you need to store request-global data on ``self``. + """ + + #: The methods this view is registered for. Uses the same default + #: (``["GET", "HEAD", "OPTIONS"]``) as ``route`` and + #: ``add_url_rule`` by default. + methods: t.ClassVar[t.Collection[str] | None] = None + + #: Control whether the ``OPTIONS`` method is handled automatically. + #: Uses the same default (``True``) as ``route`` and + #: ``add_url_rule`` by default. + provide_automatic_options: t.ClassVar[bool | None] = None + + #: A list of decorators to apply, in order, to the generated view + #: function. Remember that ``@decorator`` syntax is applied bottom + #: to top, so the first decorator in the list would be the bottom + #: decorator. + #: + #: .. versionadded:: 0.8 + decorators: t.ClassVar[list[t.Callable]] = [] + + #: Create a new instance of this view class for every request by + #: default. If a view subclass sets this to ``False``, the same + #: instance is used for every request. + #: + #: A single instance is more efficient, especially if complex setup + #: is done during init. However, storing data on ``self`` is no + #: longer safe across requests, and :data:`~flask.g` should be used + #: instead. + #: + #: .. versionadded:: 2.2 + init_every_request: t.ClassVar[bool] = True + + def dispatch_request(self) -> ft.ResponseReturnValue: + """The actual view function behavior. Subclasses must override + this and return a valid response. Any variables from the URL + rule are passed as keyword arguments. + """ + raise NotImplementedError() + + @classmethod + def as_view( + cls, name: str, *class_args: t.Any, **class_kwargs: t.Any + ) -> ft.RouteCallable: + """Convert the class into a view function that can be registered + for a route. + + By default, the generated view will create a new instance of the + view class for every request and call its + :meth:`dispatch_request` method. If the view class sets + :attr:`init_every_request` to ``False``, the same instance will + be used for every request. + + Except for ``name``, all other arguments passed to this method + are forwarded to the view class ``__init__`` method. + + .. versionchanged:: 2.2 + Added the ``init_every_request`` class attribute. + """ + if cls.init_every_request: + + def view(**kwargs: t.Any) -> ft.ResponseReturnValue: + self = view.view_class( # type: ignore[attr-defined] + *class_args, **class_kwargs + ) + return current_app.ensure_sync(self.dispatch_request)(**kwargs) + + else: + self = cls(*class_args, **class_kwargs) + + def view(**kwargs: t.Any) -> ft.ResponseReturnValue: + return current_app.ensure_sync(self.dispatch_request)(**kwargs) + + if cls.decorators: + view.__name__ = name + view.__module__ = cls.__module__ + for decorator in cls.decorators: + view = decorator(view) + + # We attach the view class to the view function for two reasons: + # first of all it allows us to easily figure out what class-based + # view this thing came from, secondly it's also used for instantiating + # the view class so you can actually replace it with something else + # for testing purposes and debugging. + view.view_class = cls # type: ignore + view.__name__ = name + view.__doc__ = cls.__doc__ + view.__module__ = cls.__module__ + view.methods = cls.methods # type: ignore + view.provide_automatic_options = cls.provide_automatic_options # type: ignore + return view + + +class MethodView(View): + """Dispatches request methods to the corresponding instance methods. + For example, if you implement a ``get`` method, it will be used to + handle ``GET`` requests. + + This can be useful for defining a REST API. + + :attr:`methods` is automatically set based on the methods defined on + the class. + + See :doc:`views` for a detailed guide. + + .. code-block:: python + + class CounterAPI(MethodView): + def get(self): + return str(session.get("counter", 0)) + + def post(self): + session["counter"] = session.get("counter", 0) + 1 + return redirect(url_for("counter")) + + app.add_url_rule( + "/counter", view_func=CounterAPI.as_view("counter") + ) + """ + + def __init_subclass__(cls, **kwargs: t.Any) -> None: + super().__init_subclass__(**kwargs) + + if "methods" not in cls.__dict__: + methods = set() + + for base in cls.__bases__: + if getattr(base, "methods", None): + methods.update(base.methods) # type: ignore[attr-defined] + + for key in http_method_funcs: + if hasattr(cls, key): + methods.add(key.upper()) + + if methods: + cls.methods = methods + + def dispatch_request(self, **kwargs: t.Any) -> ft.ResponseReturnValue: + meth = getattr(self, request.method.lower(), None) + + # If the request method is HEAD and we don't have a handler for it + # retry with GET. + if meth is None and request.method == "HEAD": + meth = getattr(self, "get", None) + + assert meth is not None, f"Unimplemented method {request.method!r}" + return current_app.ensure_sync(meth)(**kwargs) diff --git a/venv/Lib/site-packages/flask/wrappers.py b/venv/Lib/site-packages/flask/wrappers.py new file mode 100644 index 0000000000000000000000000000000000000000..ef7aa38c0ebe8617d8015ec6b9ee7f4b30596424 --- /dev/null +++ b/venv/Lib/site-packages/flask/wrappers.py @@ -0,0 +1,173 @@ +from __future__ import annotations + +import typing as t + +from werkzeug.exceptions import BadRequest +from werkzeug.wrappers import Request as RequestBase +from werkzeug.wrappers import Response as ResponseBase + +from . import json +from .globals import current_app +from .helpers import _split_blueprint_path + +if t.TYPE_CHECKING: # pragma: no cover + from werkzeug.routing import Rule + + +class Request(RequestBase): + """The request object used by default in Flask. Remembers the + matched endpoint and view arguments. + + It is what ends up as :class:`~flask.request`. If you want to replace + the request object used you can subclass this and set + :attr:`~flask.Flask.request_class` to your subclass. + + The request object is a :class:`~werkzeug.wrappers.Request` subclass and + provides all of the attributes Werkzeug defines plus a few Flask + specific ones. + """ + + json_module: t.Any = json + + #: The internal URL rule that matched the request. This can be + #: useful to inspect which methods are allowed for the URL from + #: a before/after handler (``request.url_rule.methods``) etc. + #: Though if the request's method was invalid for the URL rule, + #: the valid list is available in ``routing_exception.valid_methods`` + #: instead (an attribute of the Werkzeug exception + #: :exc:`~werkzeug.exceptions.MethodNotAllowed`) + #: because the request was never internally bound. + #: + #: .. versionadded:: 0.6 + url_rule: Rule | None = None + + #: A dict of view arguments that matched the request. If an exception + #: happened when matching, this will be ``None``. + view_args: dict[str, t.Any] | None = None + + #: If matching the URL failed, this is the exception that will be + #: raised / was raised as part of the request handling. This is + #: usually a :exc:`~werkzeug.exceptions.NotFound` exception or + #: something similar. + routing_exception: Exception | None = None + + @property + def max_content_length(self) -> int | None: # type: ignore + """Read-only view of the ``MAX_CONTENT_LENGTH`` config key.""" + if current_app: + return current_app.config["MAX_CONTENT_LENGTH"] + else: + return None + + @property + def endpoint(self) -> str | None: + """The endpoint that matched the request URL. + + This will be ``None`` if matching failed or has not been + performed yet. + + This in combination with :attr:`view_args` can be used to + reconstruct the same URL or a modified URL. + """ + if self.url_rule is not None: + return self.url_rule.endpoint + + return None + + @property + def blueprint(self) -> str | None: + """The registered name of the current blueprint. + + This will be ``None`` if the endpoint is not part of a + blueprint, or if URL matching failed or has not been performed + yet. + + This does not necessarily match the name the blueprint was + created with. It may have been nested, or registered with a + different name. + """ + endpoint = self.endpoint + + if endpoint is not None and "." in endpoint: + return endpoint.rpartition(".")[0] + + return None + + @property + def blueprints(self) -> list[str]: + """The registered names of the current blueprint upwards through + parent blueprints. + + This will be an empty list if there is no current blueprint, or + if URL matching failed. + + .. versionadded:: 2.0.1 + """ + name = self.blueprint + + if name is None: + return [] + + return _split_blueprint_path(name) + + def _load_form_data(self) -> None: + super()._load_form_data() + + # In debug mode we're replacing the files multidict with an ad-hoc + # subclass that raises a different error for key errors. + if ( + current_app + and current_app.debug + and self.mimetype != "multipart/form-data" + and not self.files + ): + from .debughelpers import attach_enctype_error_multidict + + attach_enctype_error_multidict(self) + + def on_json_loading_failed(self, e: ValueError | None) -> t.Any: + try: + return super().on_json_loading_failed(e) + except BadRequest as e: + if current_app and current_app.debug: + raise + + raise BadRequest() from e + + +class Response(ResponseBase): + """The response object that is used by default in Flask. Works like the + response object from Werkzeug but is set to have an HTML mimetype by + default. Quite often you don't have to create this object yourself because + :meth:`~flask.Flask.make_response` will take care of that for you. + + If you want to replace the response object used you can subclass this and + set :attr:`~flask.Flask.response_class` to your subclass. + + .. versionchanged:: 1.0 + JSON support is added to the response, like the request. This is useful + when testing to get the test client response data as JSON. + + .. versionchanged:: 1.0 + + Added :attr:`max_cookie_size`. + """ + + default_mimetype: str | None = "text/html" + + json_module = json + + autocorrect_location_header = False + + @property + def max_cookie_size(self) -> int: # type: ignore + """Read-only view of the :data:`MAX_COOKIE_SIZE` config key. + + See :attr:`~werkzeug.wrappers.Response.max_cookie_size` in + Werkzeug's docs. + """ + if current_app: + return current_app.config["MAX_COOKIE_SIZE"] + + # return Werkzeug's default when not in an app context + return super().max_cookie_size diff --git a/venv/Lib/site-packages/flask_babel/__init__.py b/venv/Lib/site-packages/flask_babel/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c51b2ef25b43cfb4792144f5c995260905930a55 --- /dev/null +++ b/venv/Lib/site-packages/flask_babel/__init__.py @@ -0,0 +1,714 @@ +""" + flaskext.babel + ~~~~~~~~~~~~~~ + + Implements i18n/l10n support for Flask applications based on Babel. + + :copyright: (c) 2013 by Armin Ronacher, Daniel Neuhäuser. + :license: BSD, see LICENSE for more details. +""" +from __future__ import absolute_import +import os + +from datetime import datetime +from contextlib import contextmanager +from flask import current_app, request +from flask.ctx import has_request_context +from flask.helpers import locked_cached_property +from babel import dates, numbers, support, Locale +from pytz import timezone, UTC +from werkzeug.datastructures import ImmutableDict + +from flask_babel.speaklater import LazyString + + +class Babel(object): + """Central controller class that can be used to configure how + Flask-Babel behaves. Each application that wants to use Flask-Babel + has to create, or run :meth:`init_app` on, an instance of this class + after the configuration was initialized. + """ + + default_date_formats = ImmutableDict({ + 'time': 'medium', + 'date': 'medium', + 'datetime': 'medium', + 'time.short': None, + 'time.medium': None, + 'time.full': None, + 'time.long': None, + 'date.short': None, + 'date.medium': None, + 'date.full': None, + 'date.long': None, + 'datetime.short': None, + 'datetime.medium': None, + 'datetime.full': None, + 'datetime.long': None, + }) + + def __init__(self, app=None, default_locale='en', default_timezone='UTC', + default_domain='messages', date_formats=None, + configure_jinja=True): + self._default_locale = default_locale + self._default_timezone = default_timezone + self._default_domain = default_domain + self._date_formats = date_formats + self._configure_jinja = configure_jinja + self.app = app + self.locale_selector_func = None + self.timezone_selector_func = None + + if app is not None: + self.init_app(app) + + def init_app(self, app): + """Set up this instance for use with *app*, if no app was passed to + the constructor. + """ + self.app = app + app.babel_instance = self + if not hasattr(app, 'extensions'): + app.extensions = {} + app.extensions['babel'] = self + + app.config.setdefault('BABEL_DEFAULT_LOCALE', self._default_locale) + app.config.setdefault('BABEL_DEFAULT_TIMEZONE', self._default_timezone) + app.config.setdefault('BABEL_DOMAIN', self._default_domain) + if self._date_formats is None: + self._date_formats = self.default_date_formats.copy() + + #: a mapping of Babel datetime format strings that can be modified + #: to change the defaults. If you invoke :func:`format_datetime` + #: and do not provide any format string Flask-Babel will do the + #: following things: + #: + #: 1. look up ``date_formats['datetime']``. By default ``'medium'`` + #: is returned to enforce medium length datetime formats. + #: 2. ``date_formats['datetime.medium'] (if ``'medium'`` was + #: returned in step one) is looked up. If the return value + #: is anything but `None` this is used as new format string. + #: otherwise the default for that language is used. + self.date_formats = self._date_formats + + if self._configure_jinja: + app.jinja_env.filters.update( + datetimeformat=format_datetime, + dateformat=format_date, + timeformat=format_time, + timedeltaformat=format_timedelta, + + numberformat=format_number, + decimalformat=format_decimal, + currencyformat=format_currency, + percentformat=format_percent, + scientificformat=format_scientific, + ) + app.jinja_env.add_extension('jinja2.ext.i18n') + app.jinja_env.install_gettext_callables( + lambda x: get_translations().ugettext(x), + lambda s, p, n: get_translations().ungettext(s, p, n), + newstyle=True + ) + + def localeselector(self, f): + """Registers a callback function for locale selection. The default + behaves as if a function was registered that returns `None` all the + time. If `None` is returned, the locale falls back to the one from + the configuration. + + This has to return the locale as string (eg: ``'de_AT'``, ``'en_US'``) + """ + self.locale_selector_func = f + return f + + def timezoneselector(self, f): + """Registers a callback function for timezone selection. The default + behaves as if a function was registered that returns `None` all the + time. If `None` is returned, the timezone falls back to the one from + the configuration. + + This has to return the timezone as string (eg: ``'Europe/Vienna'``) + """ + self.timezone_selector_func = f + return f + + def list_translations(self): + """Returns a list of all the locales translations exist for. The + list returned will be filled with actual locale objects and not just + strings. + + .. versionadded:: 0.6 + """ + result = [] + + for dirname in self.translation_directories: + if not os.path.isdir(dirname): + continue + + for folder in os.listdir(dirname): + locale_dir = os.path.join(dirname, folder, 'LC_MESSAGES') + if not os.path.isdir(locale_dir): + continue + + if filter(lambda x: x.endswith('.mo'), os.listdir(locale_dir)): + result.append(Locale.parse(folder)) + + # If not other translations are found, add the default locale. + if not result: + result.append(Locale.parse(self._default_locale)) + + return result + + @property + def default_locale(self): + """The default locale from the configuration as instance of a + `babel.Locale` object. + """ + return Locale.parse(self.app.config['BABEL_DEFAULT_LOCALE']) + + @property + def default_timezone(self): + """The default timezone from the configuration as instance of a + `pytz.timezone` object. + """ + return timezone(self.app.config['BABEL_DEFAULT_TIMEZONE']) + + @property + def domain(self): + """The message domain for the translations as a string. + """ + return self.app.config['BABEL_DOMAIN'] + + @locked_cached_property + def domain_instance(self): + """The message domain for the translations. + """ + return Domain(domain=self.app.config['BABEL_DOMAIN']) + + @property + def translation_directories(self): + directories = self.app.config.get( + 'BABEL_TRANSLATION_DIRECTORIES', + 'translations' + ).split(';') + + for path in directories: + if os.path.isabs(path): + yield path + else: + yield os.path.join(self.app.root_path, path) + + +def get_translations(): + """Returns the correct gettext translations that should be used for + this request. This will never fail and return a dummy translation + object if used outside of the request or if a translation cannot be + found. + """ + return get_domain().get_translations() + + +def get_locale(): + """Returns the locale that should be used for this request as + `babel.Locale` object. This returns `None` if used outside of + a request. + """ + ctx = _get_current_context() + if ctx is None: + return None + locale = getattr(ctx, 'babel_locale', None) + if locale is None: + babel = current_app.extensions['babel'] + if babel.locale_selector_func is None: + locale = babel.default_locale + else: + rv = babel.locale_selector_func() + if rv is None: + locale = babel.default_locale + else: + locale = Locale.parse(rv) + ctx.babel_locale = locale + return locale + + +def get_timezone(): + """Returns the timezone that should be used for this request as + `pytz.timezone` object. This returns `None` if used outside of + a request. + """ + ctx = _get_current_context() + tzinfo = getattr(ctx, 'babel_tzinfo', None) + if tzinfo is None: + babel = current_app.extensions['babel'] + if babel.timezone_selector_func is None: + tzinfo = babel.default_timezone + else: + rv = babel.timezone_selector_func() + if rv is None: + tzinfo = babel.default_timezone + else: + tzinfo = timezone(rv) if isinstance(rv, str) else rv + ctx.babel_tzinfo = tzinfo + return tzinfo + + +def refresh(): + """Refreshes the cached timezones and locale information. This can + be used to switch a translation between a request and if you want + the changes to take place immediately, not just with the next request:: + + user.timezone = request.form['timezone'] + user.locale = request.form['locale'] + refresh() + flash(gettext('Language was changed')) + + Without that refresh, the :func:`~flask.flash` function would probably + return English text and a now German page. + """ + ctx = _get_current_context() + for key in 'babel_locale', 'babel_tzinfo', 'babel_translations': + if hasattr(ctx, key): + delattr(ctx, key) + + if hasattr(ctx, 'forced_babel_locale'): + ctx.babel_locale = ctx.forced_babel_locale + + +@contextmanager +def force_locale(locale): + """Temporarily overrides the currently selected locale. + + Sometimes it is useful to switch the current locale to different one, do + some tasks and then revert back to the original one. For example, if the + user uses German on the web site, but you want to send them an email in + English, you can use this function as a context manager:: + + with force_locale('en_US'): + send_email(gettext('Hello!'), ...) + + :param locale: The locale to temporary switch to (ex: 'en_US'). + """ + ctx = _get_current_context() + if ctx is None: + yield + return + + orig_attrs = {} + for key in ('babel_translations', 'babel_locale'): + orig_attrs[key] = getattr(ctx, key, None) + + try: + ctx.babel_locale = Locale.parse(locale) + ctx.forced_babel_locale = ctx.babel_locale + ctx.babel_translations = None + yield + finally: + if hasattr(ctx, 'forced_babel_locale'): + del ctx.forced_babel_locale + + for key, value in orig_attrs.items(): + setattr(ctx, key, value) + + +def _get_format(key, format): + """A small helper for the datetime formatting functions. Looks up + format defaults for different kinds. + """ + babel = current_app.extensions['babel'] + if format is None: + format = babel.date_formats[key] + if format in ('short', 'medium', 'full', 'long'): + rv = babel.date_formats['%s.%s' % (key, format)] + if rv is not None: + format = rv + return format + + +def to_user_timezone(datetime): + """Convert a datetime object to the user's timezone. This automatically + happens on all date formatting unless rebasing is disabled. If you need + to convert a :class:`datetime.datetime` object at any time to the user's + timezone (as returned by :func:`get_timezone` this function can be used). + """ + if datetime.tzinfo is None: + datetime = datetime.replace(tzinfo=UTC) + tzinfo = get_timezone() + return tzinfo.normalize(datetime.astimezone(tzinfo)) + + +def to_utc(datetime): + """Convert a datetime object to UTC and drop tzinfo. This is the + opposite operation to :func:`to_user_timezone`. + """ + if datetime.tzinfo is None: + datetime = get_timezone().localize(datetime) + return datetime.astimezone(UTC).replace(tzinfo=None) + + +def format_datetime(datetime=None, format=None, rebase=True): + """Return a date formatted according to the given pattern. If no + :class:`~datetime.datetime` object is passed, the current time is + assumed. By default rebasing happens which causes the object to + be converted to the users's timezone (as returned by + :func:`to_user_timezone`). This function formats both date and + time. + + The format parameter can either be ``'short'``, ``'medium'``, + ``'long'`` or ``'full'`` (in which cause the language's default for + that setting is used, or the default from the :attr:`Babel.date_formats` + mapping is used) or a format string as documented by Babel. + + This function is also available in the template context as filter + named `datetimeformat`. + """ + format = _get_format('datetime', format) + return _date_format(dates.format_datetime, datetime, format, rebase) + + +def format_date(date=None, format=None, rebase=True): + """Return a date formatted according to the given pattern. If no + :class:`~datetime.datetime` or :class:`~datetime.date` object is passed, + the current time is assumed. By default rebasing happens which causes + the object to be converted to the users's timezone (as returned by + :func:`to_user_timezone`). This function only formats the date part + of a :class:`~datetime.datetime` object. + + The format parameter can either be ``'short'``, ``'medium'``, + ``'long'`` or ``'full'`` (in which cause the language's default for + that setting is used, or the default from the :attr:`Babel.date_formats` + mapping is used) or a format string as documented by Babel. + + This function is also available in the template context as filter + named `dateformat`. + """ + if rebase and isinstance(date, datetime): + date = to_user_timezone(date) + format = _get_format('date', format) + return _date_format(dates.format_date, date, format, rebase) + + +def format_time(time=None, format=None, rebase=True): + """Return a time formatted according to the given pattern. If no + :class:`~datetime.datetime` object is passed, the current time is + assumed. By default rebasing happens which causes the object to + be converted to the users's timezone (as returned by + :func:`to_user_timezone`). This function formats both date and + time. + + The format parameter can either be ``'short'``, ``'medium'``, + ``'long'`` or ``'full'`` (in which cause the language's default for + that setting is used, or the default from the :attr:`Babel.date_formats` + mapping is used) or a format string as documented by Babel. + + This function is also available in the template context as filter + named `timeformat`. + """ + format = _get_format('time', format) + return _date_format(dates.format_time, time, format, rebase) + + +def format_timedelta(datetime_or_timedelta, granularity='second', + add_direction=False, threshold=0.85): + """Format the elapsed time from the given date to now or the given + timedelta. + + This function is also available in the template context as filter + named `timedeltaformat`. + """ + if isinstance(datetime_or_timedelta, datetime): + datetime_or_timedelta = datetime.utcnow() - datetime_or_timedelta + return dates.format_timedelta( + datetime_or_timedelta, + granularity, + threshold=threshold, + add_direction=add_direction, + locale=get_locale() + ) + + +def _date_format(formatter, obj, format, rebase, **extra): + """Internal helper that formats the date.""" + locale = get_locale() + extra = {} + if formatter is not dates.format_date and rebase: + extra['tzinfo'] = get_timezone() + return formatter(obj, format, locale=locale, **extra) + + +def format_number(number): + """Return the given number formatted for the locale in request + + :param number: the number to format + :return: the formatted number + :rtype: unicode + """ + locale = get_locale() + return numbers.format_decimal(number, locale=locale) + + +def format_decimal(number, format=None): + """Return the given decimal number formatted for the locale in request + + :param number: the number to format + :param format: the format to use + :return: the formatted number + :rtype: unicode + """ + locale = get_locale() + return numbers.format_decimal(number, format=format, locale=locale) + + +def format_currency(number, currency, format=None, currency_digits=True, + format_type='standard'): + """Return the given number formatted for the locale in request + + :param number: the number to format + :param currency: the currency code + :param format: the format to use + :param currency_digits: use the currency’s number of decimal digits + [default: True] + :param format_type: the currency format type to use + [default: standard] + :return: the formatted number + :rtype: unicode + """ + locale = get_locale() + return numbers.format_currency( + number, + currency, + format=format, + locale=locale, + currency_digits=currency_digits, + format_type=format_type + ) + + +def format_percent(number, format=None): + """Return formatted percent value for the locale in request + + :param number: the number to format + :param format: the format to use + :return: the formatted percent number + :rtype: unicode + """ + locale = get_locale() + return numbers.format_percent(number, format=format, locale=locale) + + +def format_scientific(number, format=None): + """Return value formatted in scientific notation for the locale in request + + :param number: the number to format + :param format: the format to use + :return: the formatted percent number + :rtype: unicode + """ + locale = get_locale() + return numbers.format_scientific(number, format=format, locale=locale) + + +class Domain(object): + """Localization domain. By default will use look for tranlations in Flask + application directory and "messages" domain - all message catalogs should + be called ``messages.mo``. + """ + + def __init__(self, translation_directories=None, domain='messages'): + if isinstance(translation_directories, str): + translation_directories = [translation_directories] + self._translation_directories = translation_directories + self.domain = domain + self.cache = {} + + def __repr__(self): + return ''.format(self._translation_directories, self.domain) + + @property + def translation_directories(self): + if self._translation_directories is not None: + return self._translation_directories + babel = current_app.extensions['babel'] + return babel.translation_directories + + def as_default(self): + """Set this domain as default for the current request""" + ctx = _get_current_context() + + if ctx is None: + raise RuntimeError("No request context") + + ctx.babel_domain = self + + def get_translations_cache(self, ctx): + """Returns dictionary-like object for translation caching""" + return self.cache + + def get_translations(self): + ctx = _get_current_context() + + if ctx is None: + return support.NullTranslations() + + cache = self.get_translations_cache(ctx) + locale = get_locale() + try: + return cache[str(locale), self.domain] + except KeyError: + translations = support.Translations() + + for dirname in self.translation_directories: + catalog = support.Translations.load( + dirname, + [locale], + self.domain + ) + translations.merge(catalog) + # FIXME: Workaround for merge() being really, really stupid. It + # does not copy _info, plural(), or any other instance variables + # populated by GNUTranslations. We probably want to stop using + # `support.Translations.merge` entirely. + if hasattr(catalog, 'plural'): + translations.plural = catalog.plural + + cache[str(locale), self.domain] = translations + return translations + + def gettext(self, string, **variables): + """Translates a string with the current locale and passes in the + given keyword arguments as mapping to a string formatting string. + + :: + + gettext(u'Hello World!') + gettext(u'Hello %(name)s!', name='World') + """ + t = self.get_translations() + s = t.ugettext(string) + return s if not variables else s % variables + + def ngettext(self, singular, plural, num, **variables): + """Translates a string with the current locale and passes in the + given keyword arguments as mapping to a string formatting string. + The `num` parameter is used to dispatch between singular and various + plural forms of the message. It is available in the format string + as ``%(num)d`` or ``%(num)s``. The source language should be + English or a similar language which only has one plural form. + + :: + + ngettext(u'%(num)d Apple', u'%(num)d Apples', num=len(apples)) + """ + variables.setdefault('num', num) + t = self.get_translations() + s = t.ungettext(singular, plural, num) + return s if not variables else s % variables + + def pgettext(self, context, string, **variables): + """Like :func:`gettext` but with a context. + + .. versionadded:: 0.7 + """ + t = self.get_translations() + s = t.upgettext(context, string) + return s if not variables else s % variables + + def npgettext(self, context, singular, plural, num, **variables): + """Like :func:`ngettext` but with a context. + + .. versionadded:: 0.7 + """ + variables.setdefault('num', num) + t = self.get_translations() + s = t.unpgettext(context, singular, plural, num) + return s if not variables else s % variables + + def lazy_gettext(self, string, **variables): + """Like :func:`gettext` but the string returned is lazy which means + it will be translated when it is used as an actual string. + + Example:: + + hello = lazy_gettext(u'Hello World') + + @app.route('/') + def index(): + return unicode(hello) + """ + return LazyString(self.gettext, string, **variables) + + def lazy_ngettext(self, singular, plural, num, **variables): + """Like :func:`ngettext` but the string returned is lazy which means + it will be translated when it is used as an actual string. + + Example:: + + apples = lazy_ngettext(u'%(num)d Apple', u'%(num)d Apples', num=len(apples)) + + @app.route('/') + def index(): + return unicode(apples) + """ + return LazyString(self.ngettext, singular, plural, num, **variables) + + def lazy_pgettext(self, context, string, **variables): + """Like :func:`pgettext` but the string returned is lazy which means + it will be translated when it is used as an actual string. + + .. versionadded:: 0.7 + """ + return LazyString(self.pgettext, context, string, **variables) + + +def _get_current_context(): + if has_request_context(): + return request + + if current_app: + return current_app + + +def get_domain(): + ctx = _get_current_context() + if ctx is None: + # this will use NullTranslations + return Domain() + + try: + return ctx.babel_domain + except AttributeError: + pass + + babel = current_app.extensions['babel'] + ctx.babel_domain = babel.domain_instance + return ctx.babel_domain + + +# Create shortcuts for the default Flask domain +def gettext(*args, **kwargs): + return get_domain().gettext(*args, **kwargs) +_ = gettext + + +def ngettext(*args, **kwargs): + return get_domain().ngettext(*args, **kwargs) + + +def pgettext(*args, **kwargs): + return get_domain().pgettext(*args, **kwargs) + + +def npgettext(*args, **kwargs): + return get_domain().npgettext(*args, **kwargs) + + +def lazy_gettext(*args, **kwargs): + return LazyString(gettext, *args, **kwargs) + + +def lazy_pgettext(*args, **kwargs): + return LazyString(pgettext, *args, **kwargs) + + +def lazy_ngettext(*args, **kwargs): + return LazyString(ngettext, *args, **kwargs) diff --git a/venv/Lib/site-packages/flask_babel/__pycache__/__init__.cpython-313.pyc b/venv/Lib/site-packages/flask_babel/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..31afbaf69bb3f018c0382605667aa0474181d92c Binary files /dev/null and b/venv/Lib/site-packages/flask_babel/__pycache__/__init__.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask_babel/__pycache__/speaklater.cpython-313.pyc b/venv/Lib/site-packages/flask_babel/__pycache__/speaklater.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7e7a982f2347e22667da56406c2a857b24e0de9a Binary files /dev/null and b/venv/Lib/site-packages/flask_babel/__pycache__/speaklater.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask_babel/speaklater.py b/venv/Lib/site-packages/flask_babel/speaklater.py new file mode 100644 index 0000000000000000000000000000000000000000..46bd272501276b4a8a8f0148e2e9399e81dc4263 --- /dev/null +++ b/venv/Lib/site-packages/flask_babel/speaklater.py @@ -0,0 +1,75 @@ +class LazyString(object): + def __init__(self, func, *args, **kwargs): + self._func = func + self._args = args + self._kwargs = kwargs + + def __getattr__(self, attr): + if attr == "__setstate__": + raise AttributeError(attr) + + string = str(self) + if hasattr(string, attr): + return getattr(string, attr) + + raise AttributeError(attr) + + def __repr__(self): + return "l'{0}'".format(str(self)) + + def __str__(self): + return str(self._func(*self._args, **self._kwargs)) + + def __len__(self): + return len(str(self)) + + def __getitem__(self, key): + return str(self)[key] + + def __iter__(self): + return iter(str(self)) + + def __contains__(self, item): + return item in str(self) + + def __add__(self, other): + return str(self) + other + + def __radd__(self, other): + return other + str(self) + + def __mul__(self, other): + return str(self) * other + + def __rmul__(self, other): + return other * str(self) + + def __lt__(self, other): + return str(self) < other + + def __le__(self, other): + return str(self) <= other + + def __eq__(self, other): + return str(self) == other + + def __ne__(self, other): + return str(self) != other + + def __gt__(self, other): + return str(self) > other + + def __ge__(self, other): + return str(self) >= other + + def __html__(self): + return str(self) + + def __hash__(self): + return hash(str(self)) + + def __mod__(self, other): + return str(self) % other + + def __rmod__(self, other): + return other + str(self) diff --git a/venv/Lib/site-packages/flask_helpers-0.1.dist-info/INSTALLER b/venv/Lib/site-packages/flask_helpers-0.1.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/venv/Lib/site-packages/flask_helpers-0.1.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/venv/Lib/site-packages/flask_helpers-0.1.dist-info/METADATA b/venv/Lib/site-packages/flask_helpers-0.1.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..f7b4e4f418b085bf37b7f4be411f1c0e02ee479b --- /dev/null +++ b/venv/Lib/site-packages/flask_helpers-0.1.dist-info/METADATA @@ -0,0 +1,11 @@ +Metadata-Version: 2.4 +Name: flask_helpers +Version: 0.1 +Summary: Useful stuff for Flask application +Home-page: https://github.com/seecloud/flask-helpers +Author: Alexander Maretskiy +Author-email: amaretskiy@mirantis.com +Dynamic: author +Dynamic: author-email +Dynamic: home-page +Dynamic: summary diff --git a/venv/Lib/site-packages/flask_helpers-0.1.dist-info/RECORD b/venv/Lib/site-packages/flask_helpers-0.1.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..c940af494a795d762c42e7c210cb4761a79caf82 --- /dev/null +++ b/venv/Lib/site-packages/flask_helpers-0.1.dist-info/RECORD @@ -0,0 +1,11 @@ +flask_helpers-0.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +flask_helpers-0.1.dist-info/METADATA,sha256=9SJulu7t20Ry3DC4AM6Oc_TdgBT_DgNvO8sm6vHEkG0,303 +flask_helpers-0.1.dist-info/RECORD,, +flask_helpers-0.1.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +flask_helpers-0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91 +flask_helpers-0.1.dist-info/top_level.txt,sha256=AxLA5iWAe5awNXIW8gJxEc_q9uF_00HGO18E2eZMlBo,14 +flask_helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +flask_helpers/__pycache__/__init__.cpython-313.pyc,, +flask_helpers/__pycache__/routing.cpython-313.pyc,, +flask_helpers/routing.py,sha256=RXKlpbv_HrRx_T8yo_P21CzbNUh3ZukXh4BzcvgavNU,2193 +flask_helpers/templates/routing_map.html,sha256=oSf7pp1zohMMoPrj4D6pGcYZH4XSnIjbJUQh79DblvI,1214 diff --git a/venv/Lib/site-packages/flask_helpers-0.1.dist-info/REQUESTED b/venv/Lib/site-packages/flask_helpers-0.1.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/venv/Lib/site-packages/flask_helpers-0.1.dist-info/WHEEL b/venv/Lib/site-packages/flask_helpers-0.1.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..e7fa31b6f3f78deb1022c1f7927f07d4d16da822 --- /dev/null +++ b/venv/Lib/site-packages/flask_helpers-0.1.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: setuptools (80.9.0) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/venv/Lib/site-packages/flask_helpers-0.1.dist-info/top_level.txt b/venv/Lib/site-packages/flask_helpers-0.1.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..f8852b77cd1fdf13578d348d6634786163eae800 --- /dev/null +++ b/venv/Lib/site-packages/flask_helpers-0.1.dist-info/top_level.txt @@ -0,0 +1 @@ +flask_helpers diff --git a/venv/Lib/site-packages/flask_helpers/__init__.py b/venv/Lib/site-packages/flask_helpers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/venv/Lib/site-packages/flask_helpers/__pycache__/__init__.cpython-313.pyc b/venv/Lib/site-packages/flask_helpers/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4a0e30b6ec8915eb97a67ccb6cff52d02eea5863 Binary files /dev/null and b/venv/Lib/site-packages/flask_helpers/__pycache__/__init__.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask_helpers/__pycache__/routing.cpython-313.pyc b/venv/Lib/site-packages/flask_helpers/__pycache__/routing.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..042fc01a325e63ef111cd1b45ff5bbf1d5c56701 Binary files /dev/null and b/venv/Lib/site-packages/flask_helpers/__pycache__/routing.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask_helpers/routing.py b/venv/Lib/site-packages/flask_helpers/routing.py new file mode 100644 index 0000000000000000000000000000000000000000..88e57faafc5517403f458aa6a9a353f3ca46ec87 --- /dev/null +++ b/venv/Lib/site-packages/flask_helpers/routing.py @@ -0,0 +1,62 @@ +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + +import flask + + +def get_routing_list(app): + """Make a sumple list of routing rules. + + :param app: Flask application + :returns: list of routes + """ + routes = [] + for route in app.url_map.iter_rules(): + routes.append({"uri": route.rule, + "methods": sorted(list(route.methods)), + "endpoint": route.endpoint}) + routes.sort(key=lambda d: d["uri"]) + return routes + + +def add_routing_map(app, + html_uri="/map.html", + json_uri="/map.json", + html_endpoint="routing_map_html", + json_endpoint="routing_map_json"): + """Register blueprint with routing map pages. + + :param app: Flask application + :param html_uri: str URI for HTML page, + None if disabled + :param json_uri: str URI for JSON page, + None if disabled + :param html_endpoint: str endpoint for HTML page + :param json_endpoint: str endpoint for JSON page + :returns: Flask application + """ + bp = flask.Blueprint("routing_map", __name__, + template_folder="templates") + routes = get_routing_list(app) + if html_uri: + bp.route(html_uri, endpoint=html_endpoint)( + lambda: flask.render_template("routing_map.html", + routes=routes, + json_uri=json_uri)) + if json_uri: + bp.route(json_uri, endpoint=json_endpoint)( + lambda: flask.jsonify(routes)) + app.register_blueprint(bp) + return app diff --git a/venv/Lib/site-packages/flask_helpers/templates/routing_map.html b/venv/Lib/site-packages/flask_helpers/templates/routing_map.html new file mode 100644 index 0000000000000000000000000000000000000000..31668ddda1a89962743fc30410562511be61bb97 --- /dev/null +++ b/venv/Lib/site-packages/flask_helpers/templates/routing_map.html @@ -0,0 +1,47 @@ + + + + + + Routing Map + + + +
+ Routing Map +
+
+ + {% if json_uri %} + + {% endif %} + + + + + {% for route in routes %} + + {% endfor %} + +
URL + Methods + Endpoint +
{{route.uri}} + {% for m in route.methods %} {{m}}{% endfor %} + {{route.endpoint}} +
+
+ + diff --git a/venv/Lib/site-packages/flask_mail-0.10.0.dist-info/INSTALLER b/venv/Lib/site-packages/flask_mail-0.10.0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/venv/Lib/site-packages/flask_mail-0.10.0.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/venv/Lib/site-packages/flask_mail-0.10.0.dist-info/LICENSE.txt b/venv/Lib/site-packages/flask_mail-0.10.0.dist-info/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..a5f1b46a997610f8f09e4e720001662bb1c37315 --- /dev/null +++ b/venv/Lib/site-packages/flask_mail-0.10.0.dist-info/LICENSE.txt @@ -0,0 +1,28 @@ +BSD 3-Clause License + +Copyright (c) 2010 Pallets + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/venv/Lib/site-packages/flask_mail-0.10.0.dist-info/METADATA b/venv/Lib/site-packages/flask_mail-0.10.0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..a453f182dd20db6dbf8a39f471022489ee1b7d48 --- /dev/null +++ b/venv/Lib/site-packages/flask_mail-0.10.0.dist-info/METADATA @@ -0,0 +1,68 @@ +Metadata-Version: 2.1 +Name: Flask-Mail +Version: 0.10.0 +Summary: Flask extension for sending email +Author: Dan Jacob +Maintainer-email: Pallets Ecosystem +Requires-Python: >=3.8 +Description-Content-Type: text/markdown +Classifier: Development Status :: 4 - Beta +Classifier: Framework :: Flask +Classifier: License :: OSI Approved :: BSD License +Classifier: Programming Language :: Python +Classifier: Typing :: Typed +Requires-Dist: flask +Requires-Dist: blinker +Project-URL: Changes, https://flask-mail.readthedocs.io/en/latest/changes/ +Project-URL: Chat, https://discord.gg/pallets +Project-URL: Documentation, https://flask-mail.readthedocs.io +Project-URL: Source, https://github.com/pallets-eco/flask-mail/ + +# Flask-Mail + +Flask-Mail is an extension for [Flask] that makes it easy to send emails from +your application. It simplifies the process of integrating email functionality, +allowing you to focus on building great features for your application. + +[flask]: https://flask.palletsprojects.com + + +## Pallets Community Ecosystem + +> [!IMPORTANT]\ +> This project is part of the Pallets Community Ecosystem. Pallets is the open +> source organization that maintains Flask; Pallets-Eco enables community +> maintenance of related projects. If you are interested in helping maintain +> this project, please reach out on [the Pallets Discord server][discord]. + +[discord]: https://discord.gg/pallets + + +## A Simple Example + +```python +from flask import Flask +from flask_mail import Mail, Message + +app = Flask(__name__) +app.config['MAIL_SERVER'] = 'your_mail_server' +app.config['MAIL_PORT'] = 587 +app.config['MAIL_USE_TLS'] = True +app.config['MAIL_USE_SSL'] = False +app.config['MAIL_USERNAME'] = 'your_username' +app.config['MAIL_PASSWORD'] = 'your_password' +app.config['MAIL_DEFAULT_SENDER'] = 'your_email@example.com' + +mail = Mail(app) + +@app.route('/') +def send_email(): + msg = Message( + 'Hello', + recipients=['recipient@example.com'], + body='This is a test email sent from Flask-Mail!' + ) + mail.send(msg) + return 'Email sent succesfully!' +``` + diff --git a/venv/Lib/site-packages/flask_mail-0.10.0.dist-info/RECORD b/venv/Lib/site-packages/flask_mail-0.10.0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..0fd9fe10b13c40de429c9bab86d2adfdc46b35e6 --- /dev/null +++ b/venv/Lib/site-packages/flask_mail-0.10.0.dist-info/RECORD @@ -0,0 +1,9 @@ +flask_mail-0.10.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +flask_mail-0.10.0.dist-info/LICENSE.txt,sha256=NjGx7g1yxwNiJgUwLiQ9Fbx4Mtmlg13y-FTw0pk5y8M,1493 +flask_mail-0.10.0.dist-info/METADATA,sha256=NeD-q9ct7BhNLCuIpeQbrlh53eUhfhGTgv7hUbFOvAg,2070 +flask_mail-0.10.0.dist-info/RECORD,, +flask_mail-0.10.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +flask_mail-0.10.0.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81 +flask_mail/__init__.py,sha256=9kmcIKZe6ZnajZLUmexrX13kSuRv6pWwofztlU__ZlA,20841 +flask_mail/__pycache__/__init__.cpython-313.pyc,, +flask_mail/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 diff --git a/venv/Lib/site-packages/flask_mail-0.10.0.dist-info/REQUESTED b/venv/Lib/site-packages/flask_mail-0.10.0.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/venv/Lib/site-packages/flask_mail-0.10.0.dist-info/WHEEL b/venv/Lib/site-packages/flask_mail-0.10.0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..3b5e64b5e6c4a210201d1676a891fd57b15cda99 --- /dev/null +++ b/venv/Lib/site-packages/flask_mail-0.10.0.dist-info/WHEEL @@ -0,0 +1,4 @@ +Wheel-Version: 1.0 +Generator: flit 3.9.0 +Root-Is-Purelib: true +Tag: py3-none-any diff --git a/venv/Lib/site-packages/flask_mail/__init__.py b/venv/Lib/site-packages/flask_mail/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..697ce0f32edd4efe353fe84a1960d2f9c6b0be96 --- /dev/null +++ b/venv/Lib/site-packages/flask_mail/__init__.py @@ -0,0 +1,660 @@ +from __future__ import annotations + +import collections.abc as c +import re +import smtplib +import time +import typing as t +import unicodedata +import warnings +from contextlib import contextmanager +from email import charset +from email import policy +from email.encoders import encode_base64 +from email.header import Header +from email.mime.base import MIMEBase +from email.mime.multipart import MIMEMultipart +from email.mime.text import MIMEText +from email.utils import formataddr +from email.utils import formatdate +from email.utils import make_msgid +from email.utils import parseaddr +from mimetypes import guess_type +from types import TracebackType + +import blinker +from flask import current_app +from flask import Flask + +if t.TYPE_CHECKING: + import typing_extensions as te + +charset.add_charset("utf-8", charset.SHORTEST, None, "utf-8") + + +class FlaskMailUnicodeDecodeError(UnicodeDecodeError): + def __init__(self, obj: t.Any, *args: t.Any) -> None: + self.obj = obj + super().__init__(*args) + + def __str__(self) -> str: + original = super().__str__() + return f"{original}. You passed in {self.obj!r} ({type(self.obj)})" + + +def force_text(s: t.Any, encoding: str = "utf-8", errors: str = "strict") -> str: + """ + Similar to smart_text, except that lazy instances are resolved to + strings, rather than kept as lazy objects. + """ + if isinstance(s, str): + return s + + try: + if isinstance(s, bytes): + out = str(s, encoding, errors) + else: + out = str(s) + except UnicodeDecodeError as e: + if not isinstance(s, Exception): + raise FlaskMailUnicodeDecodeError(s, *e.args) from e + + out = " ".join([force_text(arg, encoding, errors) for arg in s.args]) + + return out + + +def sanitize_subject(subject: str, encoding: str = "utf-8") -> str: + try: + subject.encode("ascii") + except UnicodeEncodeError: + try: + subject = Header(subject, encoding).encode() + except UnicodeEncodeError: + subject = Header(subject, "utf-8").encode() + + return subject + + +def sanitize_address(addr: str | tuple[str, str], encoding: str = "utf-8") -> str: + if isinstance(addr, str): + addr = parseaddr(force_text(addr)) + + nm, addr = addr + + try: + nm = Header(nm, encoding).encode() + except UnicodeEncodeError: + nm = Header(nm, "utf-8").encode() + + try: + addr.encode("ascii") + except UnicodeEncodeError: # IDN + if "@" in addr: + localpart, domain = addr.split("@", 1) + localpart = str(Header(localpart, encoding)) + domain = domain.encode("idna").decode("ascii") + addr = "@".join([localpart, domain]) + else: + addr = Header(addr, encoding).encode() + + return formataddr((nm, addr)) + + +def sanitize_addresses( + addresses: c.Iterable[str | tuple[str, str]], encoding: str = "utf-8" +) -> list[str]: + return [sanitize_address(e, encoding) for e in addresses] + + +def _has_newline(line: str) -> bool: + """Used by has_bad_header to check for \\r or \\n""" + return "\n" in line or "\r" in line + + +class Connection: + """Handles connection to host.""" + + def __init__(self, mail: Mail) -> None: + self.mail = mail + self.host: smtplib.SMTP | smtplib.SMTP_SSL | None = None + self.num_emails: int = 0 + + def __enter__(self) -> te.Self: + if self.mail.suppress: + self.host = None + else: + self.host = self.configure_host() + + self.num_emails = 0 + return self + + def __exit__( + self, exc_type: type[BaseException], exc_value: BaseException, tb: TracebackType + ) -> None: + if self.host is not None: + self.host.quit() + + def configure_host(self) -> smtplib.SMTP | smtplib.SMTP_SSL: + host: smtplib.SMTP | smtplib.SMTP_SSL + + if self.mail.use_ssl: + host = smtplib.SMTP_SSL(self.mail.server, self.mail.port) + else: + host = smtplib.SMTP(self.mail.server, self.mail.port) + + host.set_debuglevel(int(self.mail.debug)) + + if self.mail.use_tls: + host.starttls() + + if self.mail.username and self.mail.password: + host.login(self.mail.username, self.mail.password) + + return host + + def send( + self, message: Message, envelope_from: str | tuple[str, str] | None = None + ) -> None: + """Verifies and sends message. + + :param message: Message instance. + :param envelope_from: Email address to be used in MAIL FROM command. + """ + assert message.send_to, "No recipients have been added" + assert message.sender, ( + "The message does not specify a sender and a default sender " + "has not been configured" + ) + + if message.has_bad_headers(): + raise BadHeaderError + + if message.date is None: + message.date = time.time() + + if self.host is not None: + self.host.sendmail( + sanitize_address(envelope_from or message.sender), + list(sanitize_addresses(message.send_to)), + message.as_bytes(), + message.mail_options, + message.rcpt_options, + ) + + app = current_app._get_current_object() # type: ignore[attr-defined] + email_dispatched.send(app, message=message) + self.num_emails += 1 + + if self.num_emails == self.mail.max_emails: + self.num_emails = 0 + + if self.host: + self.host.quit() + self.host = self.configure_host() + + def send_message(self, *args: t.Any, **kwargs: t.Any) -> None: + """Shortcut for send(msg). + + Takes same arguments as Message constructor. + + :versionadded: 0.3.5 + """ + self.send(Message(*args, **kwargs)) + + +class BadHeaderError(Exception): + pass + + +class Attachment: + """Encapsulates file attachment information. + + :param filename: filename of attachment + :param content_type: file mimetype + :param data: the raw file data + :param disposition: content-disposition (if any) + + .. versionchanged:: 0.10.0 + The `data` argument is required. + + .. versionadded: 0.3.5 + """ + + def __init__( + self, + filename: str | None = None, + content_type: str | None = None, + data: str | bytes | None = None, + disposition: str | None = None, + headers: dict[str, str] | None = None, + ): + if data is None: + raise ValueError("The 'data' argument is required.") + + self.data: str | bytes = data + + if content_type is None and filename is not None: + content_type = guess_type(filename)[0] + + if content_type is None: + if isinstance(data, str): + content_type = "text/plain" + else: + content_type = "application/octet-stream" + + self.filename: str | None = filename + self.content_type: str = content_type + self.disposition: str = disposition or "attachment" + + if headers is None: + headers = {} + + self.headers: dict[str, str] = headers + + +class Message: + """Encapsulates an email message. + + :param subject: email subject header + :param recipients: list of email addresses + :param body: plain text message + :param html: HTML message + :param alts: A dict or an iterable to go through dict() that contains multipart + alternatives + :param sender: email sender address, or **MAIL_DEFAULT_SENDER** by default + :param cc: CC list + :param bcc: BCC list + :param attachments: list of Attachment instances + :param reply_to: reply-to address + :param date: send date + :param charset: message character set + :param extra_headers: A dictionary of additional headers for the message + :param mail_options: A list of ESMTP options to be used in MAIL FROM command + :param rcpt_options: A list of ESMTP options to be used in RCPT commands + """ + + def __init__( + self, + subject: str = "", + recipients: list[str | tuple[str, str]] | None = None, + body: str | None = None, + html: str | None = None, + alts: dict[str, str] | c.Iterable[tuple[str, str]] | None = None, + sender: str | tuple[str, str] | None = None, + cc: list[str | tuple[str, str]] | None = None, + bcc: list[str | tuple[str, str]] | None = None, + attachments: list[Attachment] | None = None, + reply_to: str | tuple[str, str] | None = None, + date: float | None = None, + charset: str | None = None, + extra_headers: dict[str, str] | None = None, + mail_options: list[str] | None = None, + rcpt_options: list[str] | None = None, + ): + sender = sender or current_app.extensions["mail"].default_sender + + if isinstance(sender, tuple): + sender = f"{sender[0]} <{sender[1]}>" + + self.recipients: list[str | tuple[str, str]] = recipients or [] + self.subject: str = subject + self.sender: str | tuple[str, str] = sender # pyright: ignore + self.reply_to: str | tuple[str, str] | None = reply_to + self.cc: list[str | tuple[str, str]] = cc or [] + self.bcc: list[str | tuple[str, str]] = bcc or [] + self.body: str | None = body + self.alts: dict[str, str] = dict(alts or {}) + self.html: str | None = html + self.date: float | None = date + self.msgId: str = make_msgid() + self.charset: str | None = charset + self.extra_headers: dict[str, str] | None = extra_headers + self.mail_options: list[str] = mail_options or [] + self.rcpt_options: list[str] = rcpt_options or [] + self.attachments: list[Attachment] = attachments or [] + + @property + def send_to(self) -> set[str | tuple[str, str]]: + out = set(self.recipients) + + if self.bcc: + out.update(self.bcc) + + if self.cc: + out.update(self.cc) + + return out + + @property + def html(self) -> str | None: # pyright: ignore + return self.alts.get("html") + + @html.setter + def html(self, value: str | None) -> None: # pyright: ignore + if value is None: + self.alts.pop("html", None) + else: + self.alts["html"] = value + + def _mimetext(self, text: str | None, subtype: str = "plain") -> MIMEText: + """Creates a MIMEText object with the given subtype (default: 'plain') + If the text is unicode, the utf-8 charset is used. + """ + charset = self.charset or "utf-8" + return MIMEText(text, _subtype=subtype, _charset=charset) # type: ignore[arg-type] + + def _message(self) -> MIMEBase: + """Creates the email""" + ascii_attachments = current_app.extensions["mail"].ascii_attachments + encoding = self.charset or "utf-8" + attachments = self.attachments or [] + msg: MIMEBase + + if len(attachments) == 0 and not self.alts: + # No html content and zero attachments means plain text + msg = self._mimetext(self.body) + elif len(attachments) > 0 and not self.alts: + # No html and at least one attachment means multipart + msg = MIMEMultipart() + msg.attach(self._mimetext(self.body)) + else: + # Anything else + msg = MIMEMultipart() + alternative = MIMEMultipart("alternative") + alternative.attach(self._mimetext(self.body, "plain")) + + for mimetype, content in self.alts.items(): + alternative.attach(self._mimetext(content, mimetype)) + + msg.attach(alternative) + + if self.subject: + msg["Subject"] = sanitize_subject(force_text(self.subject), encoding) + + msg["From"] = sanitize_address(self.sender, encoding) + msg["To"] = ", ".join(list(set(sanitize_addresses(self.recipients, encoding)))) + msg["Date"] = formatdate(self.date, localtime=True) + # see RFC 5322 section 3.6.4. + msg["Message-ID"] = self.msgId + + if self.cc: + msg["Cc"] = ", ".join(list(set(sanitize_addresses(self.cc, encoding)))) + + if self.reply_to: + msg["Reply-To"] = sanitize_address(self.reply_to, encoding) + + if self.extra_headers: + for k, v in self.extra_headers.items(): + msg[k] = v + + SPACES = re.compile(r"[\s]+", re.UNICODE) + + for attachment in attachments: + f = MIMEBase(*attachment.content_type.split("/")) + f.set_payload(attachment.data) + encode_base64(f) + + if attachment.filename is not None: + filename = attachment.filename + + if ascii_attachments: + # force filename to ascii + filename = unicodedata.normalize("NFKD", attachment.filename) + filename = filename.encode("ascii", "ignore").decode("ascii") + filename = SPACES.sub(" ", filename).strip() + + try: + filename.encode("ascii") + except UnicodeEncodeError: + f.add_header( + "Content-Disposition", + attachment.disposition, + filename=("UTF8", "", filename), + ) + else: + f.add_header( + "Content-Disposition", attachment.disposition, filename=filename + ) + + for key, value in attachment.headers.items(): + f.add_header(key, value) + + msg.attach(f) + + msg.policy = policy.SMTP + return msg + + def as_string(self) -> str: + return self._message().as_string() + + def as_bytes(self) -> bytes: + return self._message().as_bytes() + + def __str__(self) -> str: + return self.as_string() + + def __bytes__(self) -> bytes: + return self.as_bytes() + + def has_bad_headers(self) -> bool: + """Checks for bad headers i.e. newlines in subject, sender or recipients. + RFC5322: Allows multiline CRLF with trailing whitespace (FWS) in headers + """ + headers = [self.sender, *self.recipients] + + if self.reply_to: + headers.append(self.reply_to) + + for header in headers: + if isinstance(header, tuple): + header = f"{header[0]} <{header[1]}>" + + if _has_newline(header): + return True + + if self.subject: + if _has_newline(self.subject): + for linenum, line in enumerate(self.subject.split("\r\n")): + if not line: + return True + if linenum > 0 and line[0] not in "\t ": + return True + if _has_newline(line): + return True + if len(line.strip()) == 0: + return True + + return False + + def is_bad_headers(self) -> bool: + warnings.warn( + "'is_bad_headers' is renamed to 'has_bad_headers'. The old name is" + " deprecated and will be removed in Flask-Mail 1.0.", + DeprecationWarning, + stacklevel=2, + ) + return self.has_bad_headers() + + def send(self, connection: Connection) -> None: + """Verifies and sends the message.""" + + connection.send(self) + + def add_recipient(self, recipient: str | tuple[str, str]) -> None: + """Adds another recipient to the message. + + :param recipient: email address of recipient. + """ + + self.recipients.append(recipient) + + def attach( + self, + filename: str | None = None, + content_type: str | None = None, + data: str | bytes | None = None, + disposition: str | None = None, + headers: dict[str, str] | None = None, + ) -> None: + """Adds an attachment to the message. + + :param filename: filename of attachment + :param content_type: file mimetype + :param data: the raw file data + :param disposition: content-disposition (if any) + """ + self.attachments.append( + Attachment(filename, content_type, data, disposition, headers) + ) + + +class _MailMixin: + @contextmanager + def record_messages(self) -> c.Iterator[list[Message]]: + """Records all messages. Use in unit tests for example:: + + with mail.record_messages() as outbox: + response = app.test_client.get("/email-sending-view/") + assert len(outbox) == 1 + assert outbox[0].subject == "testing" + + :versionadded: 0.4 + """ + outbox = [] + + def record(app: Flask, message: Message) -> None: + outbox.append(message) + + with email_dispatched.connected_to(record): + yield outbox + + def send(self, message: Message) -> None: + """Sends a single message instance. If TESTING is True the message will + not actually be sent. + + :param message: a Message instance. + """ + + with self.connect() as connection: + message.send(connection) + + def send_message(self, *args: t.Any, **kwargs: t.Any) -> None: + """Shortcut for send(msg). + + Takes same arguments as Message constructor. + + :versionadded: 0.3.5 + """ + + self.send(Message(*args, **kwargs)) + + def connect(self) -> Connection: + """Opens a connection to the mail host.""" + app = getattr(self, "app", None) or current_app + + try: + return Connection(app.extensions["mail"]) + except KeyError as err: + raise RuntimeError( + "The current application was not configured with Flask-Mail" + ) from err + + +class _Mail(_MailMixin): + def __init__( + self, + server: str, + username: str | None, + password: str | None, + port: int | None, + use_tls: bool, + use_ssl: bool, + default_sender: str | None, + debug: int, + max_emails: int | None, + suppress: bool, + ascii_attachments: bool, + ): + self.server = server + self.username = username + self.password = password + self.port = port + self.use_tls = use_tls + self.use_ssl = use_ssl + self.default_sender = default_sender + self.debug = debug + self.max_emails = max_emails + self.suppress = suppress + self.ascii_attachments = ascii_attachments + + +class Mail(_MailMixin): + """Manages email messaging.""" + + def __init__(self, app: Flask | None = None) -> None: + self.app = app + + if app is not None: + self.state: _Mail | None = self.init_app(app) + else: + self.state = None + + def init_mail( + self, config: dict[str, t.Any], debug: bool | int = False, testing: bool = False + ) -> _Mail: + return _Mail( + config.get("MAIL_SERVER", "127.0.0.1"), + config.get("MAIL_USERNAME"), + config.get("MAIL_PASSWORD"), + config.get("MAIL_PORT", 25), + config.get("MAIL_USE_TLS", False), + config.get("MAIL_USE_SSL", False), + config.get("MAIL_DEFAULT_SENDER"), + int(config.get("MAIL_DEBUG", debug)), + config.get("MAIL_MAX_EMAILS"), + config.get("MAIL_SUPPRESS_SEND", testing), + config.get("MAIL_ASCII_ATTACHMENTS", False), + ) + + def init_app(self, app: Flask) -> _Mail: + """Initializes your mail settings from the application settings. + + You can use this if you want to set up your Mail instance + at configuration time. + """ + state = self.init_mail(app.config, app.debug, app.testing) + + # register extension with app + app.extensions = getattr(app, "extensions", {}) + app.extensions["mail"] = state + return state + + def __getattr__(self, name: str) -> t.Any: + return getattr(self.state, name, None) + + +signals: blinker.Namespace = blinker.Namespace() +email_dispatched: blinker.NamedSignal = signals.signal( + "email-dispatched", + doc=""" +Signal sent when an email is dispatched. This signal will also be sent +in testing mode, even though the email will not actually be sent. +""", +) + + +def __getattr__(name: str) -> t.Any: + if name == "__version__": + import importlib.metadata + + warnings.warn( + "The '__version__' attribute is deprecated and will be removed in" + " Flask-Mail 1.0. Use feature detection or" + " 'importlib.metadata.version(\"flask-mail\")' instead.", + DeprecationWarning, + stacklevel=2, + ) + return importlib.metadata.version("flask-mail") + + raise AttributeError(name) diff --git a/venv/Lib/site-packages/flask_mail/__pycache__/__init__.cpython-313.pyc b/venv/Lib/site-packages/flask_mail/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..89cacf83f8565cf955bf5336dc8a25a40950435e Binary files /dev/null and b/venv/Lib/site-packages/flask_mail/__pycache__/__init__.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/flask_mail/py.typed b/venv/Lib/site-packages/flask_mail/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/venv/Lib/site-packages/itsdangerous-2.2.0.dist-info/INSTALLER b/venv/Lib/site-packages/itsdangerous-2.2.0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/venv/Lib/site-packages/itsdangerous-2.2.0.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/venv/Lib/site-packages/itsdangerous-2.2.0.dist-info/LICENSE.txt b/venv/Lib/site-packages/itsdangerous-2.2.0.dist-info/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..7b190ca6712aa09eede3e6de79f68d7fa29072da --- /dev/null +++ b/venv/Lib/site-packages/itsdangerous-2.2.0.dist-info/LICENSE.txt @@ -0,0 +1,28 @@ +Copyright 2011 Pallets + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/venv/Lib/site-packages/itsdangerous-2.2.0.dist-info/METADATA b/venv/Lib/site-packages/itsdangerous-2.2.0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..ddf54648499557c652181f6126362ffd5751c273 --- /dev/null +++ b/venv/Lib/site-packages/itsdangerous-2.2.0.dist-info/METADATA @@ -0,0 +1,60 @@ +Metadata-Version: 2.1 +Name: itsdangerous +Version: 2.2.0 +Summary: Safely pass data to untrusted environments and back. +Maintainer-email: Pallets +Requires-Python: >=3.8 +Description-Content-Type: text/markdown +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Typing :: Typed +Project-URL: Changes, https://itsdangerous.palletsprojects.com/changes/ +Project-URL: Chat, https://discord.gg/pallets +Project-URL: Documentation, https://itsdangerous.palletsprojects.com/ +Project-URL: Donate, https://palletsprojects.com/donate +Project-URL: Source, https://github.com/pallets/itsdangerous/ + +# ItsDangerous + +... so better sign this + +Various helpers to pass data to untrusted environments and to get it +back safe and sound. Data is cryptographically signed to ensure that a +token has not been tampered with. + +It's possible to customize how data is serialized. Data is compressed as +needed. A timestamp can be added and verified automatically while +loading a token. + + +## A Simple Example + +Here's how you could generate a token for transmitting a user's id and +name between web requests. + +```python +from itsdangerous import URLSafeSerializer +auth_s = URLSafeSerializer("secret key", "auth") +token = auth_s.dumps({"id": 5, "name": "itsdangerous"}) + +print(token) +# eyJpZCI6NSwibmFtZSI6Iml0c2Rhbmdlcm91cyJ9.6YP6T0BaO67XP--9UzTrmurXSmg + +data = auth_s.loads(token) +print(data["name"]) +# itsdangerous +``` + + +## Donate + +The Pallets organization develops and supports ItsDangerous and other +popular packages. In order to grow the community of contributors and +users, and allow the maintainers to devote more time to the projects, +[please donate today][]. + +[please donate today]: https://palletsprojects.com/donate + diff --git a/venv/Lib/site-packages/itsdangerous-2.2.0.dist-info/RECORD b/venv/Lib/site-packages/itsdangerous-2.2.0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..45d93ecca619cf35b8e462fbc31e791a6c66cff5 --- /dev/null +++ b/venv/Lib/site-packages/itsdangerous-2.2.0.dist-info/RECORD @@ -0,0 +1,22 @@ +itsdangerous-2.2.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +itsdangerous-2.2.0.dist-info/LICENSE.txt,sha256=Y68JiRtr6K0aQlLtQ68PTvun_JSOIoNnvtfzxa4LCdc,1475 +itsdangerous-2.2.0.dist-info/METADATA,sha256=0rk0-1ZwihuU5DnwJVwPWoEI4yWOyCexih3JyZHblhE,1924 +itsdangerous-2.2.0.dist-info/RECORD,, +itsdangerous-2.2.0.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81 +itsdangerous/__init__.py,sha256=4SK75sCe29xbRgQE1ZQtMHnKUuZYAf3bSpZOrff1IAY,1427 +itsdangerous/__pycache__/__init__.cpython-313.pyc,, +itsdangerous/__pycache__/_json.cpython-313.pyc,, +itsdangerous/__pycache__/encoding.cpython-313.pyc,, +itsdangerous/__pycache__/exc.cpython-313.pyc,, +itsdangerous/__pycache__/serializer.cpython-313.pyc,, +itsdangerous/__pycache__/signer.cpython-313.pyc,, +itsdangerous/__pycache__/timed.cpython-313.pyc,, +itsdangerous/__pycache__/url_safe.cpython-313.pyc,, +itsdangerous/_json.py,sha256=wPQGmge2yZ9328EHKF6gadGeyGYCJQKxtU-iLKE6UnA,473 +itsdangerous/encoding.py,sha256=wwTz5q_3zLcaAdunk6_vSoStwGqYWe307Zl_U87aRFM,1409 +itsdangerous/exc.py,sha256=Rr3exo0MRFEcPZltwecyK16VV1bE2K9_F1-d-ljcUn4,3201 +itsdangerous/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +itsdangerous/serializer.py,sha256=PmdwADLqkSyQLZ0jOKAgDsAW4k_H0TlA71Ei3z0C5aI,15601 +itsdangerous/signer.py,sha256=YO0CV7NBvHA6j549REHJFUjUojw2pHqwcUpQnU7yNYQ,9647 +itsdangerous/timed.py,sha256=6RvDMqNumGMxf0-HlpaZdN9PUQQmRvrQGplKhxuivUs,8083 +itsdangerous/url_safe.py,sha256=az4e5fXi_vs-YbWj8YZwn4wiVKfeD--GEKRT5Ueu4P4,2505 diff --git a/venv/Lib/site-packages/itsdangerous-2.2.0.dist-info/WHEEL b/venv/Lib/site-packages/itsdangerous-2.2.0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..3b5e64b5e6c4a210201d1676a891fd57b15cda99 --- /dev/null +++ b/venv/Lib/site-packages/itsdangerous-2.2.0.dist-info/WHEEL @@ -0,0 +1,4 @@ +Wheel-Version: 1.0 +Generator: flit 3.9.0 +Root-Is-Purelib: true +Tag: py3-none-any diff --git a/venv/Lib/site-packages/itsdangerous/__init__.py b/venv/Lib/site-packages/itsdangerous/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ea55256ebd6feed68d8f1c5afedd141df6c7e766 --- /dev/null +++ b/venv/Lib/site-packages/itsdangerous/__init__.py @@ -0,0 +1,38 @@ +from __future__ import annotations + +import typing as t + +from .encoding import base64_decode as base64_decode +from .encoding import base64_encode as base64_encode +from .encoding import want_bytes as want_bytes +from .exc import BadData as BadData +from .exc import BadHeader as BadHeader +from .exc import BadPayload as BadPayload +from .exc import BadSignature as BadSignature +from .exc import BadTimeSignature as BadTimeSignature +from .exc import SignatureExpired as SignatureExpired +from .serializer import Serializer as Serializer +from .signer import HMACAlgorithm as HMACAlgorithm +from .signer import NoneAlgorithm as NoneAlgorithm +from .signer import Signer as Signer +from .timed import TimedSerializer as TimedSerializer +from .timed import TimestampSigner as TimestampSigner +from .url_safe import URLSafeSerializer as URLSafeSerializer +from .url_safe import URLSafeTimedSerializer as URLSafeTimedSerializer + + +def __getattr__(name: str) -> t.Any: + if name == "__version__": + import importlib.metadata + import warnings + + warnings.warn( + "The '__version__' attribute is deprecated and will be removed in" + " ItsDangerous 2.3. Use feature detection or" + " 'importlib.metadata.version(\"itsdangerous\")' instead.", + DeprecationWarning, + stacklevel=2, + ) + return importlib.metadata.version("itsdangerous") + + raise AttributeError(name) diff --git a/venv/Lib/site-packages/itsdangerous/__pycache__/__init__.cpython-313.pyc b/venv/Lib/site-packages/itsdangerous/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b572f78815978e026a56d9e4bf2727d3162e6512 Binary files /dev/null and b/venv/Lib/site-packages/itsdangerous/__pycache__/__init__.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/itsdangerous/__pycache__/_json.cpython-313.pyc b/venv/Lib/site-packages/itsdangerous/__pycache__/_json.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6f07d50fbbcdf7dd89967dd67e67ce44a11fed55 Binary files /dev/null and b/venv/Lib/site-packages/itsdangerous/__pycache__/_json.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/itsdangerous/__pycache__/encoding.cpython-313.pyc b/venv/Lib/site-packages/itsdangerous/__pycache__/encoding.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d276d8bfe58e8800fb45919f46353d9c31827b4d Binary files /dev/null and b/venv/Lib/site-packages/itsdangerous/__pycache__/encoding.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/itsdangerous/__pycache__/exc.cpython-313.pyc b/venv/Lib/site-packages/itsdangerous/__pycache__/exc.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c287a338a43dde24176d49bdd97b5a52ff469464 Binary files /dev/null and b/venv/Lib/site-packages/itsdangerous/__pycache__/exc.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/itsdangerous/__pycache__/serializer.cpython-313.pyc b/venv/Lib/site-packages/itsdangerous/__pycache__/serializer.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ea6c64ecc8eefd5000188fc6a05c26dc019259c9 Binary files /dev/null and b/venv/Lib/site-packages/itsdangerous/__pycache__/serializer.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/itsdangerous/__pycache__/signer.cpython-313.pyc b/venv/Lib/site-packages/itsdangerous/__pycache__/signer.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..07c28cbf3103684a8a947921526b31b04810d9c2 Binary files /dev/null and b/venv/Lib/site-packages/itsdangerous/__pycache__/signer.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/itsdangerous/__pycache__/timed.cpython-313.pyc b/venv/Lib/site-packages/itsdangerous/__pycache__/timed.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8f4a7c83ae3f336f61c87ec96b23ce17c269f534 Binary files /dev/null and b/venv/Lib/site-packages/itsdangerous/__pycache__/timed.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/itsdangerous/__pycache__/url_safe.cpython-313.pyc b/venv/Lib/site-packages/itsdangerous/__pycache__/url_safe.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a3d8a5d5f8c4ecca5c817c2d5271ce02fc91763b Binary files /dev/null and b/venv/Lib/site-packages/itsdangerous/__pycache__/url_safe.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/itsdangerous/_json.py b/venv/Lib/site-packages/itsdangerous/_json.py new file mode 100644 index 0000000000000000000000000000000000000000..fc23feaaff690c477901dc50cc52dd18086051c5 --- /dev/null +++ b/venv/Lib/site-packages/itsdangerous/_json.py @@ -0,0 +1,18 @@ +from __future__ import annotations + +import json as _json +import typing as t + + +class _CompactJSON: + """Wrapper around json module that strips whitespace.""" + + @staticmethod + def loads(payload: str | bytes) -> t.Any: + return _json.loads(payload) + + @staticmethod + def dumps(obj: t.Any, **kwargs: t.Any) -> str: + kwargs.setdefault("ensure_ascii", False) + kwargs.setdefault("separators", (",", ":")) + return _json.dumps(obj, **kwargs) diff --git a/venv/Lib/site-packages/itsdangerous/encoding.py b/venv/Lib/site-packages/itsdangerous/encoding.py new file mode 100644 index 0000000000000000000000000000000000000000..f5ca80f905c9bb29b993c437a89174e668704658 --- /dev/null +++ b/venv/Lib/site-packages/itsdangerous/encoding.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +import base64 +import string +import struct +import typing as t + +from .exc import BadData + + +def want_bytes( + s: str | bytes, encoding: str = "utf-8", errors: str = "strict" +) -> bytes: + if isinstance(s, str): + s = s.encode(encoding, errors) + + return s + + +def base64_encode(string: str | bytes) -> bytes: + """Base64 encode a string of bytes or text. The resulting bytes are + safe to use in URLs. + """ + string = want_bytes(string) + return base64.urlsafe_b64encode(string).rstrip(b"=") + + +def base64_decode(string: str | bytes) -> bytes: + """Base64 decode a URL-safe string of bytes or text. The result is + bytes. + """ + string = want_bytes(string, encoding="ascii", errors="ignore") + string += b"=" * (-len(string) % 4) + + try: + return base64.urlsafe_b64decode(string) + except (TypeError, ValueError) as e: + raise BadData("Invalid base64-encoded data") from e + + +# The alphabet used by base64.urlsafe_* +_base64_alphabet = f"{string.ascii_letters}{string.digits}-_=".encode("ascii") + +_int64_struct = struct.Struct(">Q") +_int_to_bytes = _int64_struct.pack +_bytes_to_int = t.cast("t.Callable[[bytes], tuple[int]]", _int64_struct.unpack) + + +def int_to_bytes(num: int) -> bytes: + return _int_to_bytes(num).lstrip(b"\x00") + + +def bytes_to_int(bytestr: bytes) -> int: + return _bytes_to_int(bytestr.rjust(8, b"\x00"))[0] diff --git a/venv/Lib/site-packages/itsdangerous/exc.py b/venv/Lib/site-packages/itsdangerous/exc.py new file mode 100644 index 0000000000000000000000000000000000000000..a75adcd52762458db556111d8b90415e75df7277 --- /dev/null +++ b/venv/Lib/site-packages/itsdangerous/exc.py @@ -0,0 +1,106 @@ +from __future__ import annotations + +import typing as t +from datetime import datetime + + +class BadData(Exception): + """Raised if bad data of any sort was encountered. This is the base + for all exceptions that ItsDangerous defines. + + .. versionadded:: 0.15 + """ + + def __init__(self, message: str): + super().__init__(message) + self.message = message + + def __str__(self) -> str: + return self.message + + +class BadSignature(BadData): + """Raised if a signature does not match.""" + + def __init__(self, message: str, payload: t.Any | None = None): + super().__init__(message) + + #: The payload that failed the signature test. In some + #: situations you might still want to inspect this, even if + #: you know it was tampered with. + #: + #: .. versionadded:: 0.14 + self.payload: t.Any | None = payload + + +class BadTimeSignature(BadSignature): + """Raised if a time-based signature is invalid. This is a subclass + of :class:`BadSignature`. + """ + + def __init__( + self, + message: str, + payload: t.Any | None = None, + date_signed: datetime | None = None, + ): + super().__init__(message, payload) + + #: If the signature expired this exposes the date of when the + #: signature was created. This can be helpful in order to + #: tell the user how long a link has been gone stale. + #: + #: .. versionchanged:: 2.0 + #: The datetime value is timezone-aware rather than naive. + #: + #: .. versionadded:: 0.14 + self.date_signed = date_signed + + +class SignatureExpired(BadTimeSignature): + """Raised if a signature timestamp is older than ``max_age``. This + is a subclass of :exc:`BadTimeSignature`. + """ + + +class BadHeader(BadSignature): + """Raised if a signed header is invalid in some form. This only + happens for serializers that have a header that goes with the + signature. + + .. versionadded:: 0.24 + """ + + def __init__( + self, + message: str, + payload: t.Any | None = None, + header: t.Any | None = None, + original_error: Exception | None = None, + ): + super().__init__(message, payload) + + #: If the header is actually available but just malformed it + #: might be stored here. + self.header: t.Any | None = header + + #: If available, the error that indicates why the payload was + #: not valid. This might be ``None``. + self.original_error: Exception | None = original_error + + +class BadPayload(BadData): + """Raised if a payload is invalid. This could happen if the payload + is loaded despite an invalid signature, or if there is a mismatch + between the serializer and deserializer. The original exception + that occurred during loading is stored on as :attr:`original_error`. + + .. versionadded:: 0.15 + """ + + def __init__(self, message: str, original_error: Exception | None = None): + super().__init__(message) + + #: If available, the error that indicates why the payload was + #: not valid. This might be ``None``. + self.original_error: Exception | None = original_error diff --git a/venv/Lib/site-packages/itsdangerous/py.typed b/venv/Lib/site-packages/itsdangerous/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/venv/Lib/site-packages/itsdangerous/serializer.py b/venv/Lib/site-packages/itsdangerous/serializer.py new file mode 100644 index 0000000000000000000000000000000000000000..5ddf3871d8898c90fabd5bddd8299404e6e7e2f3 --- /dev/null +++ b/venv/Lib/site-packages/itsdangerous/serializer.py @@ -0,0 +1,406 @@ +from __future__ import annotations + +import collections.abc as cabc +import json +import typing as t + +from .encoding import want_bytes +from .exc import BadPayload +from .exc import BadSignature +from .signer import _make_keys_list +from .signer import Signer + +if t.TYPE_CHECKING: + import typing_extensions as te + + # This should be either be str or bytes. To avoid having to specify the + # bound type, it falls back to a union if structural matching fails. + _TSerialized = te.TypeVar( + "_TSerialized", bound=t.Union[str, bytes], default=t.Union[str, bytes] + ) +else: + # Still available at runtime on Python < 3.13, but without the default. + _TSerialized = t.TypeVar("_TSerialized", bound=t.Union[str, bytes]) + + +class _PDataSerializer(t.Protocol[_TSerialized]): + def loads(self, payload: _TSerialized, /) -> t.Any: ... + # A signature with additional arguments is not handled correctly by type + # checkers right now, so an overload is used below for serializers that + # don't match this strict protocol. + def dumps(self, obj: t.Any, /) -> _TSerialized: ... + + +# Use TypeIs once it's available in typing_extensions or 3.13. +def is_text_serializer( + serializer: _PDataSerializer[t.Any], +) -> te.TypeGuard[_PDataSerializer[str]]: + """Checks whether a serializer generates text or binary.""" + return isinstance(serializer.dumps({}), str) + + +class Serializer(t.Generic[_TSerialized]): + """A serializer wraps a :class:`~itsdangerous.signer.Signer` to + enable serializing and securely signing data other than bytes. It + can unsign to verify that the data hasn't been changed. + + The serializer provides :meth:`dumps` and :meth:`loads`, similar to + :mod:`json`, and by default uses :mod:`json` internally to serialize + the data to bytes. + + The secret key should be a random string of ``bytes`` and should not + be saved to code or version control. Different salts should be used + to distinguish signing in different contexts. See :doc:`/concepts` + for information about the security of the secret key and salt. + + :param secret_key: The secret key to sign and verify with. Can be a + list of keys, oldest to newest, to support key rotation. + :param salt: Extra key to combine with ``secret_key`` to distinguish + signatures in different contexts. + :param serializer: An object that provides ``dumps`` and ``loads`` + methods for serializing data to a string. Defaults to + :attr:`default_serializer`, which defaults to :mod:`json`. + :param serializer_kwargs: Keyword arguments to pass when calling + ``serializer.dumps``. + :param signer: A ``Signer`` class to instantiate when signing data. + Defaults to :attr:`default_signer`, which defaults to + :class:`~itsdangerous.signer.Signer`. + :param signer_kwargs: Keyword arguments to pass when instantiating + the ``Signer`` class. + :param fallback_signers: List of signer parameters to try when + unsigning with the default signer fails. Each item can be a dict + of ``signer_kwargs``, a ``Signer`` class, or a tuple of + ``(signer, signer_kwargs)``. Defaults to + :attr:`default_fallback_signers`. + + .. versionchanged:: 2.0 + Added support for key rotation by passing a list to + ``secret_key``. + + .. versionchanged:: 2.0 + Removed the default SHA-512 fallback signer from + ``default_fallback_signers``. + + .. versionchanged:: 1.1 + Added support for ``fallback_signers`` and configured a default + SHA-512 fallback. This fallback is for users who used the yanked + 1.0.0 release which defaulted to SHA-512. + + .. versionchanged:: 0.14 + The ``signer`` and ``signer_kwargs`` parameters were added to + the constructor. + """ + + #: The default serialization module to use to serialize data to a + #: string internally. The default is :mod:`json`, but can be changed + #: to any object that provides ``dumps`` and ``loads`` methods. + default_serializer: _PDataSerializer[t.Any] = json + + #: The default ``Signer`` class to instantiate when signing data. + #: The default is :class:`itsdangerous.signer.Signer`. + default_signer: type[Signer] = Signer + + #: The default fallback signers to try when unsigning fails. + default_fallback_signers: list[ + dict[str, t.Any] | tuple[type[Signer], dict[str, t.Any]] | type[Signer] + ] = [] + + # Serializer[str] if no data serializer is provided, or if it returns str. + @t.overload + def __init__( + self: Serializer[str], + secret_key: str | bytes | cabc.Iterable[str] | cabc.Iterable[bytes], + salt: str | bytes | None = b"itsdangerous", + serializer: None | _PDataSerializer[str] = None, + serializer_kwargs: dict[str, t.Any] | None = None, + signer: type[Signer] | None = None, + signer_kwargs: dict[str, t.Any] | None = None, + fallback_signers: list[ + dict[str, t.Any] | tuple[type[Signer], dict[str, t.Any]] | type[Signer] + ] + | None = None, + ): ... + + # Serializer[bytes] with a bytes data serializer positional argument. + @t.overload + def __init__( + self: Serializer[bytes], + secret_key: str | bytes | cabc.Iterable[str] | cabc.Iterable[bytes], + salt: str | bytes | None, + serializer: _PDataSerializer[bytes], + serializer_kwargs: dict[str, t.Any] | None = None, + signer: type[Signer] | None = None, + signer_kwargs: dict[str, t.Any] | None = None, + fallback_signers: list[ + dict[str, t.Any] | tuple[type[Signer], dict[str, t.Any]] | type[Signer] + ] + | None = None, + ): ... + + # Serializer[bytes] with a bytes data serializer keyword argument. + @t.overload + def __init__( + self: Serializer[bytes], + secret_key: str | bytes | cabc.Iterable[str] | cabc.Iterable[bytes], + salt: str | bytes | None = b"itsdangerous", + *, + serializer: _PDataSerializer[bytes], + serializer_kwargs: dict[str, t.Any] | None = None, + signer: type[Signer] | None = None, + signer_kwargs: dict[str, t.Any] | None = None, + fallback_signers: list[ + dict[str, t.Any] | tuple[type[Signer], dict[str, t.Any]] | type[Signer] + ] + | None = None, + ): ... + + # Fall back with a positional argument. If the strict signature of + # _PDataSerializer doesn't match, fall back to a union, requiring the user + # to specify the type. + @t.overload + def __init__( + self, + secret_key: str | bytes | cabc.Iterable[str] | cabc.Iterable[bytes], + salt: str | bytes | None, + serializer: t.Any, + serializer_kwargs: dict[str, t.Any] | None = None, + signer: type[Signer] | None = None, + signer_kwargs: dict[str, t.Any] | None = None, + fallback_signers: list[ + dict[str, t.Any] | tuple[type[Signer], dict[str, t.Any]] | type[Signer] + ] + | None = None, + ): ... + + # Fall back with a keyword argument. + @t.overload + def __init__( + self, + secret_key: str | bytes | cabc.Iterable[str] | cabc.Iterable[bytes], + salt: str | bytes | None = b"itsdangerous", + *, + serializer: t.Any, + serializer_kwargs: dict[str, t.Any] | None = None, + signer: type[Signer] | None = None, + signer_kwargs: dict[str, t.Any] | None = None, + fallback_signers: list[ + dict[str, t.Any] | tuple[type[Signer], dict[str, t.Any]] | type[Signer] + ] + | None = None, + ): ... + + def __init__( + self, + secret_key: str | bytes | cabc.Iterable[str] | cabc.Iterable[bytes], + salt: str | bytes | None = b"itsdangerous", + serializer: t.Any | None = None, + serializer_kwargs: dict[str, t.Any] | None = None, + signer: type[Signer] | None = None, + signer_kwargs: dict[str, t.Any] | None = None, + fallback_signers: list[ + dict[str, t.Any] | tuple[type[Signer], dict[str, t.Any]] | type[Signer] + ] + | None = None, + ): + #: The list of secret keys to try for verifying signatures, from + #: oldest to newest. The newest (last) key is used for signing. + #: + #: This allows a key rotation system to keep a list of allowed + #: keys and remove expired ones. + self.secret_keys: list[bytes] = _make_keys_list(secret_key) + + if salt is not None: + salt = want_bytes(salt) + # if salt is None then the signer's default is used + + self.salt = salt + + if serializer is None: + serializer = self.default_serializer + + self.serializer: _PDataSerializer[_TSerialized] = serializer + self.is_text_serializer: bool = is_text_serializer(serializer) + + if signer is None: + signer = self.default_signer + + self.signer: type[Signer] = signer + self.signer_kwargs: dict[str, t.Any] = signer_kwargs or {} + + if fallback_signers is None: + fallback_signers = list(self.default_fallback_signers) + + self.fallback_signers: list[ + dict[str, t.Any] | tuple[type[Signer], dict[str, t.Any]] | type[Signer] + ] = fallback_signers + self.serializer_kwargs: dict[str, t.Any] = serializer_kwargs or {} + + @property + def secret_key(self) -> bytes: + """The newest (last) entry in the :attr:`secret_keys` list. This + is for compatibility from before key rotation support was added. + """ + return self.secret_keys[-1] + + def load_payload( + self, payload: bytes, serializer: _PDataSerializer[t.Any] | None = None + ) -> t.Any: + """Loads the encoded object. This function raises + :class:`.BadPayload` if the payload is not valid. The + ``serializer`` parameter can be used to override the serializer + stored on the class. The encoded ``payload`` should always be + bytes. + """ + if serializer is None: + use_serializer = self.serializer + is_text = self.is_text_serializer + else: + use_serializer = serializer + is_text = is_text_serializer(serializer) + + try: + if is_text: + return use_serializer.loads(payload.decode("utf-8")) # type: ignore[arg-type] + + return use_serializer.loads(payload) # type: ignore[arg-type] + except Exception as e: + raise BadPayload( + "Could not load the payload because an exception" + " occurred on unserializing the data.", + original_error=e, + ) from e + + def dump_payload(self, obj: t.Any) -> bytes: + """Dumps the encoded object. The return value is always bytes. + If the internal serializer returns text, the value will be + encoded as UTF-8. + """ + return want_bytes(self.serializer.dumps(obj, **self.serializer_kwargs)) + + def make_signer(self, salt: str | bytes | None = None) -> Signer: + """Creates a new instance of the signer to be used. The default + implementation uses the :class:`.Signer` base class. + """ + if salt is None: + salt = self.salt + + return self.signer(self.secret_keys, salt=salt, **self.signer_kwargs) + + def iter_unsigners(self, salt: str | bytes | None = None) -> cabc.Iterator[Signer]: + """Iterates over all signers to be tried for unsigning. Starts + with the configured signer, then constructs each signer + specified in ``fallback_signers``. + """ + if salt is None: + salt = self.salt + + yield self.make_signer(salt) + + for fallback in self.fallback_signers: + if isinstance(fallback, dict): + kwargs = fallback + fallback = self.signer + elif isinstance(fallback, tuple): + fallback, kwargs = fallback + else: + kwargs = self.signer_kwargs + + for secret_key in self.secret_keys: + yield fallback(secret_key, salt=salt, **kwargs) + + def dumps(self, obj: t.Any, salt: str | bytes | None = None) -> _TSerialized: + """Returns a signed string serialized with the internal + serializer. The return value can be either a byte or unicode + string depending on the format of the internal serializer. + """ + payload = want_bytes(self.dump_payload(obj)) + rv = self.make_signer(salt).sign(payload) + + if self.is_text_serializer: + return rv.decode("utf-8") # type: ignore[return-value] + + return rv # type: ignore[return-value] + + def dump(self, obj: t.Any, f: t.IO[t.Any], salt: str | bytes | None = None) -> None: + """Like :meth:`dumps` but dumps into a file. The file handle has + to be compatible with what the internal serializer expects. + """ + f.write(self.dumps(obj, salt)) + + def loads( + self, s: str | bytes, salt: str | bytes | None = None, **kwargs: t.Any + ) -> t.Any: + """Reverse of :meth:`dumps`. Raises :exc:`.BadSignature` if the + signature validation fails. + """ + s = want_bytes(s) + last_exception = None + + for signer in self.iter_unsigners(salt): + try: + return self.load_payload(signer.unsign(s)) + except BadSignature as err: + last_exception = err + + raise t.cast(BadSignature, last_exception) + + def load(self, f: t.IO[t.Any], salt: str | bytes | None = None) -> t.Any: + """Like :meth:`loads` but loads from a file.""" + return self.loads(f.read(), salt) + + def loads_unsafe( + self, s: str | bytes, salt: str | bytes | None = None + ) -> tuple[bool, t.Any]: + """Like :meth:`loads` but without verifying the signature. This + is potentially very dangerous to use depending on how your + serializer works. The return value is ``(signature_valid, + payload)`` instead of just the payload. The first item will be a + boolean that indicates if the signature is valid. This function + never fails. + + Use it for debugging only and if you know that your serializer + module is not exploitable (for example, do not use it with a + pickle serializer). + + .. versionadded:: 0.15 + """ + return self._loads_unsafe_impl(s, salt) + + def _loads_unsafe_impl( + self, + s: str | bytes, + salt: str | bytes | None, + load_kwargs: dict[str, t.Any] | None = None, + load_payload_kwargs: dict[str, t.Any] | None = None, + ) -> tuple[bool, t.Any]: + """Low level helper function to implement :meth:`loads_unsafe` + in serializer subclasses. + """ + if load_kwargs is None: + load_kwargs = {} + + try: + return True, self.loads(s, salt=salt, **load_kwargs) + except BadSignature as e: + if e.payload is None: + return False, None + + if load_payload_kwargs is None: + load_payload_kwargs = {} + + try: + return ( + False, + self.load_payload(e.payload, **load_payload_kwargs), + ) + except BadPayload: + return False, None + + def load_unsafe( + self, f: t.IO[t.Any], salt: str | bytes | None = None + ) -> tuple[bool, t.Any]: + """Like :meth:`loads_unsafe` but loads from a file. + + .. versionadded:: 0.15 + """ + return self.loads_unsafe(f.read(), salt=salt) diff --git a/venv/Lib/site-packages/itsdangerous/signer.py b/venv/Lib/site-packages/itsdangerous/signer.py new file mode 100644 index 0000000000000000000000000000000000000000..e324dc03da90d9002200b68088f501df62777cd6 --- /dev/null +++ b/venv/Lib/site-packages/itsdangerous/signer.py @@ -0,0 +1,266 @@ +from __future__ import annotations + +import collections.abc as cabc +import hashlib +import hmac +import typing as t + +from .encoding import _base64_alphabet +from .encoding import base64_decode +from .encoding import base64_encode +from .encoding import want_bytes +from .exc import BadSignature + + +class SigningAlgorithm: + """Subclasses must implement :meth:`get_signature` to provide + signature generation functionality. + """ + + def get_signature(self, key: bytes, value: bytes) -> bytes: + """Returns the signature for the given key and value.""" + raise NotImplementedError() + + def verify_signature(self, key: bytes, value: bytes, sig: bytes) -> bool: + """Verifies the given signature matches the expected + signature. + """ + return hmac.compare_digest(sig, self.get_signature(key, value)) + + +class NoneAlgorithm(SigningAlgorithm): + """Provides an algorithm that does not perform any signing and + returns an empty signature. + """ + + def get_signature(self, key: bytes, value: bytes) -> bytes: + return b"" + + +def _lazy_sha1(string: bytes = b"") -> t.Any: + """Don't access ``hashlib.sha1`` until runtime. FIPS builds may not include + SHA-1, in which case the import and use as a default would fail before the + developer can configure something else. + """ + return hashlib.sha1(string) + + +class HMACAlgorithm(SigningAlgorithm): + """Provides signature generation using HMACs.""" + + #: The digest method to use with the MAC algorithm. This defaults to + #: SHA1, but can be changed to any other function in the hashlib + #: module. + default_digest_method: t.Any = staticmethod(_lazy_sha1) + + def __init__(self, digest_method: t.Any = None): + if digest_method is None: + digest_method = self.default_digest_method + + self.digest_method: t.Any = digest_method + + def get_signature(self, key: bytes, value: bytes) -> bytes: + mac = hmac.new(key, msg=value, digestmod=self.digest_method) + return mac.digest() + + +def _make_keys_list( + secret_key: str | bytes | cabc.Iterable[str] | cabc.Iterable[bytes], +) -> list[bytes]: + if isinstance(secret_key, (str, bytes)): + return [want_bytes(secret_key)] + + return [want_bytes(s) for s in secret_key] # pyright: ignore + + +class Signer: + """A signer securely signs bytes, then unsigns them to verify that + the value hasn't been changed. + + The secret key should be a random string of ``bytes`` and should not + be saved to code or version control. Different salts should be used + to distinguish signing in different contexts. See :doc:`/concepts` + for information about the security of the secret key and salt. + + :param secret_key: The secret key to sign and verify with. Can be a + list of keys, oldest to newest, to support key rotation. + :param salt: Extra key to combine with ``secret_key`` to distinguish + signatures in different contexts. + :param sep: Separator between the signature and value. + :param key_derivation: How to derive the signing key from the secret + key and salt. Possible values are ``concat``, ``django-concat``, + or ``hmac``. Defaults to :attr:`default_key_derivation`, which + defaults to ``django-concat``. + :param digest_method: Hash function to use when generating the HMAC + signature. Defaults to :attr:`default_digest_method`, which + defaults to :func:`hashlib.sha1`. Note that the security of the + hash alone doesn't apply when used intermediately in HMAC. + :param algorithm: A :class:`SigningAlgorithm` instance to use + instead of building a default :class:`HMACAlgorithm` with the + ``digest_method``. + + .. versionchanged:: 2.0 + Added support for key rotation by passing a list to + ``secret_key``. + + .. versionchanged:: 0.18 + ``algorithm`` was added as an argument to the class constructor. + + .. versionchanged:: 0.14 + ``key_derivation`` and ``digest_method`` were added as arguments + to the class constructor. + """ + + #: The default digest method to use for the signer. The default is + #: :func:`hashlib.sha1`, but can be changed to any :mod:`hashlib` or + #: compatible object. Note that the security of the hash alone + #: doesn't apply when used intermediately in HMAC. + #: + #: .. versionadded:: 0.14 + default_digest_method: t.Any = staticmethod(_lazy_sha1) + + #: The default scheme to use to derive the signing key from the + #: secret key and salt. The default is ``django-concat``. Possible + #: values are ``concat``, ``django-concat``, and ``hmac``. + #: + #: .. versionadded:: 0.14 + default_key_derivation: str = "django-concat" + + def __init__( + self, + secret_key: str | bytes | cabc.Iterable[str] | cabc.Iterable[bytes], + salt: str | bytes | None = b"itsdangerous.Signer", + sep: str | bytes = b".", + key_derivation: str | None = None, + digest_method: t.Any | None = None, + algorithm: SigningAlgorithm | None = None, + ): + #: The list of secret keys to try for verifying signatures, from + #: oldest to newest. The newest (last) key is used for signing. + #: + #: This allows a key rotation system to keep a list of allowed + #: keys and remove expired ones. + self.secret_keys: list[bytes] = _make_keys_list(secret_key) + self.sep: bytes = want_bytes(sep) + + if self.sep in _base64_alphabet: + raise ValueError( + "The given separator cannot be used because it may be" + " contained in the signature itself. ASCII letters," + " digits, and '-_=' must not be used." + ) + + if salt is not None: + salt = want_bytes(salt) + else: + salt = b"itsdangerous.Signer" + + self.salt = salt + + if key_derivation is None: + key_derivation = self.default_key_derivation + + self.key_derivation: str = key_derivation + + if digest_method is None: + digest_method = self.default_digest_method + + self.digest_method: t.Any = digest_method + + if algorithm is None: + algorithm = HMACAlgorithm(self.digest_method) + + self.algorithm: SigningAlgorithm = algorithm + + @property + def secret_key(self) -> bytes: + """The newest (last) entry in the :attr:`secret_keys` list. This + is for compatibility from before key rotation support was added. + """ + return self.secret_keys[-1] + + def derive_key(self, secret_key: str | bytes | None = None) -> bytes: + """This method is called to derive the key. The default key + derivation choices can be overridden here. Key derivation is not + intended to be used as a security method to make a complex key + out of a short password. Instead you should use large random + secret keys. + + :param secret_key: A specific secret key to derive from. + Defaults to the last item in :attr:`secret_keys`. + + .. versionchanged:: 2.0 + Added the ``secret_key`` parameter. + """ + if secret_key is None: + secret_key = self.secret_keys[-1] + else: + secret_key = want_bytes(secret_key) + + if self.key_derivation == "concat": + return t.cast(bytes, self.digest_method(self.salt + secret_key).digest()) + elif self.key_derivation == "django-concat": + return t.cast( + bytes, self.digest_method(self.salt + b"signer" + secret_key).digest() + ) + elif self.key_derivation == "hmac": + mac = hmac.new(secret_key, digestmod=self.digest_method) + mac.update(self.salt) + return mac.digest() + elif self.key_derivation == "none": + return secret_key + else: + raise TypeError("Unknown key derivation method") + + def get_signature(self, value: str | bytes) -> bytes: + """Returns the signature for the given value.""" + value = want_bytes(value) + key = self.derive_key() + sig = self.algorithm.get_signature(key, value) + return base64_encode(sig) + + def sign(self, value: str | bytes) -> bytes: + """Signs the given string.""" + value = want_bytes(value) + return value + self.sep + self.get_signature(value) + + def verify_signature(self, value: str | bytes, sig: str | bytes) -> bool: + """Verifies the signature for the given value.""" + try: + sig = base64_decode(sig) + except Exception: + return False + + value = want_bytes(value) + + for secret_key in reversed(self.secret_keys): + key = self.derive_key(secret_key) + + if self.algorithm.verify_signature(key, value, sig): + return True + + return False + + def unsign(self, signed_value: str | bytes) -> bytes: + """Unsigns the given string.""" + signed_value = want_bytes(signed_value) + + if self.sep not in signed_value: + raise BadSignature(f"No {self.sep!r} found in value") + + value, sig = signed_value.rsplit(self.sep, 1) + + if self.verify_signature(value, sig): + return value + + raise BadSignature(f"Signature {sig!r} does not match", payload=value) + + def validate(self, signed_value: str | bytes) -> bool: + """Only validates the given signed value. Returns ``True`` if + the signature exists and is valid. + """ + try: + self.unsign(signed_value) + return True + except BadSignature: + return False diff --git a/venv/Lib/site-packages/itsdangerous/timed.py b/venv/Lib/site-packages/itsdangerous/timed.py new file mode 100644 index 0000000000000000000000000000000000000000..73843755d90979f750976705c5eaeeb3b98f178c --- /dev/null +++ b/venv/Lib/site-packages/itsdangerous/timed.py @@ -0,0 +1,228 @@ +from __future__ import annotations + +import collections.abc as cabc +import time +import typing as t +from datetime import datetime +from datetime import timezone + +from .encoding import base64_decode +from .encoding import base64_encode +from .encoding import bytes_to_int +from .encoding import int_to_bytes +from .encoding import want_bytes +from .exc import BadSignature +from .exc import BadTimeSignature +from .exc import SignatureExpired +from .serializer import _TSerialized +from .serializer import Serializer +from .signer import Signer + + +class TimestampSigner(Signer): + """Works like the regular :class:`.Signer` but also records the time + of the signing and can be used to expire signatures. The + :meth:`unsign` method can raise :exc:`.SignatureExpired` if the + unsigning failed because the signature is expired. + """ + + def get_timestamp(self) -> int: + """Returns the current timestamp. The function must return an + integer. + """ + return int(time.time()) + + def timestamp_to_datetime(self, ts: int) -> datetime: + """Convert the timestamp from :meth:`get_timestamp` into an + aware :class`datetime.datetime` in UTC. + + .. versionchanged:: 2.0 + The timestamp is returned as a timezone-aware ``datetime`` + in UTC rather than a naive ``datetime`` assumed to be UTC. + """ + return datetime.fromtimestamp(ts, tz=timezone.utc) + + def sign(self, value: str | bytes) -> bytes: + """Signs the given string and also attaches time information.""" + value = want_bytes(value) + timestamp = base64_encode(int_to_bytes(self.get_timestamp())) + sep = want_bytes(self.sep) + value = value + sep + timestamp + return value + sep + self.get_signature(value) + + # Ignore overlapping signatures check, return_timestamp is the only + # parameter that affects the return type. + + @t.overload + def unsign( # type: ignore[overload-overlap] + self, + signed_value: str | bytes, + max_age: int | None = None, + return_timestamp: t.Literal[False] = False, + ) -> bytes: ... + + @t.overload + def unsign( + self, + signed_value: str | bytes, + max_age: int | None = None, + return_timestamp: t.Literal[True] = True, + ) -> tuple[bytes, datetime]: ... + + def unsign( + self, + signed_value: str | bytes, + max_age: int | None = None, + return_timestamp: bool = False, + ) -> tuple[bytes, datetime] | bytes: + """Works like the regular :meth:`.Signer.unsign` but can also + validate the time. See the base docstring of the class for + the general behavior. If ``return_timestamp`` is ``True`` the + timestamp of the signature will be returned as an aware + :class:`datetime.datetime` object in UTC. + + .. versionchanged:: 2.0 + The timestamp is returned as a timezone-aware ``datetime`` + in UTC rather than a naive ``datetime`` assumed to be UTC. + """ + try: + result = super().unsign(signed_value) + sig_error = None + except BadSignature as e: + sig_error = e + result = e.payload or b"" + + sep = want_bytes(self.sep) + + # If there is no timestamp in the result there is something + # seriously wrong. In case there was a signature error, we raise + # that one directly, otherwise we have a weird situation in + # which we shouldn't have come except someone uses a time-based + # serializer on non-timestamp data, so catch that. + if sep not in result: + if sig_error: + raise sig_error + + raise BadTimeSignature("timestamp missing", payload=result) + + value, ts_bytes = result.rsplit(sep, 1) + ts_int: int | None = None + ts_dt: datetime | None = None + + try: + ts_int = bytes_to_int(base64_decode(ts_bytes)) + except Exception: + pass + + # Signature is *not* okay. Raise a proper error now that we have + # split the value and the timestamp. + if sig_error is not None: + if ts_int is not None: + try: + ts_dt = self.timestamp_to_datetime(ts_int) + except (ValueError, OSError, OverflowError) as exc: + # Windows raises OSError + # 32-bit raises OverflowError + raise BadTimeSignature( + "Malformed timestamp", payload=value + ) from exc + + raise BadTimeSignature(str(sig_error), payload=value, date_signed=ts_dt) + + # Signature was okay but the timestamp is actually not there or + # malformed. Should not happen, but we handle it anyway. + if ts_int is None: + raise BadTimeSignature("Malformed timestamp", payload=value) + + # Check timestamp is not older than max_age + if max_age is not None: + age = self.get_timestamp() - ts_int + + if age > max_age: + raise SignatureExpired( + f"Signature age {age} > {max_age} seconds", + payload=value, + date_signed=self.timestamp_to_datetime(ts_int), + ) + + if age < 0: + raise SignatureExpired( + f"Signature age {age} < 0 seconds", + payload=value, + date_signed=self.timestamp_to_datetime(ts_int), + ) + + if return_timestamp: + return value, self.timestamp_to_datetime(ts_int) + + return value + + def validate(self, signed_value: str | bytes, max_age: int | None = None) -> bool: + """Only validates the given signed value. Returns ``True`` if + the signature exists and is valid.""" + try: + self.unsign(signed_value, max_age=max_age) + return True + except BadSignature: + return False + + +class TimedSerializer(Serializer[_TSerialized]): + """Uses :class:`TimestampSigner` instead of the default + :class:`.Signer`. + """ + + default_signer: type[TimestampSigner] = TimestampSigner + + def iter_unsigners( + self, salt: str | bytes | None = None + ) -> cabc.Iterator[TimestampSigner]: + return t.cast("cabc.Iterator[TimestampSigner]", super().iter_unsigners(salt)) + + # TODO: Signature is incompatible because parameters were added + # before salt. + + def loads( # type: ignore[override] + self, + s: str | bytes, + max_age: int | None = None, + return_timestamp: bool = False, + salt: str | bytes | None = None, + ) -> t.Any: + """Reverse of :meth:`dumps`, raises :exc:`.BadSignature` if the + signature validation fails. If a ``max_age`` is provided it will + ensure the signature is not older than that time in seconds. In + case the signature is outdated, :exc:`.SignatureExpired` is + raised. All arguments are forwarded to the signer's + :meth:`~TimestampSigner.unsign` method. + """ + s = want_bytes(s) + last_exception = None + + for signer in self.iter_unsigners(salt): + try: + base64d, timestamp = signer.unsign( + s, max_age=max_age, return_timestamp=True + ) + payload = self.load_payload(base64d) + + if return_timestamp: + return payload, timestamp + + return payload + except SignatureExpired: + # The signature was unsigned successfully but was + # expired. Do not try the next signer. + raise + except BadSignature as err: + last_exception = err + + raise t.cast(BadSignature, last_exception) + + def loads_unsafe( # type: ignore[override] + self, + s: str | bytes, + max_age: int | None = None, + salt: str | bytes | None = None, + ) -> tuple[bool, t.Any]: + return self._loads_unsafe_impl(s, salt, load_kwargs={"max_age": max_age}) diff --git a/venv/Lib/site-packages/itsdangerous/url_safe.py b/venv/Lib/site-packages/itsdangerous/url_safe.py new file mode 100644 index 0000000000000000000000000000000000000000..56a0793315a19f24c8385c017a26ec8a9d4c23c3 --- /dev/null +++ b/venv/Lib/site-packages/itsdangerous/url_safe.py @@ -0,0 +1,83 @@ +from __future__ import annotations + +import typing as t +import zlib + +from ._json import _CompactJSON +from .encoding import base64_decode +from .encoding import base64_encode +from .exc import BadPayload +from .serializer import _PDataSerializer +from .serializer import Serializer +from .timed import TimedSerializer + + +class URLSafeSerializerMixin(Serializer[str]): + """Mixed in with a regular serializer it will attempt to zlib + compress the string to make it shorter if necessary. It will also + base64 encode the string so that it can safely be placed in a URL. + """ + + default_serializer: _PDataSerializer[str] = _CompactJSON + + def load_payload( + self, + payload: bytes, + *args: t.Any, + serializer: t.Any | None = None, + **kwargs: t.Any, + ) -> t.Any: + decompress = False + + if payload.startswith(b"."): + payload = payload[1:] + decompress = True + + try: + json = base64_decode(payload) + except Exception as e: + raise BadPayload( + "Could not base64 decode the payload because of an exception", + original_error=e, + ) from e + + if decompress: + try: + json = zlib.decompress(json) + except Exception as e: + raise BadPayload( + "Could not zlib decompress the payload before decoding the payload", + original_error=e, + ) from e + + return super().load_payload(json, *args, **kwargs) + + def dump_payload(self, obj: t.Any) -> bytes: + json = super().dump_payload(obj) + is_compressed = False + compressed = zlib.compress(json) + + if len(compressed) < (len(json) - 1): + json = compressed + is_compressed = True + + base64d = base64_encode(json) + + if is_compressed: + base64d = b"." + base64d + + return base64d + + +class URLSafeSerializer(URLSafeSerializerMixin, Serializer[str]): + """Works like :class:`.Serializer` but dumps and loads into a URL + safe string consisting of the upper and lowercase character of the + alphabet as well as ``'_'``, ``'-'`` and ``'.'``. + """ + + +class URLSafeTimedSerializer(URLSafeSerializerMixin, TimedSerializer[str]): + """Works like :class:`.TimedSerializer` but dumps and loads into a + URL safe string consisting of the upper and lowercase character of + the alphabet as well as ``'_'``, ``'-'`` and ``'.'``. + """ diff --git a/venv/Lib/site-packages/jinja2-3.1.6.dist-info/INSTALLER b/venv/Lib/site-packages/jinja2-3.1.6.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/venv/Lib/site-packages/jinja2-3.1.6.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/venv/Lib/site-packages/jinja2-3.1.6.dist-info/METADATA b/venv/Lib/site-packages/jinja2-3.1.6.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..ffef2ff3bfa0c42b6e6e3eefda700391d181c9a0 --- /dev/null +++ b/venv/Lib/site-packages/jinja2-3.1.6.dist-info/METADATA @@ -0,0 +1,84 @@ +Metadata-Version: 2.4 +Name: Jinja2 +Version: 3.1.6 +Summary: A very fast and expressive template engine. +Maintainer-email: Pallets +Requires-Python: >=3.7 +Description-Content-Type: text/markdown +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Web Environment +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content +Classifier: Topic :: Text Processing :: Markup :: HTML +Classifier: Typing :: Typed +License-File: LICENSE.txt +Requires-Dist: MarkupSafe>=2.0 +Requires-Dist: Babel>=2.7 ; extra == "i18n" +Project-URL: Changes, https://jinja.palletsprojects.com/changes/ +Project-URL: Chat, https://discord.gg/pallets +Project-URL: Documentation, https://jinja.palletsprojects.com/ +Project-URL: Donate, https://palletsprojects.com/donate +Project-URL: Source, https://github.com/pallets/jinja/ +Provides-Extra: i18n + +# Jinja + +Jinja is a fast, expressive, extensible templating engine. Special +placeholders in the template allow writing code similar to Python +syntax. Then the template is passed data to render the final document. + +It includes: + +- Template inheritance and inclusion. +- Define and import macros within templates. +- HTML templates can use autoescaping to prevent XSS from untrusted + user input. +- A sandboxed environment can safely render untrusted templates. +- AsyncIO support for generating templates and calling async + functions. +- I18N support with Babel. +- Templates are compiled to optimized Python code just-in-time and + cached, or can be compiled ahead-of-time. +- Exceptions point to the correct line in templates to make debugging + easier. +- Extensible filters, tests, functions, and even syntax. + +Jinja's philosophy is that while application logic belongs in Python if +possible, it shouldn't make the template designer's job difficult by +restricting functionality too much. + + +## In A Nutshell + +```jinja +{% extends "base.html" %} +{% block title %}Members{% endblock %} +{% block content %} + +{% endblock %} +``` + +## Donate + +The Pallets organization develops and supports Jinja and other popular +packages. In order to grow the community of contributors and users, and +allow the maintainers to devote more time to the projects, [please +donate today][]. + +[please donate today]: https://palletsprojects.com/donate + +## Contributing + +See our [detailed contributing documentation][contrib] for many ways to +contribute, including reporting issues, requesting features, asking or answering +questions, and making PRs. + +[contrib]: https://palletsprojects.com/contributing/ + diff --git a/venv/Lib/site-packages/jinja2-3.1.6.dist-info/RECORD b/venv/Lib/site-packages/jinja2-3.1.6.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..62dcfa6252b54d23a8089f37c774fd480bfbdde5 --- /dev/null +++ b/venv/Lib/site-packages/jinja2-3.1.6.dist-info/RECORD @@ -0,0 +1,57 @@ +jinja2-3.1.6.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +jinja2-3.1.6.dist-info/METADATA,sha256=aMVUj7Z8QTKhOJjZsx7FDGvqKr3ZFdkh8hQ1XDpkmcg,2871 +jinja2-3.1.6.dist-info/RECORD,, +jinja2-3.1.6.dist-info/WHEEL,sha256=_2ozNFCLWc93bK4WKHCO-eDUENDlo-dgc9cU3qokYO4,82 +jinja2-3.1.6.dist-info/entry_points.txt,sha256=OL85gYU1eD8cuPlikifFngXpeBjaxl6rIJ8KkC_3r-I,58 +jinja2-3.1.6.dist-info/licenses/LICENSE.txt,sha256=O0nc7kEF6ze6wQ-vG-JgQI_oXSUrjp3y4JefweCUQ3s,1475 +jinja2/__init__.py,sha256=xxepO9i7DHsqkQrgBEduLtfoz2QCuT6_gbL4XSN1hbU,1928 +jinja2/__pycache__/__init__.cpython-313.pyc,, +jinja2/__pycache__/_identifier.cpython-313.pyc,, +jinja2/__pycache__/async_utils.cpython-313.pyc,, +jinja2/__pycache__/bccache.cpython-313.pyc,, +jinja2/__pycache__/compiler.cpython-313.pyc,, +jinja2/__pycache__/constants.cpython-313.pyc,, +jinja2/__pycache__/debug.cpython-313.pyc,, +jinja2/__pycache__/defaults.cpython-313.pyc,, +jinja2/__pycache__/environment.cpython-313.pyc,, +jinja2/__pycache__/exceptions.cpython-313.pyc,, +jinja2/__pycache__/ext.cpython-313.pyc,, +jinja2/__pycache__/filters.cpython-313.pyc,, +jinja2/__pycache__/idtracking.cpython-313.pyc,, +jinja2/__pycache__/lexer.cpython-313.pyc,, +jinja2/__pycache__/loaders.cpython-313.pyc,, +jinja2/__pycache__/meta.cpython-313.pyc,, +jinja2/__pycache__/nativetypes.cpython-313.pyc,, +jinja2/__pycache__/nodes.cpython-313.pyc,, +jinja2/__pycache__/optimizer.cpython-313.pyc,, +jinja2/__pycache__/parser.cpython-313.pyc,, +jinja2/__pycache__/runtime.cpython-313.pyc,, +jinja2/__pycache__/sandbox.cpython-313.pyc,, +jinja2/__pycache__/tests.cpython-313.pyc,, +jinja2/__pycache__/utils.cpython-313.pyc,, +jinja2/__pycache__/visitor.cpython-313.pyc,, +jinja2/_identifier.py,sha256=_zYctNKzRqlk_murTNlzrju1FFJL7Va_Ijqqd7ii2lU,1958 +jinja2/async_utils.py,sha256=vK-PdsuorOMnWSnEkT3iUJRIkTnYgO2T6MnGxDgHI5o,2834 +jinja2/bccache.py,sha256=gh0qs9rulnXo0PhX5jTJy2UHzI8wFnQ63o_vw7nhzRg,14061 +jinja2/compiler.py,sha256=9RpCQl5X88BHllJiPsHPh295Hh0uApvwFJNQuutULeM,74131 +jinja2/constants.py,sha256=GMoFydBF_kdpaRKPoM5cl5MviquVRLVyZtfp5-16jg0,1433 +jinja2/debug.py,sha256=CnHqCDHd-BVGvti_8ZsTolnXNhA3ECsY-6n_2pwU8Hw,6297 +jinja2/defaults.py,sha256=boBcSw78h-lp20YbaXSJsqkAI2uN_mD_TtCydpeq5wU,1267 +jinja2/environment.py,sha256=9nhrP7Ch-NbGX00wvyr4yy-uhNHq2OCc60ggGrni_fk,61513 +jinja2/exceptions.py,sha256=ioHeHrWwCWNaXX1inHmHVblvc4haO7AXsjCp3GfWvx0,5071 +jinja2/ext.py,sha256=5PF5eHfh8mXAIxXHHRB2xXbXohi8pE3nHSOxa66uS7E,31875 +jinja2/filters.py,sha256=PQ_Egd9n9jSgtnGQYyF4K5j2nYwhUIulhPnyimkdr-k,55212 +jinja2/idtracking.py,sha256=-ll5lIp73pML3ErUYiIJj7tdmWxcH_IlDv3yA_hiZYo,10555 +jinja2/lexer.py,sha256=LYiYio6br-Tep9nPcupWXsPEtjluw3p1mU-lNBVRUfk,29786 +jinja2/loaders.py,sha256=wIrnxjvcbqh5VwW28NSkfotiDq8qNCxIOSFbGUiSLB4,24055 +jinja2/meta.py,sha256=OTDPkaFvU2Hgvx-6akz7154F8BIWaRmvJcBFvwopHww,4397 +jinja2/nativetypes.py,sha256=7GIGALVJgdyL80oZJdQUaUfwSt5q2lSSZbXt0dNf_M4,4210 +jinja2/nodes.py,sha256=m1Duzcr6qhZI8JQ6VyJgUNinjAf5bQzijSmDnMsvUx8,34579 +jinja2/optimizer.py,sha256=rJnCRlQ7pZsEEmMhsQDgC_pKyDHxP5TPS6zVPGsgcu8,1651 +jinja2/parser.py,sha256=lLOFy3sEmHc5IaEHRiH1sQVnId2moUQzhyeJZTtdY30,40383 +jinja2/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jinja2/runtime.py,sha256=gDk-GvdriJXqgsGbHgrcKTP0Yp6zPXzhzrIpCFH3jAU,34249 +jinja2/sandbox.py,sha256=Mw2aitlY2I8la7FYhcX2YG9BtUYcLnD0Gh3d29cDWrY,15009 +jinja2/tests.py,sha256=VLsBhVFnWg-PxSBz1MhRnNWgP1ovXk3neO1FLQMeC9Q,5926 +jinja2/utils.py,sha256=rRp3o9e7ZKS4fyrWRbELyLcpuGVTFcnooaOa1qx_FIk,24129 +jinja2/visitor.py,sha256=EcnL1PIwf_4RVCOMxsRNuR8AXHbS1qfAdMOE2ngKJz4,3557 diff --git a/venv/Lib/site-packages/jinja2-3.1.6.dist-info/WHEEL b/venv/Lib/site-packages/jinja2-3.1.6.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..23d2d7e9a5d381ef8a375db09f82052144d1fd96 --- /dev/null +++ b/venv/Lib/site-packages/jinja2-3.1.6.dist-info/WHEEL @@ -0,0 +1,4 @@ +Wheel-Version: 1.0 +Generator: flit 3.11.0 +Root-Is-Purelib: true +Tag: py3-none-any diff --git a/venv/Lib/site-packages/jinja2-3.1.6.dist-info/entry_points.txt b/venv/Lib/site-packages/jinja2-3.1.6.dist-info/entry_points.txt new file mode 100644 index 0000000000000000000000000000000000000000..abc3eae3b3bc573957cf7401711948799b3465c0 --- /dev/null +++ b/venv/Lib/site-packages/jinja2-3.1.6.dist-info/entry_points.txt @@ -0,0 +1,3 @@ +[babel.extractors] +jinja2=jinja2.ext:babel_extract[i18n] + diff --git a/venv/Lib/site-packages/jinja2-3.1.6.dist-info/licenses/LICENSE.txt b/venv/Lib/site-packages/jinja2-3.1.6.dist-info/licenses/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..c37cae49ec77ad6ebb25568c1605f1fee5313cfb --- /dev/null +++ b/venv/Lib/site-packages/jinja2-3.1.6.dist-info/licenses/LICENSE.txt @@ -0,0 +1,28 @@ +Copyright 2007 Pallets + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/venv/Lib/site-packages/jinja2/__init__.py b/venv/Lib/site-packages/jinja2/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1a423a3eac16ac550e8e4008d7f5d79401b50e0f --- /dev/null +++ b/venv/Lib/site-packages/jinja2/__init__.py @@ -0,0 +1,38 @@ +"""Jinja is a template engine written in pure Python. It provides a +non-XML syntax that supports inline expressions and an optional +sandboxed environment. +""" + +from .bccache import BytecodeCache as BytecodeCache +from .bccache import FileSystemBytecodeCache as FileSystemBytecodeCache +from .bccache import MemcachedBytecodeCache as MemcachedBytecodeCache +from .environment import Environment as Environment +from .environment import Template as Template +from .exceptions import TemplateAssertionError as TemplateAssertionError +from .exceptions import TemplateError as TemplateError +from .exceptions import TemplateNotFound as TemplateNotFound +from .exceptions import TemplateRuntimeError as TemplateRuntimeError +from .exceptions import TemplatesNotFound as TemplatesNotFound +from .exceptions import TemplateSyntaxError as TemplateSyntaxError +from .exceptions import UndefinedError as UndefinedError +from .loaders import BaseLoader as BaseLoader +from .loaders import ChoiceLoader as ChoiceLoader +from .loaders import DictLoader as DictLoader +from .loaders import FileSystemLoader as FileSystemLoader +from .loaders import FunctionLoader as FunctionLoader +from .loaders import ModuleLoader as ModuleLoader +from .loaders import PackageLoader as PackageLoader +from .loaders import PrefixLoader as PrefixLoader +from .runtime import ChainableUndefined as ChainableUndefined +from .runtime import DebugUndefined as DebugUndefined +from .runtime import make_logging_undefined as make_logging_undefined +from .runtime import StrictUndefined as StrictUndefined +from .runtime import Undefined as Undefined +from .utils import clear_caches as clear_caches +from .utils import is_undefined as is_undefined +from .utils import pass_context as pass_context +from .utils import pass_environment as pass_environment +from .utils import pass_eval_context as pass_eval_context +from .utils import select_autoescape as select_autoescape + +__version__ = "3.1.6" diff --git a/venv/Lib/site-packages/jinja2/__pycache__/__init__.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..246d6afed99ef0bc9f234d72cc51bc884346ef66 Binary files /dev/null and b/venv/Lib/site-packages/jinja2/__pycache__/__init__.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/jinja2/__pycache__/_identifier.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/_identifier.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0163ad2037f03b3b9d2df1f98c98ee21c948724c Binary files /dev/null and b/venv/Lib/site-packages/jinja2/__pycache__/_identifier.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/jinja2/__pycache__/async_utils.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/async_utils.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7344274c5d2906ddcd1e84afbbfe6b4b298dc26b Binary files /dev/null and b/venv/Lib/site-packages/jinja2/__pycache__/async_utils.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/jinja2/__pycache__/bccache.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/bccache.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f5a1791c71daac05a8e6f456d3b1bfa0e692bec6 Binary files /dev/null and b/venv/Lib/site-packages/jinja2/__pycache__/bccache.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/jinja2/__pycache__/compiler.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/compiler.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5734d8116331df73d92a80450703a2965d7d0230 --- /dev/null +++ b/venv/Lib/site-packages/jinja2/__pycache__/compiler.cpython-313.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:94b2ba42154818f047c8eff22a4caeebfca609ddc26a2c9c9a46fbb6738f15dd +size 105643 diff --git a/venv/Lib/site-packages/jinja2/__pycache__/constants.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/constants.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a3fc08604811e6284a7fc3275dd7ffc3904b659 Binary files /dev/null and b/venv/Lib/site-packages/jinja2/__pycache__/constants.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/jinja2/__pycache__/debug.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/debug.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5fbf59b6fa75a49237852637db4faa359e179cb9 Binary files /dev/null and b/venv/Lib/site-packages/jinja2/__pycache__/debug.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/jinja2/__pycache__/defaults.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/defaults.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c78de940e160cfe7234792c8404126acb63ed1fd Binary files /dev/null and b/venv/Lib/site-packages/jinja2/__pycache__/defaults.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/jinja2/__pycache__/environment.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/environment.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ab5a9326b48a966bc33d2df5dfdb91f3b1612498 Binary files /dev/null and b/venv/Lib/site-packages/jinja2/__pycache__/environment.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/jinja2/__pycache__/exceptions.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/exceptions.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2ab9d586791b79b9c085103c3ce084d2a22a6e9d Binary files /dev/null and b/venv/Lib/site-packages/jinja2/__pycache__/exceptions.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/jinja2/__pycache__/ext.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/ext.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..81e1a53b4c278f9cad935c6b9b52d29422f12924 Binary files /dev/null and b/venv/Lib/site-packages/jinja2/__pycache__/ext.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/jinja2/__pycache__/filters.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/filters.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7eb8c8bff67cf41e35995f40f10c26825a17f8ab Binary files /dev/null and b/venv/Lib/site-packages/jinja2/__pycache__/filters.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/jinja2/__pycache__/idtracking.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/idtracking.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a0dceef77bf107314a838cae8d5213f935cb82a Binary files /dev/null and b/venv/Lib/site-packages/jinja2/__pycache__/idtracking.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/jinja2/__pycache__/lexer.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/lexer.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b5dbb43db8a9822a6475c4e14908d96ae382310b Binary files /dev/null and b/venv/Lib/site-packages/jinja2/__pycache__/lexer.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/jinja2/__pycache__/loaders.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/loaders.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5824aff6ffb9e8f14d60ecbfad86baf7b4c7b4fd Binary files /dev/null and b/venv/Lib/site-packages/jinja2/__pycache__/loaders.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/jinja2/__pycache__/meta.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/meta.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..54d0b494053584ee92f1b2db835c14afd480dfb1 Binary files /dev/null and b/venv/Lib/site-packages/jinja2/__pycache__/meta.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/jinja2/__pycache__/nativetypes.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/nativetypes.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5f09fd2ffb59fe83146226302c115b06815d7530 Binary files /dev/null and b/venv/Lib/site-packages/jinja2/__pycache__/nativetypes.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/jinja2/__pycache__/nodes.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/nodes.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..25d7f070b2a7ee5388aeb3bca10a8094f99edfe1 Binary files /dev/null and b/venv/Lib/site-packages/jinja2/__pycache__/nodes.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/jinja2/__pycache__/optimizer.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/optimizer.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..265ce94e39d12cc8eb6608526f9f4a343e99e546 Binary files /dev/null and b/venv/Lib/site-packages/jinja2/__pycache__/optimizer.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/jinja2/__pycache__/parser.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/parser.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9d18fb8d83e5741f6e83f2916b01f7ab1f4859a8 Binary files /dev/null and b/venv/Lib/site-packages/jinja2/__pycache__/parser.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/jinja2/__pycache__/runtime.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/runtime.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..baf0bdde5e1212aea465b2f48b0e4b09fc7a6c82 Binary files /dev/null and b/venv/Lib/site-packages/jinja2/__pycache__/runtime.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/jinja2/__pycache__/sandbox.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/sandbox.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f755dd0d5c1b1d935449d74d44dc0ad80b1a703c Binary files /dev/null and b/venv/Lib/site-packages/jinja2/__pycache__/sandbox.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/jinja2/__pycache__/tests.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/tests.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b5a193d3da1a22e355473783626db8cf7ae4afd7 Binary files /dev/null and b/venv/Lib/site-packages/jinja2/__pycache__/tests.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/jinja2/__pycache__/utils.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/utils.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..34b7aed44903fb963c028ba104debd1b6a9f715e Binary files /dev/null and b/venv/Lib/site-packages/jinja2/__pycache__/utils.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/jinja2/__pycache__/visitor.cpython-313.pyc b/venv/Lib/site-packages/jinja2/__pycache__/visitor.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5db6a255e96b49ea7f03698245b0f0dd81138cb2 Binary files /dev/null and b/venv/Lib/site-packages/jinja2/__pycache__/visitor.cpython-313.pyc differ diff --git a/venv/Lib/site-packages/jinja2/_identifier.py b/venv/Lib/site-packages/jinja2/_identifier.py new file mode 100644 index 0000000000000000000000000000000000000000..928c1503c7d414a8a86bbf5a82c68d42cb089bd2 --- /dev/null +++ b/venv/Lib/site-packages/jinja2/_identifier.py @@ -0,0 +1,6 @@ +import re + +# generated by scripts/generate_identifier_pattern.py +pattern = re.compile( + r"[\w·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣঁ-ঃ়া-ৄেৈো-্ৗৢৣ৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑੰੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣஂா-ூெ-ைொ-்ௗఀ-ఄా-ౄె-ైొ-్ౕౖౢౣಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎ັິ-ູົຼ່-ໍ༹༘༙༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏႚ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝᠋-᠍ᢅᢆᢩᤠ-ᤫᤰ-᤻ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼᪰-᪽ᬀ-ᬄ᬴-᭄᭫-᭳ᮀ-ᮂᮡ-ᮭ᯦-᯳ᰤ-᰷᳐-᳔᳒-᳨᳭ᳲ-᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰℘℮⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣠-꣱ꣿꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀ꧥꨩ-ꨶꩃꩌꩍꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭ﬞ︀-️︠-︯︳︴﹍-﹏_𐇽𐋠𐍶-𐍺𐨁-𐨃𐨅𐨆𐨌-𐨏𐨸-𐨿𐨺𐫦𐫥𐴤-𐽆𐴧-𐽐𑀀-𑀂𑀸-𑁆𑁿-𑂂𑂰-𑂺𑄀-𑄂𑄧-𑄴𑅅𑅆𑅳𑆀-𑆂𑆳-𑇀𑇉-𑇌𑈬-𑈷𑈾𑋟-𑋪𑌀-𑌃𑌻𑌼𑌾-𑍄𑍇𑍈𑍋-𑍍𑍗𑍢𑍣𑍦-𑍬𑍰-𑍴𑐵-𑑆𑑞𑒰-𑓃𑖯-𑖵𑖸-𑗀𑗜𑗝𑘰-𑙀𑚫-𑚷𑜝-𑜫𑠬-𑠺𑨁-𑨊𑨳-𑨹𑨻-𑨾𑩇𑩑-𑩛𑪊-𑪙𑰯-𑰶𑰸-𑰿𑲒-𑲧𑲩-𑲶𑴱-𑴶𑴺𑴼𑴽𑴿-𑵅𑵇𑶊-𑶎𑶐𑶑𑶓-𑶗𑻳-𑻶𖫰-𖫴𖬰-𖬶𖽑-𖽾𖾏-𖾒𛲝𛲞𝅥-𝅩𝅭-𝅲𝅻-𝆂𝆅-𝆋𝆪-𝆭𝉂-𝉄𝨀-𝨶𝨻-𝩬𝩵𝪄𝪛-𝪟𝪡-𝪯𞀀-𞀆𞀈-𞀘𞀛-𞀡𞀣𞀤𞀦-𞣐𞀪-𞣖𞥄-𞥊󠄀-󠇯]+" # noqa: B950 +) diff --git a/venv/Lib/site-packages/jinja2/async_utils.py b/venv/Lib/site-packages/jinja2/async_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..f0c140205c50a3df9863ce1ab610b0c62a483f1b --- /dev/null +++ b/venv/Lib/site-packages/jinja2/async_utils.py @@ -0,0 +1,99 @@ +import inspect +import typing as t +from functools import WRAPPER_ASSIGNMENTS +from functools import wraps + +from .utils import _PassArg +from .utils import pass_eval_context + +if t.TYPE_CHECKING: + import typing_extensions as te + +V = t.TypeVar("V") + + +def async_variant(normal_func): # type: ignore + def decorator(async_func): # type: ignore + pass_arg = _PassArg.from_obj(normal_func) + need_eval_context = pass_arg is None + + if pass_arg is _PassArg.environment: + + def is_async(args: t.Any) -> bool: + return t.cast(bool, args[0].is_async) + + else: + + def is_async(args: t.Any) -> bool: + return t.cast(bool, args[0].environment.is_async) + + # Take the doc and annotations from the sync function, but the + # name from the async function. Pallets-Sphinx-Themes + # build_function_directive expects __wrapped__ to point to the + # sync function. + async_func_attrs = ("__module__", "__name__", "__qualname__") + normal_func_attrs = tuple(set(WRAPPER_ASSIGNMENTS).difference(async_func_attrs)) + + @wraps(normal_func, assigned=normal_func_attrs) + @wraps(async_func, assigned=async_func_attrs, updated=()) + def wrapper(*args, **kwargs): # type: ignore + b = is_async(args) + + if need_eval_context: + args = args[1:] + + if b: + return async_func(*args, **kwargs) + + return normal_func(*args, **kwargs) + + if need_eval_context: + wrapper = pass_eval_context(wrapper) + + wrapper.jinja_async_variant = True # type: ignore[attr-defined] + return wrapper + + return decorator + + +_common_primitives = {int, float, bool, str, list, dict, tuple, type(None)} + + +async def auto_await(value: t.Union[t.Awaitable["V"], "V"]) -> "V": + # Avoid a costly call to isawaitable + if type(value) in _common_primitives: + return t.cast("V", value) + + if inspect.isawaitable(value): + return await t.cast("t.Awaitable[V]", value) + + return value + + +class _IteratorToAsyncIterator(t.Generic[V]): + def __init__(self, iterator: "t.Iterator[V]"): + self._iterator = iterator + + def __aiter__(self) -> "te.Self": + return self + + async def __anext__(self) -> V: + try: + return next(self._iterator) + except StopIteration as e: + raise StopAsyncIteration(e.value) from e + + +def auto_aiter( + iterable: "t.Union[t.AsyncIterable[V], t.Iterable[V]]", +) -> "t.AsyncIterator[V]": + if hasattr(iterable, "__aiter__"): + return iterable.__aiter__() + else: + return _IteratorToAsyncIterator(iter(iterable)) + + +async def auto_to_list( + value: "t.Union[t.AsyncIterable[V], t.Iterable[V]]", +) -> t.List["V"]: + return [x async for x in auto_aiter(value)] diff --git a/venv/Lib/site-packages/jinja2/bccache.py b/venv/Lib/site-packages/jinja2/bccache.py new file mode 100644 index 0000000000000000000000000000000000000000..ada8b099ff251ea9c6da4c42e1383f37e359f06a --- /dev/null +++ b/venv/Lib/site-packages/jinja2/bccache.py @@ -0,0 +1,408 @@ +"""The optional bytecode cache system. This is useful if you have very +complex template situations and the compilation of all those templates +slows down your application too much. + +Situations where this is useful are often forking web applications that +are initialized on the first request. +""" + +import errno +import fnmatch +import marshal +import os +import pickle +import stat +import sys +import tempfile +import typing as t +from hashlib import sha1 +from io import BytesIO +from types import CodeType + +if t.TYPE_CHECKING: + import typing_extensions as te + + from .environment import Environment + + class _MemcachedClient(te.Protocol): + def get(self, key: str) -> bytes: ... + + def set( + self, key: str, value: bytes, timeout: t.Optional[int] = None + ) -> None: ... + + +bc_version = 5 +# Magic bytes to identify Jinja bytecode cache files. Contains the +# Python major and minor version to avoid loading incompatible bytecode +# if a project upgrades its Python version. +bc_magic = ( + b"j2" + + pickle.dumps(bc_version, 2) + + pickle.dumps((sys.version_info[0] << 24) | sys.version_info[1], 2) +) + + +class Bucket: + """Buckets are used to store the bytecode for one template. It's created + and initialized by the bytecode cache and passed to the loading functions. + + The buckets get an internal checksum from the cache assigned and use this + to automatically reject outdated cache material. Individual bytecode + cache subclasses don't have to care about cache invalidation. + """ + + def __init__(self, environment: "Environment", key: str, checksum: str) -> None: + self.environment = environment + self.key = key + self.checksum = checksum + self.reset() + + def reset(self) -> None: + """Resets the bucket (unloads the bytecode).""" + self.code: t.Optional[CodeType] = None + + def load_bytecode(self, f: t.BinaryIO) -> None: + """Loads bytecode from a file or file like object.""" + # make sure the magic header is correct + magic = f.read(len(bc_magic)) + if magic != bc_magic: + self.reset() + return + # the source code of the file changed, we need to reload + checksum = pickle.load(f) + if self.checksum != checksum: + self.reset() + return + # if marshal_load fails then we need to reload + try: + self.code = marshal.load(f) + except (EOFError, ValueError, TypeError): + self.reset() + return + + def write_bytecode(self, f: t.IO[bytes]) -> None: + """Dump the bytecode into the file or file like object passed.""" + if self.code is None: + raise TypeError("can't write empty bucket") + f.write(bc_magic) + pickle.dump(self.checksum, f, 2) + marshal.dump(self.code, f) + + def bytecode_from_string(self, string: bytes) -> None: + """Load bytecode from bytes.""" + self.load_bytecode(BytesIO(string)) + + def bytecode_to_string(self) -> bytes: + """Return the bytecode as bytes.""" + out = BytesIO() + self.write_bytecode(out) + return out.getvalue() + + +class BytecodeCache: + """To implement your own bytecode cache you have to subclass this class + and override :meth:`load_bytecode` and :meth:`dump_bytecode`. Both of + these methods are passed a :class:`~jinja2.bccache.Bucket`. + + A very basic bytecode cache that saves the bytecode on the file system:: + + from os import path + + class MyCache(BytecodeCache): + + def __init__(self, directory): + self.directory = directory + + def load_bytecode(self, bucket): + filename = path.join(self.directory, bucket.key) + if path.exists(filename): + with open(filename, 'rb') as f: + bucket.load_bytecode(f) + + def dump_bytecode(self, bucket): + filename = path.join(self.directory, bucket.key) + with open(filename, 'wb') as f: + bucket.write_bytecode(f) + + A more advanced version of a filesystem based bytecode cache is part of + Jinja. + """ + + def load_bytecode(self, bucket: Bucket) -> None: + """Subclasses have to override this method to load bytecode into a + bucket. If they are not able to find code in the cache for the + bucket, it must not do anything. + """ + raise NotImplementedError() + + def dump_bytecode(self, bucket: Bucket) -> None: + """Subclasses have to override this method to write the bytecode + from a bucket back to the cache. If it unable to do so it must not + fail silently but raise an exception. + """ + raise NotImplementedError() + + def clear(self) -> None: + """Clears the cache. This method is not used by Jinja but should be + implemented to allow applications to clear the bytecode cache used + by a particular environment. + """ + + def get_cache_key( + self, name: str, filename: t.Optional[t.Union[str]] = None + ) -> str: + """Returns the unique hash key for this template name.""" + hash = sha1(name.encode("utf-8")) + + if filename is not None: + hash.update(f"|{filename}".encode()) + + return hash.hexdigest() + + def get_source_checksum(self, source: str) -> str: + """Returns a checksum for the source.""" + return sha1(source.encode("utf-8")).hexdigest() + + def get_bucket( + self, + environment: "Environment", + name: str, + filename: t.Optional[str], + source: str, + ) -> Bucket: + """Return a cache bucket for the given template. All arguments are + mandatory but filename may be `None`. + """ + key = self.get_cache_key(name, filename) + checksum = self.get_source_checksum(source) + bucket = Bucket(environment, key, checksum) + self.load_bytecode(bucket) + return bucket + + def set_bucket(self, bucket: Bucket) -> None: + """Put the bucket into the cache.""" + self.dump_bytecode(bucket) + + +class FileSystemBytecodeCache(BytecodeCache): + """A bytecode cache that stores bytecode on the filesystem. It accepts + two arguments: The directory where the cache items are stored and a + pattern string that is used to build the filename. + + If no directory is specified a default cache directory is selected. On + Windows the user's temp directory is used, on UNIX systems a directory + is created for the user in the system temp directory. + + The pattern can be used to have multiple separate caches operate on the + same directory. The default pattern is ``'__jinja2_%s.cache'``. ``%s`` + is replaced with the cache key. + + >>> bcc = FileSystemBytecodeCache('/tmp/jinja_cache', '%s.cache') + + This bytecode cache supports clearing of the cache using the clear method. + """ + + def __init__( + self, directory: t.Optional[str] = None, pattern: str = "__jinja2_%s.cache" + ) -> None: + if directory is None: + directory = self._get_default_cache_dir() + self.directory = directory + self.pattern = pattern + + def _get_default_cache_dir(self) -> str: + def _unsafe_dir() -> "te.NoReturn": + raise RuntimeError( + "Cannot determine safe temp directory. You " + "need to explicitly provide one." + ) + + tmpdir = tempfile.gettempdir() + + # On windows the temporary directory is used specific unless + # explicitly forced otherwise. We can just use that. + if os.name == "nt": + return tmpdir + if not hasattr(os, "getuid"): + _unsafe_dir() + + dirname = f"_jinja2-cache-{os.getuid()}" + actual_dir = os.path.join(tmpdir, dirname) + + try: + os.mkdir(actual_dir, stat.S_IRWXU) + except OSError as e: + if e.errno != errno.EEXIST: + raise + try: + os.chmod(actual_dir, stat.S_IRWXU) + actual_dir_stat = os.lstat(actual_dir) + if ( + actual_dir_stat.st_uid != os.getuid() + or not stat.S_ISDIR(actual_dir_stat.st_mode) + or stat.S_IMODE(actual_dir_stat.st_mode) != stat.S_IRWXU + ): + _unsafe_dir() + except OSError as e: + if e.errno != errno.EEXIST: + raise + + actual_dir_stat = os.lstat(actual_dir) + if ( + actual_dir_stat.st_uid != os.getuid() + or not stat.S_ISDIR(actual_dir_stat.st_mode) + or stat.S_IMODE(actual_dir_stat.st_mode) != stat.S_IRWXU + ): + _unsafe_dir() + + return actual_dir + + def _get_cache_filename(self, bucket: Bucket) -> str: + return os.path.join(self.directory, self.pattern % (bucket.key,)) + + def load_bytecode(self, bucket: Bucket) -> None: + filename = self._get_cache_filename(bucket) + + # Don't test for existence before opening the file, since the + # file could disappear after the test before the open. + try: + f = open(filename, "rb") + except (FileNotFoundError, IsADirectoryError, PermissionError): + # PermissionError can occur on Windows when an operation is + # in progress, such as calling clear(). + return + + with f: + bucket.load_bytecode(f) + + def dump_bytecode(self, bucket: Bucket) -> None: + # Write to a temporary file, then rename to the real name after + # writing. This avoids another process reading the file before + # it is fully written. + name = self._get_cache_filename(bucket) + f = tempfile.NamedTemporaryFile( + mode="wb", + dir=os.path.dirname(name), + prefix=os.path.basename(name), + suffix=".tmp", + delete=False, + ) + + def remove_silent() -> None: + try: + os.remove(f.name) + except OSError: + # Another process may have called clear(). On Windows, + # another program may be holding the file open. + pass + + try: + with f: + bucket.write_bytecode(f) + except BaseException: + remove_silent() + raise + + try: + os.replace(f.name, name) + except OSError: + # Another process may have called clear(). On Windows, + # another program may be holding the file open. + remove_silent() + except BaseException: + remove_silent() + raise + + def clear(self) -> None: + # imported lazily here because google app-engine doesn't support + # write access on the file system and the function does not exist + # normally. + from os import remove + + files = fnmatch.filter(os.listdir(self.directory), self.pattern % ("*",)) + for filename in files: + try: + remove(os.path.join(self.directory, filename)) + except OSError: + pass + + +class MemcachedBytecodeCache(BytecodeCache): + """This class implements a bytecode cache that uses a memcache cache for + storing the information. It does not enforce a specific memcache library + (tummy's memcache or cmemcache) but will accept any class that provides + the minimal interface required. + + Libraries compatible with this class: + + - `cachelib `_ + - `python-memcached `_ + + (Unfortunately the django cache interface is not compatible because it + does not support storing binary data, only text. You can however pass + the underlying cache client to the bytecode cache which is available + as `django.core.cache.cache._client`.) + + The minimal interface for the client passed to the constructor is this: + + .. class:: MinimalClientInterface + + .. method:: set(key, value[, timeout]) + + Stores the bytecode in the cache. `value` is a string and + `timeout` the timeout of the key. If timeout is not provided + a default timeout or no timeout should be assumed, if it's + provided it's an integer with the number of seconds the cache + item should exist. + + .. method:: get(key) + + Returns the value for the cache key. If the item does not + exist in the cache the return value must be `None`. + + The other arguments to the constructor are the prefix for all keys that + is added before the actual cache key and the timeout for the bytecode in + the cache system. We recommend a high (or no) timeout. + + This bytecode cache does not support clearing of used items in the cache. + The clear method is a no-operation function. + + .. versionadded:: 2.7 + Added support for ignoring memcache errors through the + `ignore_memcache_errors` parameter. + """ + + def __init__( + self, + client: "_MemcachedClient", + prefix: str = "jinja2/bytecode/", + timeout: t.Optional[int] = None, + ignore_memcache_errors: bool = True, + ): + self.client = client + self.prefix = prefix + self.timeout = timeout + self.ignore_memcache_errors = ignore_memcache_errors + + def load_bytecode(self, bucket: Bucket) -> None: + try: + code = self.client.get(self.prefix + bucket.key) + except Exception: + if not self.ignore_memcache_errors: + raise + else: + bucket.bytecode_from_string(code) + + def dump_bytecode(self, bucket: Bucket) -> None: + key = self.prefix + bucket.key + value = bucket.bytecode_to_string() + + try: + if self.timeout is not None: + self.client.set(key, value, self.timeout) + else: + self.client.set(key, value) + except Exception: + if not self.ignore_memcache_errors: + raise diff --git a/venv/Lib/site-packages/jinja2/compiler.py b/venv/Lib/site-packages/jinja2/compiler.py new file mode 100644 index 0000000000000000000000000000000000000000..a4ff6a1b11af3e1a868d1a74c48d842390259b43 --- /dev/null +++ b/venv/Lib/site-packages/jinja2/compiler.py @@ -0,0 +1,1998 @@ +"""Compiles nodes from the parser into Python code.""" + +import typing as t +from contextlib import contextmanager +from functools import update_wrapper +from io import StringIO +from itertools import chain +from keyword import iskeyword as is_python_keyword + +from markupsafe import escape +from markupsafe import Markup + +from . import nodes +from .exceptions import TemplateAssertionError +from .idtracking import Symbols +from .idtracking import VAR_LOAD_ALIAS +from .idtracking import VAR_LOAD_PARAMETER +from .idtracking import VAR_LOAD_RESOLVE +from .idtracking import VAR_LOAD_UNDEFINED +from .nodes import EvalContext +from .optimizer import Optimizer +from .utils import _PassArg +from .utils import concat +from .visitor import NodeVisitor + +if t.TYPE_CHECKING: + import typing_extensions as te + + from .environment import Environment + +F = t.TypeVar("F", bound=t.Callable[..., t.Any]) + +operators = { + "eq": "==", + "ne": "!=", + "gt": ">", + "gteq": ">=", + "lt": "<", + "lteq": "<=", + "in": "in", + "notin": "not in", +} + + +def optimizeconst(f: F) -> F: + def new_func( + self: "CodeGenerator", node: nodes.Expr, frame: "Frame", **kwargs: t.Any + ) -> t.Any: + # Only optimize if the frame is not volatile + if self.optimizer is not None and not frame.eval_ctx.volatile: + new_node = self.optimizer.visit(node, frame.eval_ctx) + + if new_node != node: + return self.visit(new_node, frame) + + return f(self, node, frame, **kwargs) + + return update_wrapper(new_func, f) # type: ignore[return-value] + + +def _make_binop(op: str) -> t.Callable[["CodeGenerator", nodes.BinExpr, "Frame"], None]: + @optimizeconst + def visitor(self: "CodeGenerator", node: nodes.BinExpr, frame: Frame) -> None: + if ( + self.environment.sandboxed and op in self.environment.intercepted_binops # type: ignore + ): + self.write(f"environment.call_binop(context, {op!r}, ") + self.visit(node.left, frame) + self.write(", ") + self.visit(node.right, frame) + else: + self.write("(") + self.visit(node.left, frame) + self.write(f" {op} ") + self.visit(node.right, frame) + + self.write(")") + + return visitor + + +def _make_unop( + op: str, +) -> t.Callable[["CodeGenerator", nodes.UnaryExpr, "Frame"], None]: + @optimizeconst + def visitor(self: "CodeGenerator", node: nodes.UnaryExpr, frame: Frame) -> None: + if ( + self.environment.sandboxed and op in self.environment.intercepted_unops # type: ignore + ): + self.write(f"environment.call_unop(context, {op!r}, ") + self.visit(node.node, frame) + else: + self.write("(" + op) + self.visit(node.node, frame) + + self.write(")") + + return visitor + + +def generate( + node: nodes.Template, + environment: "Environment", + name: t.Optional[str], + filename: t.Optional[str], + stream: t.Optional[t.TextIO] = None, + defer_init: bool = False, + optimized: bool = True, +) -> t.Optional[str]: + """Generate the python source for a node tree.""" + if not isinstance(node, nodes.Template): + raise TypeError("Can't compile non template nodes") + + generator = environment.code_generator_class( + environment, name, filename, stream, defer_init, optimized + ) + generator.visit(node) + + if stream is None: + return generator.stream.getvalue() # type: ignore + + return None + + +def has_safe_repr(value: t.Any) -> bool: + """Does the node have a safe representation?""" + if value is None or value is NotImplemented or value is Ellipsis: + return True + + if type(value) in {bool, int, float, complex, range, str, Markup}: + return True + + if type(value) in {tuple, list, set, frozenset}: + return all(has_safe_repr(v) for v in value) + + if type(value) is dict: # noqa E721 + return all(has_safe_repr(k) and has_safe_repr(v) for k, v in value.items()) + + return False + + +def find_undeclared( + nodes: t.Iterable[nodes.Node], names: t.Iterable[str] +) -> t.Set[str]: + """Check if the names passed are accessed undeclared. The return value + is a set of all the undeclared names from the sequence of names found. + """ + visitor = UndeclaredNameVisitor(names) + try: + for node in nodes: + visitor.visit(node) + except VisitorExit: + pass + return visitor.undeclared + + +class MacroRef: + def __init__(self, node: t.Union[nodes.Macro, nodes.CallBlock]) -> None: + self.node = node + self.accesses_caller = False + self.accesses_kwargs = False + self.accesses_varargs = False + + +class Frame: + """Holds compile time information for us.""" + + def __init__( + self, + eval_ctx: EvalContext, + parent: t.Optional["Frame"] = None, + level: t.Optional[int] = None, + ) -> None: + self.eval_ctx = eval_ctx + + # the parent of this frame + self.parent = parent + + if parent is None: + self.symbols = Symbols(level=level) + + # in some dynamic inheritance situations the compiler needs to add + # write tests around output statements. + self.require_output_check = False + + # inside some tags we are using a buffer rather than yield statements. + # this for example affects {% filter %} or {% macro %}. If a frame + # is buffered this variable points to the name of the list used as + # buffer. + self.buffer: t.Optional[str] = None + + # the name of the block we're in, otherwise None. + self.block: t.Optional[str] = None + + else: + self.symbols = Symbols(parent.symbols, level=level) + self.require_output_check = parent.require_output_check + self.buffer = parent.buffer + self.block = parent.block + + # a toplevel frame is the root + soft frames such as if conditions. + self.toplevel = False + + # the root frame is basically just the outermost frame, so no if + # conditions. This information is used to optimize inheritance + # situations. + self.rootlevel = False + + # variables set inside of loops and blocks should not affect outer frames, + # but they still needs to be kept track of as part of the active context. + self.loop_frame = False + self.block_frame = False + + # track whether the frame is being used in an if-statement or conditional + # expression as it determines which errors should be raised during runtime + # or compile time. + self.soft_frame = False + + def copy(self) -> "te.Self": + """Create a copy of the current one.""" + rv = object.__new__(self.__class__) + rv.__dict__.update(self.__dict__) + rv.symbols = self.symbols.copy() + return rv + + def inner(self, isolated: bool = False) -> "Frame": + """Return an inner frame.""" + if isolated: + return Frame(self.eval_ctx, level=self.symbols.level + 1) + return Frame(self.eval_ctx, self) + + def soft(self) -> "te.Self": + """Return a soft frame. A soft frame may not be modified as + standalone thing as it shares the resources with the frame it + was created of, but it's not a rootlevel frame any longer. + + This is only used to implement if-statements and conditional + expressions. + """ + rv = self.copy() + rv.rootlevel = False + rv.soft_frame = True + return rv + + __copy__ = copy + + +class VisitorExit(RuntimeError): + """Exception used by the `UndeclaredNameVisitor` to signal a stop.""" + + +class DependencyFinderVisitor(NodeVisitor): + """A visitor that collects filter and test calls.""" + + def __init__(self) -> None: + self.filters: t.Set[str] = set() + self.tests: t.Set[str] = set() + + def visit_Filter(self, node: nodes.Filter) -> None: + self.generic_visit(node) + self.filters.add(node.name) + + def visit_Test(self, node: nodes.Test) -> None: + self.generic_visit(node) + self.tests.add(node.name) + + def visit_Block(self, node: nodes.Block) -> None: + """Stop visiting at blocks.""" + + +class UndeclaredNameVisitor(NodeVisitor): + """A visitor that checks if a name is accessed without being + declared. This is different from the frame visitor as it will + not stop at closure frames. + """ + + def __init__(self, names: t.Iterable[str]) -> None: + self.names = set(names) + self.undeclared: t.Set[str] = set() + + def visit_Name(self, node: nodes.Name) -> None: + if node.ctx == "load" and node.name in self.names: + self.undeclared.add(node.name) + if self.undeclared == self.names: + raise VisitorExit() + else: + self.names.discard(node.name) + + def visit_Block(self, node: nodes.Block) -> None: + """Stop visiting a blocks.""" + + +class CompilerExit(Exception): + """Raised if the compiler encountered a situation where it just + doesn't make sense to further process the code. Any block that + raises such an exception is not further processed. + """ + + +class CodeGenerator(NodeVisitor): + def __init__( + self, + environment: "Environment", + name: t.Optional[str], + filename: t.Optional[str], + stream: t.Optional[t.TextIO] = None, + defer_init: bool = False, + optimized: bool = True, + ) -> None: + if stream is None: + stream = StringIO() + self.environment = environment + self.name = name + self.filename = filename + self.stream = stream + self.created_block_context = False + self.defer_init = defer_init + self.optimizer: t.Optional[Optimizer] = None + + if optimized: + self.optimizer = Optimizer(environment) + + # aliases for imports + self.import_aliases: t.Dict[str, str] = {} + + # a registry for all blocks. Because blocks are moved out + # into the global python scope they are registered here + self.blocks: t.Dict[str, nodes.Block] = {} + + # the number of extends statements so far + self.extends_so_far = 0 + + # some templates have a rootlevel extends. In this case we + # can safely assume that we're a child template and do some + # more optimizations. + self.has_known_extends = False + + # the current line number + self.code_lineno = 1 + + # registry of all filters and tests (global, not block local) + self.tests: t.Dict[str, str] = {} + self.filters: t.Dict[str, str] = {} + + # the debug information + self.debug_info: t.List[t.Tuple[int, int]] = [] + self._write_debug_info: t.Optional[int] = None + + # the number of new lines before the next write() + self._new_lines = 0 + + # the line number of the last written statement + self._last_line = 0 + + # true if nothing was written so far. + self._first_write = True + + # used by the `temporary_identifier` method to get new + # unique, temporary identifier + self._last_identifier = 0 + + # the current indentation + self._indentation = 0 + + # Tracks toplevel assignments + self._assign_stack: t.List[t.Set[str]] = [] + + # Tracks parameter definition blocks + self._param_def_block: t.List[t.Set[str]] = [] + + # Tracks the current context. + self._context_reference_stack = ["context"] + + @property + def optimized(self) -> bool: + return self.optimizer is not None + + # -- Various compilation helpers + + def fail(self, msg: str, lineno: int) -> "te.NoReturn": + """Fail with a :exc:`TemplateAssertionError`.""" + raise TemplateAssertionError(msg, lineno, self.name, self.filename) + + def temporary_identifier(self) -> str: + """Get a new unique identifier.""" + self._last_identifier += 1 + return f"t_{self._last_identifier}" + + def buffer(self, frame: Frame) -> None: + """Enable buffering for the frame from that point onwards.""" + frame.buffer = self.temporary_identifier() + self.writeline(f"{frame.buffer} = []") + + def return_buffer_contents( + self, frame: Frame, force_unescaped: bool = False + ) -> None: + """Return the buffer contents of the frame.""" + if not force_unescaped: + if frame.eval_ctx.volatile: + self.writeline("if context.eval_ctx.autoescape:") + self.indent() + self.writeline(f"return Markup(concat({frame.buffer}))") + self.outdent() + self.writeline("else:") + self.indent() + self.writeline(f"return concat({frame.buffer})") + self.outdent() + return + elif frame.eval_ctx.autoescape: + self.writeline(f"return Markup(concat({frame.buffer}))") + return + self.writeline(f"return concat({frame.buffer})") + + def indent(self) -> None: + """Indent by one.""" + self._indentation += 1 + + def outdent(self, step: int = 1) -> None: + """Outdent by step.""" + self._indentation -= step + + def start_write(self, frame: Frame, node: t.Optional[nodes.Node] = None) -> None: + """Yield or write into the frame buffer.""" + if frame.buffer is None: + self.writeline("yield ", node) + else: + self.writeline(f"{frame.buffer}.append(", node) + + def end_write(self, frame: Frame) -> None: + """End the writing process started by `start_write`.""" + if frame.buffer is not None: + self.write(")") + + def simple_write( + self, s: str, frame: Frame, node: t.Optional[nodes.Node] = None + ) -> None: + """Simple shortcut for start_write + write + end_write.""" + self.start_write(frame, node) + self.write(s) + self.end_write(frame) + + def blockvisit(self, nodes: t.Iterable[nodes.Node], frame: Frame) -> None: + """Visit a list of nodes as block in a frame. If the current frame + is no buffer a dummy ``if 0: yield None`` is written automatically. + """ + try: + self.writeline("pass") + for node in nodes: + self.visit(node, frame) + except CompilerExit: + pass + + def write(self, x: str) -> None: + """Write a string into the output stream.""" + if self._new_lines: + if not self._first_write: + self.stream.write("\n" * self._new_lines) + self.code_lineno += self._new_lines + if self._write_debug_info is not None: + self.debug_info.append((self._write_debug_info, self.code_lineno)) + self._write_debug_info = None + self._first_write = False + self.stream.write(" " * self._indentation) + self._new_lines = 0 + self.stream.write(x) + + def writeline( + self, x: str, node: t.Optional[nodes.Node] = None, extra: int = 0 + ) -> None: + """Combination of newline and write.""" + self.newline(node, extra) + self.write(x) + + def newline(self, node: t.Optional[nodes.Node] = None, extra: int = 0) -> None: + """Add one or more newlines before the next write.""" + self._new_lines = max(self._new_lines, 1 + extra) + if node is not None and node.lineno != self._last_line: + self._write_debug_info = node.lineno + self._last_line = node.lineno + + def signature( + self, + node: t.Union[nodes.Call, nodes.Filter, nodes.Test], + frame: Frame, + extra_kwargs: t.Optional[t.Mapping[str, t.Any]] = None, + ) -> None: + """Writes a function call to the stream for the current node. + A leading comma is added automatically. The extra keyword + arguments may not include python keywords otherwise a syntax + error could occur. The extra keyword arguments should be given + as python dict. + """ + # if any of the given keyword arguments is a python keyword + # we have to make sure that no invalid call is created. + kwarg_workaround = any( + is_python_keyword(t.cast(str, k)) + for k in chain((x.key for x in node.kwargs), extra_kwargs or ()) + ) + + for arg in node.args: + self.write(", ") + self.visit(arg, frame) + + if not kwarg_workaround: + for kwarg in node.kwargs: + self.write(", ") + self.visit(kwarg, frame) + if extra_kwargs is not None: + for key, value in extra_kwargs.items(): + self.write(f", {key}={value}") + if node.dyn_args: + self.write(", *") + self.visit(node.dyn_args, frame) + + if kwarg_workaround: + if node.dyn_kwargs is not None: + self.write(", **dict({") + else: + self.write(", **{") + for kwarg in node.kwargs: + self.write(f"{kwarg.key!r}: ") + self.visit(kwarg.value, frame) + self.write(", ") + if extra_kwargs is not None: + for key, value in extra_kwargs.items(): + self.write(f"{key!r}: {value}, ") + if node.dyn_kwargs is not None: + self.write("}, **") + self.visit(node.dyn_kwargs, frame) + self.write(")") + else: + self.write("}") + + elif node.dyn_kwargs is not None: + self.write(", **") + self.visit(node.dyn_kwargs, frame) + + def pull_dependencies(self, nodes: t.Iterable[nodes.Node]) -> None: + """Find all filter and test names used in the template and + assign them to variables in the compiled namespace. Checking + that the names are registered with the environment is done when + compiling the Filter and Test nodes. If the node is in an If or + CondExpr node, the check is done at runtime instead. + + .. versionchanged:: 3.0 + Filters and tests in If and CondExpr nodes are checked at + runtime instead of compile time. + """ + visitor = DependencyFinderVisitor() + + for node in nodes: + visitor.visit(node) + + for id_map, names, dependency in ( + (self.filters, visitor.filters, "filters"), + ( + self.tests, + visitor.tests, + "tests", + ), + ): + for name in sorted(names): + if name not in id_map: + id_map[name] = self.temporary_identifier() + + # add check during runtime that dependencies used inside of executed + # blocks are defined, as this step may be skipped during compile time + self.writeline("try:") + self.indent() + self.writeline(f"{id_map[name]} = environment.{dependency}[{name!r}]") + self.outdent() + self.writeline("except KeyError:") + self.indent() + self.writeline("@internalcode") + self.writeline(f"def {id_map[name]}(*unused):") + self.indent() + self.writeline( + f'raise TemplateRuntimeError("No {dependency[:-1]}' + f' named {name!r} found.")' + ) + self.outdent() + self.outdent() + + def enter_frame(self, frame: Frame) -> None: + undefs = [] + for target, (action, param) in frame.symbols.loads.items(): + if action == VAR_LOAD_PARAMETER: + pass + elif action == VAR_LOAD_RESOLVE: + self.writeline(f"{target} = {self.get_resolve_func()}({param!r})") + elif action == VAR_LOAD_ALIAS: + self.writeline(f"{target} = {param}") + elif action == VAR_LOAD_UNDEFINED: + undefs.append(target) + else: + raise NotImplementedError("unknown load instruction") + if undefs: + self.writeline(f"{' = '.join(undefs)} = missing") + + def leave_frame(self, frame: Frame, with_python_scope: bool = False) -> None: + if not with_python_scope: + undefs = [] + for target in frame.symbols.loads: + undefs.append(target) + if undefs: + self.writeline(f"{' = '.join(undefs)} = missing") + + def choose_async(self, async_value: str = "async ", sync_value: str = "") -> str: + return async_value if self.environment.is_async else sync_value + + def func(self, name: str) -> str: + return f"{self.choose_async()}def {name}" + + def macro_body( + self, node: t.Union[nodes.Macro, nodes.CallBlock], frame: Frame + ) -> t.Tuple[Frame, MacroRef]: + """Dump the function def of a macro or call block.""" + frame = frame.inner() + frame.symbols.analyze_node(node) + macro_ref = MacroRef(node) + + explicit_caller = None + skip_special_params = set() + args = [] + + for idx, arg in enumerate(node.args): + if arg.name == "caller": + explicit_caller = idx + if arg.name in ("kwargs", "varargs"): + skip_special_params.add(arg.name) + args.append(frame.symbols.ref(arg.name)) + + undeclared = find_undeclared(node.body, ("caller", "kwargs", "varargs")) + + if "caller" in undeclared: + # In older Jinja versions there was a bug that allowed caller + # to retain the special behavior even if it was mentioned in + # the argument list. However thankfully this was only really + # working if it was the last argument. So we are explicitly + # checking this now and error out if it is anywhere else in + # the argument list. + if explicit_caller is not None: + try: + node.defaults[explicit_caller - len(node.args)] + except IndexError: + self.fail( + "When defining macros or call blocks the " + 'special "caller" argument must be omitted ' + "or be given a default.", + node.lineno, + ) + else: + args.append(frame.symbols.declare_parameter("caller")) + macro_ref.accesses_caller = True + if "kwargs" in undeclared and "kwargs" not in skip_special_params: + args.append(frame.symbols.declare_parameter("kwargs")) + macro_ref.accesses_kwargs = True + if "varargs" in undeclared and "varargs" not in skip_special_params: + args.append(frame.symbols.declare_parameter("varargs")) + macro_ref.accesses_varargs = True + + # macros are delayed, they never require output checks + frame.require_output_check = False + frame.symbols.analyze_node(node) + self.writeline(f"{self.func('macro')}({', '.join(args)}):", node) + self.indent() + + self.buffer(frame) + self.enter_frame(frame) + + self.push_parameter_definitions(frame) + for idx, arg in enumerate(node.args): + ref = frame.symbols.ref(arg.name) + self.writeline(f"if {ref} is missing:") + self.indent() + try: + default = node.defaults[idx - len(node.args)] + except IndexError: + self.writeline( + f'{ref} = undefined("parameter {arg.name!r} was not provided",' + f" name={arg.name!r})" + ) + else: + self.writeline(f"{ref} = ") + self.visit(default, frame) + self.mark_parameter_stored(ref) + self.outdent() + self.pop_parameter_definitions() + + self.blockvisit(node.body, frame) + self.return_buffer_contents(frame, force_unescaped=True) + self.leave_frame(frame, with_python_scope=True) + self.outdent() + + return frame, macro_ref + + def macro_def(self, macro_ref: MacroRef, frame: Frame) -> None: + """Dump the macro definition for the def created by macro_body.""" + arg_tuple = ", ".join(repr(x.name) for x in macro_ref.node.args) + name = getattr(macro_ref.node, "name", None) + if len(macro_ref.node.args) == 1: + arg_tuple += "," + self.write( + f"Macro(environment, macro, {name!r}, ({arg_tuple})," + f" {macro_ref.accesses_kwargs!r}, {macro_ref.accesses_varargs!r}," + f" {macro_ref.accesses_caller!r}, context.eval_ctx.autoescape)" + ) + + def position(self, node: nodes.Node) -> str: + """Return a human readable position for the node.""" + rv = f"line {node.lineno}" + if self.name is not None: + rv = f"{rv} in {self.name!r}" + return rv + + def dump_local_context(self, frame: Frame) -> str: + items_kv = ", ".join( + f"{name!r}: {target}" + for name, target in frame.symbols.dump_stores().items() + ) + return f"{{{items_kv}}}" + + def write_commons(self) -> None: + """Writes a common preamble that is used by root and block functions. + Primarily this sets up common local helpers and enforces a generator + through a dead branch. + """ + self.writeline("resolve = context.resolve_or_missing") + self.writeline("undefined = environment.undefined") + self.writeline("concat = environment.concat") + # always use the standard Undefined class for the implicit else of + # conditional expressions + self.writeline("cond_expr_undefined = Undefined") + self.writeline("if 0: yield None") + + def push_parameter_definitions(self, frame: Frame) -> None: + """Pushes all parameter targets from the given frame into a local + stack that permits tracking of yet to be assigned parameters. In + particular this enables the optimization from `visit_Name` to skip + undefined expressions for parameters in macros as macros can reference + otherwise unbound parameters. + """ + self._param_def_block.append(frame.symbols.dump_param_targets()) + + def pop_parameter_definitions(self) -> None: + """Pops the current parameter definitions set.""" + self._param_def_block.pop() + + def mark_parameter_stored(self, target: str) -> None: + """Marks a parameter in the current parameter definitions as stored. + This will skip the enforced undefined checks. + """ + if self._param_def_block: + self._param_def_block[-1].discard(target) + + def push_context_reference(self, target: str) -> None: + self._context_reference_stack.append(target) + + def pop_context_reference(self) -> None: + self._context_reference_stack.pop() + + def get_context_ref(self) -> str: + return self._context_reference_stack[-1] + + def get_resolve_func(self) -> str: + target = self._context_reference_stack[-1] + if target == "context": + return "resolve" + return f"{target}.resolve" + + def derive_context(self, frame: Frame) -> str: + return f"{self.get_context_ref()}.derived({self.dump_local_context(frame)})" + + def parameter_is_undeclared(self, target: str) -> bool: + """Checks if a given target is an undeclared parameter.""" + if not self._param_def_block: + return False + return target in self._param_def_block[-1] + + def push_assign_tracking(self) -> None: + """Pushes a new layer for assignment tracking.""" + self._assign_stack.append(set()) + + def pop_assign_tracking(self, frame: Frame) -> None: + """Pops the topmost level for assignment tracking and updates the + context variables if necessary. + """ + vars = self._assign_stack.pop() + if ( + not frame.block_frame + and not frame.loop_frame + and not frame.toplevel + or not vars + ): + return + public_names = [x for x in vars if x[:1] != "_"] + if len(vars) == 1: + name = next(iter(vars)) + ref = frame.symbols.ref(name) + if frame.loop_frame: + self.writeline(f"_loop_vars[{name!r}] = {ref}") + return + if frame.block_frame: + self.writeline(f"_block_vars[{name!r}] = {ref}") + return + self.writeline(f"context.vars[{name!r}] = {ref}") + else: + if frame.loop_frame: + self.writeline("_loop_vars.update({") + elif frame.block_frame: + self.writeline("_block_vars.update({") + else: + self.writeline("context.vars.update({") + for idx, name in enumerate(sorted(vars)): + if idx: + self.write(", ") + ref = frame.symbols.ref(name) + self.write(f"{name!r}: {ref}") + self.write("})") + if not frame.block_frame and not frame.loop_frame and public_names: + if len(public_names) == 1: + self.writeline(f"context.exported_vars.add({public_names[0]!r})") + else: + names_str = ", ".join(map(repr, sorted(public_names))) + self.writeline(f"context.exported_vars.update(({names_str}))") + + # -- Statement Visitors + + def visit_Template( + self, node: nodes.Template, frame: t.Optional[Frame] = None + ) -> None: + assert frame is None, "no root frame allowed" + eval_ctx = EvalContext(self.environment, self.name) + + from .runtime import async_exported + from .runtime import exported + + if self.environment.is_async: + exported_names = sorted(exported + async_exported) + else: + exported_names = sorted(exported) + + self.writeline("from jinja2.runtime import " + ", ".join(exported_names)) + + # if we want a deferred initialization we cannot move the + # environment into a local name + envenv = "" if self.defer_init else ", environment=environment" + + # do we have an extends tag at all? If not, we can save some + # overhead by just not processing any inheritance code. + have_extends = node.find(nodes.Extends) is not None + + # find all blocks + for block in node.find_all(nodes.Block): + if block.name in self.blocks: + self.fail(f"block {block.name!r} defined twice", block.lineno) + self.blocks[block.name] = block + + # find all imports and import them + for import_ in node.find_all(nodes.ImportedName): + if import_.importname not in self.import_aliases: + imp = import_.importname + self.import_aliases[imp] = alias = self.temporary_identifier() + if "." in imp: + module, obj = imp.rsplit(".", 1) + self.writeline(f"from {module} import {obj} as {alias}") + else: + self.writeline(f"import {imp} as {alias}") + + # add the load name + self.writeline(f"name = {self.name!r}") + + # generate the root render function. + self.writeline( + f"{self.func('root')}(context, missing=missing{envenv}):", extra=1 + ) + self.indent() + self.write_commons() + + # process the root + frame = Frame(eval_ctx) + if "self" in find_undeclared(node.body, ("self",)): + ref = frame.symbols.declare_parameter("self") + self.writeline(f"{ref} = TemplateReference(context)") + frame.symbols.analyze_node(node) + frame.toplevel = frame.rootlevel = True + frame.require_output_check = have_extends and not self.has_known_extends + if have_extends: + self.writeline("parent_template = None") + self.enter_frame(frame) + self.pull_dependencies(node.body) + self.blockvisit(node.body, frame) + self.leave_frame(frame, with_python_scope=True) + self.outdent() + + # make sure that the parent root is called. + if have_extends: + if not self.has_known_extends: + self.indent() + self.writeline("if parent_template is not None:") + self.indent() + if not self.environment.is_async: + self.writeline("yield from parent_template.root_render_func(context)") + else: + self.writeline("agen = parent_template.root_render_func(context)") + self.writeline("try:") + self.indent() + self.writeline("async for event in agen:") + self.indent() + self.writeline("yield event") + self.outdent() + self.outdent() + self.writeline("finally: await agen.aclose()") + self.outdent(1 + (not self.has_known_extends)) + + # at this point we now have the blocks collected and can visit them too. + for name, block in self.blocks.items(): + self.writeline( + f"{self.func('block_' + name)}(context, missing=missing{envenv}):", + block, + 1, + ) + self.indent() + self.write_commons() + # It's important that we do not make this frame a child of the + # toplevel template. This would cause a variety of + # interesting issues with identifier tracking. + block_frame = Frame(eval_ctx) + block_frame.block_frame = True + undeclared = find_undeclared(block.body, ("self", "super")) + if "self" in undeclared: + ref = block_frame.symbols.declare_parameter("self") + self.writeline(f"{ref} = TemplateReference(context)") + if "super" in undeclared: + ref = block_frame.symbols.declare_parameter("super") + self.writeline(f"{ref} = context.super({name!r}, block_{name})") + block_frame.symbols.analyze_node(block) + block_frame.block = name + self.writeline("_block_vars = {}") + self.enter_frame(block_frame) + self.pull_dependencies(block.body) + self.blockvisit(block.body, block_frame) + self.leave_frame(block_frame, with_python_scope=True) + self.outdent() + + blocks_kv_str = ", ".join(f"{x!r}: block_{x}" for x in self.blocks) + self.writeline(f"blocks = {{{blocks_kv_str}}}", extra=1) + debug_kv_str = "&".join(f"{k}={v}" for k, v in self.debug_info) + self.writeline(f"debug_info = {debug_kv_str!r}") + + def visit_Block(self, node: nodes.Block, frame: Frame) -> None: + """Call a block and register it for the template.""" + level = 0 + if frame.toplevel: + # if we know that we are a child template, there is no need to + # check if we are one + if self.has_known_extends: + return + if self.extends_so_far > 0: + self.writeline("if parent_template is None:") + self.indent() + level += 1 + + if node.scoped: + context = self.derive_context(frame) + else: + context = self.get_context_ref() + + if node.required: + self.writeline(f"if len(context.blocks[{node.name!r}]) <= 1:", node) + self.indent() + self.writeline( + f'raise TemplateRuntimeError("Required block {node.name!r} not found")', + node, + ) + self.outdent() + + if not self.environment.is_async and frame.buffer is None: + self.writeline( + f"yield from context.blocks[{node.name!r}][0]({context})", node + ) + else: + self.writeline(f"gen = context.blocks[{node.name!r}][0]({context})") + self.writeline("try:") + self.indent() + self.writeline( + f"{self.choose_async()}for event in gen:", + node, + ) + self.indent() + self.simple_write("event", frame) + self.outdent() + self.outdent() + self.writeline( + f"finally: {self.choose_async('await gen.aclose()', 'gen.close()')}" + ) + + self.outdent(level) + + def visit_Extends(self, node: nodes.Extends, frame: Frame) -> None: + """Calls the extender.""" + if not frame.toplevel: + self.fail("cannot use extend from a non top-level scope", node.lineno) + + # if the number of extends statements in general is zero so + # far, we don't have to add a check if something extended + # the template before this one. + if self.extends_so_far > 0: + # if we have a known extends we just add a template runtime + # error into the generated code. We could catch that at compile + # time too, but i welcome it not to confuse users by throwing the + # same error at different times just "because we can". + if not self.has_known_extends: + self.writeline("if parent_template is not None:") + self.indent() + self.writeline('raise TemplateRuntimeError("extended multiple times")') + + # if we have a known extends already we don't need that code here + # as we know that the template execution will end here. + if self.has_known_extends: + raise CompilerExit() + else: + self.outdent() + + self.writeline("parent_template = environment.get_template(", node) + self.visit(node.template, frame) + self.write(f", {self.name!r})") + self.writeline("for name, parent_block in parent_template.blocks.items():") + self.indent() + self.writeline("context.blocks.setdefault(name, []).append(parent_block)") + self.outdent() + + # if this extends statement was in the root level we can take + # advantage of that information and simplify the generated code + # in the top level from this point onwards + if frame.rootlevel: + self.has_known_extends = True + + # and now we have one more + self.extends_so_far += 1 + + def visit_Include(self, node: nodes.Include, frame: Frame) -> None: + """Handles includes.""" + if node.ignore_missing: + self.writeline("try:") + self.indent() + + func_name = "get_or_select_template" + if isinstance(node.template, nodes.Const): + if isinstance(node.template.value, str): + func_name = "get_template" + elif isinstance(node.template.value, (tuple, list)): + func_name = "select_template" + elif isinstance(node.template, (nodes.Tuple, nodes.List)): + func_name = "select_template" + + self.writeline(f"template = environment.{func_name}(", node) + self.visit(node.template, frame) + self.write(f", {self.name!r})") + if node.ignore_missing: + self.outdent() + self.writeline("except TemplateNotFound:") + self.indent() + self.writeline("pass") + self.outdent() + self.writeline("else:") + self.indent() + + def loop_body() -> None: + self.indent() + self.simple_write("event", frame) + self.outdent() + + if node.with_context: + self.writeline( + f"gen = template.root_render_func(" + "template.new_context(context.get_all(), True," + f" {self.dump_local_context(frame)}))" + ) + self.writeline("try:") + self.indent() + self.writeline(f"{self.choose_async()}for event in gen:") + loop_body() + self.outdent() + self.writeline( + f"finally: {self.choose_async('await gen.aclose()', 'gen.close()')}" + ) + elif self.environment.is_async: + self.writeline( + "for event in (await template._get_default_module_async())" + "._body_stream:" + ) + loop_body() + else: + self.writeline("yield from template._get_default_module()._body_stream") + + if node.ignore_missing: + self.outdent() + + def _import_common( + self, node: t.Union[nodes.Import, nodes.FromImport], frame: Frame + ) -> None: + self.write(f"{self.choose_async('await ')}environment.get_template(") + self.visit(node.template, frame) + self.write(f", {self.name!r}).") + + if node.with_context: + f_name = f"make_module{self.choose_async('_async')}" + self.write( + f"{f_name}(context.get_all(), True, {self.dump_local_context(frame)})" + ) + else: + self.write(f"_get_default_module{self.choose_async('_async')}(context)") + + def visit_Import(self, node: nodes.Import, frame: Frame) -> None: + """Visit regular imports.""" + self.writeline(f"{frame.symbols.ref(node.target)} = ", node) + if frame.toplevel: + self.write(f"context.vars[{node.target!r}] = ") + + self._import_common(node, frame) + + if frame.toplevel and not node.target.startswith("_"): + self.writeline(f"context.exported_vars.discard({node.target!r})") + + def visit_FromImport(self, node: nodes.FromImport, frame: Frame) -> None: + """Visit named imports.""" + self.newline(node) + self.write("included_template = ") + self._import_common(node, frame) + var_names = [] + discarded_names = [] + for name in node.names: + if isinstance(name, tuple): + name, alias = name + else: + alias = name + self.writeline( + f"{frame.symbols.ref(alias)} =" + f" getattr(included_template, {name!r}, missing)" + ) + self.writeline(f"if {frame.symbols.ref(alias)} is missing:") + self.indent() + # The position will contain the template name, and will be formatted + # into a string that will be compiled into an f-string. Curly braces + # in the name must be replaced with escapes so that they will not be + # executed as part of the f-string. + position = self.position(node).replace("{", "{{").replace("}", "}}") + message = ( + "the template {included_template.__name__!r}" + f" (imported on {position})" + f" does not export the requested name {name!r}" + ) + self.writeline( + f"{frame.symbols.ref(alias)} = undefined(f{message!r}, name={name!r})" + ) + self.outdent() + if frame.toplevel: + var_names.append(alias) + if not alias.startswith("_"): + discarded_names.append(alias) + + if var_names: + if len(var_names) == 1: + name = var_names[0] + self.writeline(f"context.vars[{name!r}] = {frame.symbols.ref(name)}") + else: + names_kv = ", ".join( + f"{name!r}: {frame.symbols.ref(name)}" for name in var_names + ) + self.writeline(f"context.vars.update({{{names_kv}}})") + if discarded_names: + if len(discarded_names) == 1: + self.writeline(f"context.exported_vars.discard({discarded_names[0]!r})") + else: + names_str = ", ".join(map(repr, discarded_names)) + self.writeline( + f"context.exported_vars.difference_update(({names_str}))" + ) + + def visit_For(self, node: nodes.For, frame: Frame) -> None: + loop_frame = frame.inner() + loop_frame.loop_frame = True + test_frame = frame.inner() + else_frame = frame.inner() + + # try to figure out if we have an extended loop. An extended loop + # is necessary if the loop is in recursive mode if the special loop + # variable is accessed in the body if the body is a scoped block. + extended_loop = ( + node.recursive + or "loop" + in find_undeclared(node.iter_child_nodes(only=("body",)), ("loop",)) + or any(block.scoped for block in node.find_all(nodes.Block)) + ) + + loop_ref = None + if extended_loop: + loop_ref = loop_frame.symbols.declare_parameter("loop") + + loop_frame.symbols.analyze_node(node, for_branch="body") + if node.else_: + else_frame.symbols.analyze_node(node, for_branch="else") + + if node.test: + loop_filter_func = self.temporary_identifier() + test_frame.symbols.analyze_node(node, for_branch="test") + self.writeline(f"{self.func(loop_filter_func)}(fiter):", node.test) + self.indent() + self.enter_frame(test_frame) + self.writeline(self.choose_async("async for ", "for ")) + self.visit(node.target, loop_frame) + self.write(" in ") + self.write(self.choose_async("auto_aiter(fiter)", "fiter")) + self.write(":") + self.indent() + self.writeline("if ", node.test) + self.visit(node.test, test_frame) + self.write(":") + self.indent() + self.writeline("yield ") + self.visit(node.target, loop_frame) + self.outdent(3) + self.leave_frame(test_frame, with_python_scope=True) + + # if we don't have an recursive loop we have to find the shadowed + # variables at that point. Because loops can be nested but the loop + # variable is a special one we have to enforce aliasing for it. + if node.recursive: + self.writeline( + f"{self.func('loop')}(reciter, loop_render_func, depth=0):", node + ) + self.indent() + self.buffer(loop_frame) + + # Use the same buffer for the else frame + else_frame.buffer = loop_frame.buffer + + # make sure the loop variable is a special one and raise a template + # assertion error if a loop tries to write to loop + if extended_loop: + self.writeline(f"{loop_ref} = missing") + + for name in node.find_all(nodes.Name): + if name.ctx == "store" and name.name == "loop": + self.fail( + "Can't assign to special loop variable in for-loop target", + name.lineno, + ) + + if node.else_: + iteration_indicator = self.temporary_identifier() + self.writeline(f"{iteration_indicator} = 1") + + self.writeline(self.choose_async("async for ", "for "), node) + self.visit(node.target, loop_frame) + if extended_loop: + self.write(f", {loop_ref} in {self.choose_async('Async')}LoopContext(") + else: + self.write(" in ") + + if node.test: + self.write(f"{loop_filter_func}(") + if node.recursive: + self.write("reciter") + else: + if self.environment.is_async and not extended_loop: + self.write("auto_aiter(") + self.visit(node.iter, frame) + if self.environment.is_async and not extended_loop: + self.write(")") + if node.test: + self.write(")") + + if node.recursive: + self.write(", undefined, loop_render_func, depth):") + else: + self.write(", undefined):" if extended_loop else ":") + + self.indent() + self.enter_frame(loop_frame) + + self.writeline("_loop_vars = {}") + self.blockvisit(node.body, loop_frame) + if node.else_: + self.writeline(f"{iteration_indicator} = 0") + self.outdent() + self.leave_frame( + loop_frame, with_python_scope=node.recursive and not node.else_ + ) + + if node.else_: + self.writeline(f"if {iteration_indicator}:") + self.indent() + self.enter_frame(else_frame) + self.blockvisit(node.else_, else_frame) + self.leave_frame(else_frame) + self.outdent() + + # if the node was recursive we have to return the buffer contents + # and start the iteration code + if node.recursive: + self.return_buffer_contents(loop_frame) + self.outdent() + self.start_write(frame, node) + self.write(f"{self.choose_async('await ')}loop(") + if self.environment.is_async: + self.write("auto_aiter(") + self.visit(node.iter, frame) + if self.environment.is_async: + self.write(")") + self.write(", loop)") + self.end_write(frame) + + # at the end of the iteration, clear any assignments made in the + # loop from the top level + if self._assign_stack: + self._assign_stack[-1].difference_update(loop_frame.symbols.stores) + + def visit_If(self, node: nodes.If, frame: Frame) -> None: + if_frame = frame.soft() + self.writeline("if ", node) + self.visit(node.test, if_frame) + self.write(":") + self.indent() + self.blockvisit(node.body, if_frame) + self.outdent() + for elif_ in node.elif_: + self.writeline("elif ", elif_) + self.visit(elif_.test, if_frame) + self.write(":") + self.indent() + self.blockvisit(elif_.body, if_frame) + self.outdent() + if node.else_: + self.writeline("else:") + self.indent() + self.blockvisit(node.else_, if_frame) + self.outdent() + + def visit_Macro(self, node: nodes.Macro, frame: Frame) -> None: + macro_frame, macro_ref = self.macro_body(node, frame) + self.newline() + if frame.toplevel: + if not node.name.startswith("_"): + self.write(f"context.exported_vars.add({node.name!r})") + self.writeline(f"context.vars[{node.name!r}] = ") + self.write(f"{frame.symbols.ref(node.name)} = ") + self.macro_def(macro_ref, macro_frame) + + def visit_CallBlock(self, node: nodes.CallBlock, frame: Frame) -> None: + call_frame, macro_ref = self.macro_body(node, frame) + self.writeline("caller = ") + self.macro_def(macro_ref, call_frame) + self.start_write(frame, node) + self.visit_Call(node.call, frame, forward_caller=True) + self.end_write(frame) + + def visit_FilterBlock(self, node: nodes.FilterBlock, frame: Frame) -> None: + filter_frame = frame.inner() + filter_frame.symbols.analyze_node(node) + self.enter_frame(filter_frame) + self.buffer(filter_frame) + self.blockvisit(node.body, filter_frame) + self.start_write(frame, node) + self.visit_Filter(node.filter, filter_frame) + self.end_write(frame) + self.leave_frame(filter_frame) + + def visit_With(self, node: nodes.With, frame: Frame) -> None: + with_frame = frame.inner() + with_frame.symbols.analyze_node(node) + self.enter_frame(with_frame) + for target, expr in zip(node.targets, node.values): + self.newline() + self.visit(target, with_frame) + self.write(" = ") + self.visit(expr, frame) + self.blockvisit(node.body, with_frame) + self.leave_frame(with_frame) + + def visit_ExprStmt(self, node: nodes.ExprStmt, frame: Frame) -> None: + self.newline(node) + self.visit(node.node, frame) + + class _FinalizeInfo(t.NamedTuple): + const: t.Optional[t.Callable[..., str]] + src: t.Optional[str] + + @staticmethod + def _default_finalize(value: t.Any) -> t.Any: + """The default finalize function if the environment isn't + configured with one. Or, if the environment has one, this is + called on that function's output for constants. + """ + return str(value) + + _finalize: t.Optional[_FinalizeInfo] = None + + def _make_finalize(self) -> _FinalizeInfo: + """Build the finalize function to be used on constants and at + runtime. Cached so it's only created once for all output nodes. + + Returns a ``namedtuple`` with the following attributes: + + ``const`` + A function to finalize constant data at compile time. + + ``src`` + Source code to output around nodes to be evaluated at + runtime. + """ + if self._finalize is not None: + return self._finalize + + finalize: t.Optional[t.Callable[..., t.Any]] + finalize = default = self._default_finalize + src = None + + if self.environment.finalize: + src = "environment.finalize(" + env_finalize = self.environment.finalize + pass_arg = { + _PassArg.context: "context", + _PassArg.eval_context: "context.eval_ctx", + _PassArg.environment: "environment", + }.get( + _PassArg.from_obj(env_finalize) # type: ignore + ) + finalize = None + + if pass_arg is None: + + def finalize(value: t.Any) -> t.Any: # noqa: F811 + return default(env_finalize(value)) + + else: + src = f"{src}{pass_arg}, " + + if pass_arg == "environment": + + def finalize(value: t.Any) -> t.Any: # noqa: F811 + return default(env_finalize(self.environment, value)) + + self._finalize = self._FinalizeInfo(finalize, src) + return self._finalize + + def _output_const_repr(self, group: t.Iterable[t.Any]) -> str: + """Given a group of constant values converted from ``Output`` + child nodes, produce a string to write to the template module + source. + """ + return repr(concat(group)) + + def _output_child_to_const( + self, node: nodes.Expr, frame: Frame, finalize: _FinalizeInfo + ) -> str: + """Try to optimize a child of an ``Output`` node by trying to + convert it to constant, finalized data at compile time. + + If :exc:`Impossible` is raised, the node is not constant and + will be evaluated at runtime. Any other exception will also be + evaluated at runtime for easier debugging. + """ + const = node.as_const(frame.eval_ctx) + + if frame.eval_ctx.autoescape: + const = escape(const) + + # Template data doesn't go through finalize. + if isinstance(node, nodes.TemplateData): + return str(const) + + return finalize.const(const) # type: ignore + + def _output_child_pre( + self, node: nodes.Expr, frame: Frame, finalize: _FinalizeInfo + ) -> None: + """Output extra source code before visiting a child of an + ``Output`` node. + """ + if frame.eval_ctx.volatile: + self.write("(escape if context.eval_ctx.autoescape else str)(") + elif frame.eval_ctx.autoescape: + self.write("escape(") + else: + self.write("str(") + + if finalize.src is not None: + self.write(finalize.src) + + def _output_child_post( + self, node: nodes.Expr, frame: Frame, finalize: _FinalizeInfo + ) -> None: + """Output extra source code after visiting a child of an + ``Output`` node. + """ + self.write(")") + + if finalize.src is not None: + self.write(")") + + def visit_Output(self, node: nodes.Output, frame: Frame) -> None: + # If an extends is active, don't render outside a block. + if frame.require_output_check: + # A top-level extends is known to exist at compile time. + if self.has_known_extends: + return + + self.writeline("if parent_template is None:") + self.indent() + + finalize = self._make_finalize() + body: t.List[t.Union[t.List[t.Any], nodes.Expr]] = [] + + # Evaluate constants at compile time if possible. Each item in + # body will be either a list of static data or a node to be + # evaluated at runtime. + for child in node.nodes: + try: + if not ( + # If the finalize function requires runtime context, + # constants can't be evaluated at compile time. + finalize.const + # Unless it's basic template data that won't be + # finalized anyway. + or isinstance(child, nodes.TemplateData) + ): + raise nodes.Impossible() + + const = self._output_child_to_const(child, frame, finalize) + except (nodes.Impossible, Exception): + # The node was not constant and needs to be evaluated at + # runtime. Or another error was raised, which is easier + # to debug at runtime. + body.append(child) + continue + + if body and isinstance(body[-1], list): + body[-1].append(const) + else: + body.append([const]) + + if frame.buffer is not None: + if len(body) == 1: + self.writeline(f"{frame.buffer}.append(") + else: + self.writeline(f"{frame.buffer}.extend((") + + self.indent() + + for item in body: + if isinstance(item, list): + # A group of constant data to join and output. + val = self._output_const_repr(item) + + if frame.buffer is None: + self.writeline("yield " + val) + else: + self.writeline(val + ",") + else: + if frame.buffer is None: + self.writeline("yield ", item) + else: + self.newline(item) + + # A node to be evaluated at runtime. + self._output_child_pre(item, frame, finalize) + self.visit(item, frame) + self._output_child_post(item, frame, finalize) + + if frame.buffer is not None: + self.write(",") + + if frame.buffer is not None: + self.outdent() + self.writeline(")" if len(body) == 1 else "))") + + if frame.require_output_check: + self.outdent() + + def visit_Assign(self, node: nodes.Assign, frame: Frame) -> None: + self.push_assign_tracking() + + # ``a.b`` is allowed for assignment, and is parsed as an NSRef. However, + # it is only valid if it references a Namespace object. Emit a check for + # that for each ref here, before assignment code is emitted. This can't + # be done in visit_NSRef as the ref could be in the middle of a tuple. + seen_refs: t.Set[str] = set() + + for nsref in node.find_all(nodes.NSRef): + if nsref.name in seen_refs: + # Only emit the check for each reference once, in case the same + # ref is used multiple times in a tuple, `ns.a, ns.b = c, d`. + continue + + seen_refs.add(nsref.name) + ref = frame.symbols.ref(nsref.name) + self.writeline(f"if not isinstance({ref}, Namespace):") + self.indent() + self.writeline( + "raise TemplateRuntimeError" + '("cannot assign attribute on non-namespace object")' + ) + self.outdent() + + self.newline(node) + self.visit(node.target, frame) + self.write(" = ") + self.visit(node.node, frame) + self.pop_assign_tracking(frame) + + def visit_AssignBlock(self, node: nodes.AssignBlock, frame: Frame) -> None: + self.push_assign_tracking() + block_frame = frame.inner() + # This is a special case. Since a set block always captures we + # will disable output checks. This way one can use set blocks + # toplevel even in extended templates. + block_frame.require_output_check = False + block_frame.symbols.analyze_node(node) + self.enter_frame(block_frame) + self.buffer(block_frame) + self.blockvisit(node.body, block_frame) + self.newline(node) + self.visit(node.target, frame) + self.write(" = (Markup if context.eval_ctx.autoescape else identity)(") + if node.filter is not None: + self.visit_Filter(node.filter, block_frame) + else: + self.write(f"concat({block_frame.buffer})") + self.write(")") + self.pop_assign_tracking(frame) + self.leave_frame(block_frame) + + # -- Expression Visitors + + def visit_Name(self, node: nodes.Name, frame: Frame) -> None: + if node.ctx == "store" and ( + frame.toplevel or frame.loop_frame or frame.block_frame + ): + if self._assign_stack: + self._assign_stack[-1].add(node.name) + ref = frame.symbols.ref(node.name) + + # If we are looking up a variable we might have to deal with the + # case where it's undefined. We can skip that case if the load + # instruction indicates a parameter which are always defined. + if node.ctx == "load": + load = frame.symbols.find_load(ref) + if not ( + load is not None + and load[0] == VAR_LOAD_PARAMETER + and not self.parameter_is_undeclared(ref) + ): + self.write( + f"(undefined(name={node.name!r}) if {ref} is missing else {ref})" + ) + return + + self.write(ref) + + def visit_NSRef(self, node: nodes.NSRef, frame: Frame) -> None: + # NSRef is a dotted assignment target a.b=c, but uses a[b]=c internally. + # visit_Assign emits code to validate that each ref is to a Namespace + # object only. That can't be emitted here as the ref could be in the + # middle of a tuple assignment. + ref = frame.symbols.ref(node.name) + self.writeline(f"{ref}[{node.attr!r}]") + + def visit_Const(self, node: nodes.Const, frame: Frame) -> None: + val = node.as_const(frame.eval_ctx) + if isinstance(val, float): + self.write(str(val)) + else: + self.write(repr(val)) + + def visit_TemplateData(self, node: nodes.TemplateData, frame: Frame) -> None: + try: + self.write(repr(node.as_const(frame.eval_ctx))) + except nodes.Impossible: + self.write( + f"(Markup if context.eval_ctx.autoescape else identity)({node.data!r})" + ) + + def visit_Tuple(self, node: nodes.Tuple, frame: Frame) -> None: + self.write("(") + idx = -1 + for idx, item in enumerate(node.items): + if idx: + self.write(", ") + self.visit(item, frame) + self.write(",)" if idx == 0 else ")") + + def visit_List(self, node: nodes.List, frame: Frame) -> None: + self.write("[") + for idx, item in enumerate(node.items): + if idx: + self.write(", ") + self.visit(item, frame) + self.write("]") + + def visit_Dict(self, node: nodes.Dict, frame: Frame) -> None: + self.write("{") + for idx, item in enumerate(node.items): + if idx: + self.write(", ") + self.visit(item.key, frame) + self.write(": ") + self.visit(item.value, frame) + self.write("}") + + visit_Add = _make_binop("+") + visit_Sub = _make_binop("-") + visit_Mul = _make_binop("*") + visit_Div = _make_binop("/") + visit_FloorDiv = _make_binop("//") + visit_Pow = _make_binop("**") + visit_Mod = _make_binop("%") + visit_And = _make_binop("and") + visit_Or = _make_binop("or") + visit_Pos = _make_unop("+") + visit_Neg = _make_unop("-") + visit_Not = _make_unop("not ") + + @optimizeconst + def visit_Concat(self, node: nodes.Concat, frame: Frame) -> None: + if frame.eval_ctx.volatile: + func_name = "(markup_join if context.eval_ctx.volatile else str_join)" + elif frame.eval_ctx.autoescape: + func_name = "markup_join" + else: + func_name = "str_join" + self.write(f"{func_name}((") + for arg in node.nodes: + self.visit(arg, frame) + self.write(", ") + self.write("))") + + @optimizeconst + def visit_Compare(self, node: nodes.Compare, frame: Frame) -> None: + self.write("(") + self.visit(node.expr, frame) + for op in node.ops: + self.visit(op, frame) + self.write(")") + + def visit_Operand(self, node: nodes.Operand, frame: Frame) -> None: + self.write(f" {operators[node.op]} ") + self.visit(node.expr, frame) + + @optimizeconst + def visit_Getattr(self, node: nodes.Getattr, frame: Frame) -> None: + if self.environment.is_async: + self.write("(await auto_await(") + + self.write("environment.getattr(") + self.visit(node.node, frame) + self.write(f", {node.attr!r})") + + if self.environment.is_async: + self.write("))") + + @optimizeconst + def visit_Getitem(self, node: nodes.Getitem, frame: Frame) -> None: + # slices bypass the environment getitem method. + if isinstance(node.arg, nodes.Slice): + self.visit(node.node, frame) + self.write("[") + self.visit(node.arg, frame) + self.write("]") + else: + if self.environment.is_async: + self.write("(await auto_await(") + + self.write("environment.getitem(") + self.visit(node.node, frame) + self.write(", ") + self.visit(node.arg, frame) + self.write(")") + + if self.environment.is_async: + self.write("))") + + def visit_Slice(self, node: nodes.Slice, frame: Frame) -> None: + if node.start is not None: + self.visit(node.start, frame) + self.write(":") + if node.stop is not None: + self.visit(node.stop, frame) + if node.step is not None: + self.write(":") + self.visit(node.step, frame) + + @contextmanager + def _filter_test_common( + self, node: t.Union[nodes.Filter, nodes.Test], frame: Frame, is_filter: bool + ) -> t.Iterator[None]: + if self.environment.is_async: + self.write("(await auto_await(") + + if is_filter: + self.write(f"{self.filters[node.name]}(") + func = self.environment.filters.get(node.name) + else: + self.write(f"{self.tests[node.name]}(") + func = self.environment.tests.get(node.name) + + # When inside an If or CondExpr frame, allow the filter to be + # undefined at compile time and only raise an error if it's + # actually called at runtime. See pull_dependencies. + if func is None and not frame.soft_frame: + type_name = "filter" if is_filter else "test" + self.fail(f"No {type_name} named {node.name!r}.", node.lineno) + + pass_arg = { + _PassArg.context: "context", + _PassArg.eval_context: "context.eval_ctx", + _PassArg.environment: "environment", + }.get( + _PassArg.from_obj(func) # type: ignore + ) + + if pass_arg is not None: + self.write(f"{pass_arg}, ") + + # Back to the visitor function to handle visiting the target of + # the filter or test. + yield + + self.signature(node, frame) + self.write(")") + + if self.environment.is_async: + self.write("))") + + @optimizeconst + def visit_Filter(self, node: nodes.Filter, frame: Frame) -> None: + with self._filter_test_common(node, frame, True): + # if the filter node is None we are inside a filter block + # and want to write to the current buffer + if node.node is not None: + self.visit(node.node, frame) + elif frame.eval_ctx.volatile: + self.write( + f"(Markup(concat({frame.buffer}))" + f" if context.eval_ctx.autoescape else concat({frame.buffer}))" + ) + elif frame.eval_ctx.autoescape: + self.write(f"Markup(concat({frame.buffer}))") + else: + self.write(f"concat({frame.buffer})") + + @optimizeconst + def visit_Test(self, node: nodes.Test, frame: Frame) -> None: + with self._filter_test_common(node, frame, False): + self.visit(node.node, frame) + + @optimizeconst + def visit_CondExpr(self, node: nodes.CondExpr, frame: Frame) -> None: + frame = frame.soft() + + def write_expr2() -> None: + if node.expr2 is not None: + self.visit(node.expr2, frame) + return + + self.write( + f'cond_expr_undefined("the inline if-expression on' + f" {self.position(node)} evaluated to false and no else" + f' section was defined.")' + ) + + self.write("(") + self.visit(node.expr1, frame) + self.write(" if ") + self.visit(node.test, frame) + self.write(" else ") + write_expr2() + self.write(")") + + @optimizeconst + def visit_Call( + self, node: nodes.Call, frame: Frame, forward_caller: bool = False + ) -> None: + if self.environment.is_async: + self.write("(await auto_await(") + if self.environment.sandboxed: + self.write("environment.call(context, ") + else: + self.write("context.call(") + self.visit(node.node, frame) + extra_kwargs = {"caller": "caller"} if forward_caller else None + loop_kwargs = {"_loop_vars": "_loop_vars"} if frame.loop_frame else {} + block_kwargs = {"_block_vars": "_block_vars"} if frame.block_frame else {} + if extra_kwargs: + extra_kwargs.update(loop_kwargs, **block_kwargs) + elif loop_kwargs or block_kwargs: + extra_kwargs = dict(loop_kwargs, **block_kwargs) + self.signature(node, frame, extra_kwargs) + self.write(")") + if self.environment.is_async: + self.write("))") + + def visit_Keyword(self, node: nodes.Keyword, frame: Frame) -> None: + self.write(node.key + "=") + self.visit(node.value, frame) + + # -- Unused nodes for extensions + + def visit_MarkSafe(self, node: nodes.MarkSafe, frame: Frame) -> None: + self.write("Markup(") + self.visit(node.expr, frame) + self.write(")") + + def visit_MarkSafeIfAutoescape( + self, node: nodes.MarkSafeIfAutoescape, frame: Frame + ) -> None: + self.write("(Markup if context.eval_ctx.autoescape else identity)(") + self.visit(node.expr, frame) + self.write(")") + + def visit_EnvironmentAttribute( + self, node: nodes.EnvironmentAttribute, frame: Frame + ) -> None: + self.write("environment." + node.name) + + def visit_ExtensionAttribute( + self, node: nodes.ExtensionAttribute, frame: Frame + ) -> None: + self.write(f"environment.extensions[{node.identifier!r}].{node.name}") + + def visit_ImportedName(self, node: nodes.ImportedName, frame: Frame) -> None: + self.write(self.import_aliases[node.importname]) + + def visit_InternalName(self, node: nodes.InternalName, frame: Frame) -> None: + self.write(node.name) + + def visit_ContextReference( + self, node: nodes.ContextReference, frame: Frame + ) -> None: + self.write("context") + + def visit_DerivedContextReference( + self, node: nodes.DerivedContextReference, frame: Frame + ) -> None: + self.write(self.derive_context(frame)) + + def visit_Continue(self, node: nodes.Continue, frame: Frame) -> None: + self.writeline("continue", node) + + def visit_Break(self, node: nodes.Break, frame: Frame) -> None: + self.writeline("break", node) + + def visit_Scope(self, node: nodes.Scope, frame: Frame) -> None: + scope_frame = frame.inner() + scope_frame.symbols.analyze_node(node) + self.enter_frame(scope_frame) + self.blockvisit(node.body, scope_frame) + self.leave_frame(scope_frame) + + def visit_OverlayScope(self, node: nodes.OverlayScope, frame: Frame) -> None: + ctx = self.temporary_identifier() + self.writeline(f"{ctx} = {self.derive_context(frame)}") + self.writeline(f"{ctx}.vars = ") + self.visit(node.context, frame) + self.push_context_reference(ctx) + + scope_frame = frame.inner(isolated=True) + scope_frame.symbols.analyze_node(node) + self.enter_frame(scope_frame) + self.blockvisit(node.body, scope_frame) + self.leave_frame(scope_frame) + self.pop_context_reference() + + def visit_EvalContextModifier( + self, node: nodes.EvalContextModifier, frame: Frame + ) -> None: + for keyword in node.options: + self.writeline(f"context.eval_ctx.{keyword.key} = ") + self.visit(keyword.value, frame) + try: + val = keyword.value.as_const(frame.eval_ctx) + except nodes.Impossible: + frame.eval_ctx.volatile = True + else: + setattr(frame.eval_ctx, keyword.key, val) + + def visit_ScopedEvalContextModifier( + self, node: nodes.ScopedEvalContextModifier, frame: Frame + ) -> None: + old_ctx_name = self.temporary_identifier() + saved_ctx = frame.eval_ctx.save() + self.writeline(f"{old_ctx_name} = context.eval_ctx.save()") + self.visit_EvalContextModifier(node, frame) + for child in node.body: + self.visit(child, frame) + frame.eval_ctx.revert(saved_ctx) + self.writeline(f"context.eval_ctx.revert({old_ctx_name})") diff --git a/venv/Lib/site-packages/jinja2/constants.py b/venv/Lib/site-packages/jinja2/constants.py new file mode 100644 index 0000000000000000000000000000000000000000..41a1c23b0a7fe134b1f662545876eb65b31b071e --- /dev/null +++ b/venv/Lib/site-packages/jinja2/constants.py @@ -0,0 +1,20 @@ +#: list of lorem ipsum words used by the lipsum() helper function +LOREM_IPSUM_WORDS = """\ +a ac accumsan ad adipiscing aenean aliquam aliquet amet ante aptent arcu at +auctor augue bibendum blandit class commodo condimentum congue consectetuer +consequat conubia convallis cras cubilia cum curabitur curae cursus dapibus +diam dictum dictumst dignissim dis dolor donec dui duis egestas eget eleifend +elementum elit enim erat eros est et etiam eu euismod facilisi facilisis fames +faucibus felis fermentum feugiat fringilla fusce gravida habitant habitasse hac +hendrerit hymenaeos iaculis id imperdiet in inceptos integer interdum ipsum +justo lacinia lacus laoreet lectus leo libero ligula litora lobortis lorem +luctus maecenas magna magnis malesuada massa mattis mauris metus mi molestie +mollis montes morbi mus nam nascetur natoque nec neque netus nibh nisi nisl non +nonummy nostra nulla nullam nunc odio orci ornare parturient pede pellentesque +penatibus per pharetra phasellus placerat platea porta porttitor posuere +potenti praesent pretium primis proin pulvinar purus quam quis quisque rhoncus +ridiculus risus rutrum sagittis sapien scelerisque sed sem semper senectus sit +sociis sociosqu sodales sollicitudin suscipit suspendisse taciti tellus tempor +tempus tincidunt torquent tortor tristique turpis ullamcorper ultrices +ultricies urna ut varius vehicula vel velit venenatis vestibulum vitae vivamus +viverra volutpat vulputate""" diff --git a/venv/Lib/site-packages/jinja2/debug.py b/venv/Lib/site-packages/jinja2/debug.py new file mode 100644 index 0000000000000000000000000000000000000000..eeeeee78b620f5d0745133b4629647973cd7af87 --- /dev/null +++ b/venv/Lib/site-packages/jinja2/debug.py @@ -0,0 +1,191 @@ +import sys +import typing as t +from types import CodeType +from types import TracebackType + +from .exceptions import TemplateSyntaxError +from .utils import internal_code +from .utils import missing + +if t.TYPE_CHECKING: + from .runtime import Context + + +def rewrite_traceback_stack(source: t.Optional[str] = None) -> BaseException: + """Rewrite the current exception to replace any tracebacks from + within compiled template code with tracebacks that look like they + came from the template source. + + This must be called within an ``except`` block. + + :param source: For ``TemplateSyntaxError``, the original source if + known. + :return: The original exception with the rewritten traceback. + """ + _, exc_value, tb = sys.exc_info() + exc_value = t.cast(BaseException, exc_value) + tb = t.cast(TracebackType, tb) + + if isinstance(exc_value, TemplateSyntaxError) and not exc_value.translated: + exc_value.translated = True + exc_value.source = source + # Remove the old traceback, otherwise the frames from the + # compiler still show up. + exc_value.with_traceback(None) + # Outside of runtime, so the frame isn't executing template + # code, but it still needs to point at the template. + tb = fake_traceback( + exc_value, None, exc_value.filename or "", exc_value.lineno + ) + else: + # Skip the frame for the render function. + tb = tb.tb_next + + stack = [] + + # Build the stack of traceback object, replacing any in template + # code with the source file and line information. + while tb is not None: + # Skip frames decorated with @internalcode. These are internal + # calls that aren't useful in template debugging output. + if tb.tb_frame.f_code in internal_code: + tb = tb.tb_next + continue + + template = tb.tb_frame.f_globals.get("__jinja_template__") + + if template is not None: + lineno = template.get_corresponding_lineno(tb.tb_lineno) + fake_tb = fake_traceback(exc_value, tb, template.filename, lineno) + stack.append(fake_tb) + else: + stack.append(tb) + + tb = tb.tb_next + + tb_next = None + + # Assign tb_next in reverse to avoid circular references. + for tb in reversed(stack): + tb.tb_next = tb_next + tb_next = tb + + return exc_value.with_traceback(tb_next) + + +def fake_traceback( # type: ignore + exc_value: BaseException, tb: t.Optional[TracebackType], filename: str, lineno: int +) -> TracebackType: + """Produce a new traceback object that looks like it came from the + template source instead of the compiled code. The filename, line + number, and location name will point to the template, and the local + variables will be the current template context. + + :param exc_value: The original exception to be re-raised to create + the new traceback. + :param tb: The original traceback to get the local variables and + code info from. + :param filename: The template filename. + :param lineno: The line number in the template source. + """ + if tb is not None: + # Replace the real locals with the context that would be + # available at that point in the template. + locals = get_template_locals(tb.tb_frame.f_locals) + locals.pop("__jinja_exception__", None) + else: + locals = {} + + globals = { + "__name__": filename, + "__file__": filename, + "__jinja_exception__": exc_value, + } + # Raise an exception at the correct line number. + code: CodeType = compile( + "\n" * (lineno - 1) + "raise __jinja_exception__", filename, "exec" + ) + + # Build a new code object that points to the template file and + # replaces the location with a block name. + location = "template" + + if tb is not None: + function = tb.tb_frame.f_code.co_name + + if function == "root": + location = "top-level template code" + elif function.startswith("block_"): + location = f"block {function[6:]!r}" + + if sys.version_info >= (3, 8): + code = code.replace(co_name=location) + else: + code = CodeType( + code.co_argcount, + code.co_kwonlyargcount, + code.co_nlocals, + code.co_stacksize, + code.co_flags, + code.co_code, + code.co_consts, + code.co_names, + code.co_varnames, + code.co_filename, + location, + code.co_firstlineno, + code.co_lnotab, + code.co_freevars, + code.co_cellvars, + ) + + # Execute the new code, which is guaranteed to raise, and return + # the new traceback without this frame. + try: + exec(code, globals, locals) + except BaseException: + return sys.exc_info()[2].tb_next # type: ignore + + +def get_template_locals(real_locals: t.Mapping[str, t.Any]) -> t.Dict[str, t.Any]: + """Based on the runtime locals, get the context that would be + available at that point in the template. + """ + # Start with the current template context. + ctx: t.Optional[Context] = real_locals.get("context") + + if ctx is not None: + data: t.Dict[str, t.Any] = ctx.get_all().copy() + else: + data = {} + + # Might be in a derived context that only sets local variables + # rather than pushing a context. Local variables follow the scheme + # l_depth_name. Find the highest-depth local that has a value for + # each name. + local_overrides: t.Dict[str, t.Tuple[int, t.Any]] = {} + + for name, value in real_locals.items(): + if not name.startswith("l_") or value is missing: + # Not a template variable, or no longer relevant. + continue + + try: + _, depth_str, name = name.split("_", 2) + depth = int(depth_str) + except ValueError: + continue + + cur_depth = local_overrides.get(name, (-1,))[0] + + if cur_depth < depth: + local_overrides[name] = (depth, value) + + # Modify the context with any derived context. + for name, (_, value) in local_overrides.items(): + if value is missing: + data.pop(name, None) + else: + data[name] = value + + return data diff --git a/venv/Lib/site-packages/jinja2/defaults.py b/venv/Lib/site-packages/jinja2/defaults.py new file mode 100644 index 0000000000000000000000000000000000000000..638cad3d2d8907330bde56e2b76c9b185c523b45 --- /dev/null +++ b/venv/Lib/site-packages/jinja2/defaults.py @@ -0,0 +1,48 @@ +import typing as t + +from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401 +from .tests import TESTS as DEFAULT_TESTS # noqa: F401 +from .utils import Cycler +from .utils import generate_lorem_ipsum +from .utils import Joiner +from .utils import Namespace + +if t.TYPE_CHECKING: + import typing_extensions as te + +# defaults for the parser / lexer +BLOCK_START_STRING = "{%" +BLOCK_END_STRING = "%}" +VARIABLE_START_STRING = "{{" +VARIABLE_END_STRING = "}}" +COMMENT_START_STRING = "{#" +COMMENT_END_STRING = "#}" +LINE_STATEMENT_PREFIX: t.Optional[str] = None +LINE_COMMENT_PREFIX: t.Optional[str] = None +TRIM_BLOCKS = False +LSTRIP_BLOCKS = False +NEWLINE_SEQUENCE: "te.Literal['\\n', '\\r\\n', '\\r']" = "\n" +KEEP_TRAILING_NEWLINE = False + +# default filters, tests and namespace + +DEFAULT_NAMESPACE = { + "range": range, + "dict": dict, + "lipsum": generate_lorem_ipsum, + "cycler": Cycler, + "joiner": Joiner, + "namespace": Namespace, +} + +# default policies +DEFAULT_POLICIES: t.Dict[str, t.Any] = { + "compiler.ascii_str": True, + "urlize.rel": "noopener", + "urlize.target": None, + "urlize.extra_schemes": None, + "truncate.leeway": 5, + "json.dumps_function": None, + "json.dumps_kwargs": {"sort_keys": True}, + "ext.i18n.trimmed": False, +} diff --git a/venv/Lib/site-packages/jinja2/environment.py b/venv/Lib/site-packages/jinja2/environment.py new file mode 100644 index 0000000000000000000000000000000000000000..0fc6e5be87ab8273f6056ddfede07e1be28f1495 --- /dev/null +++ b/venv/Lib/site-packages/jinja2/environment.py @@ -0,0 +1,1672 @@ +"""Classes for managing templates and their runtime and compile time +options. +""" + +import os +import typing +import typing as t +import weakref +from collections import ChainMap +from functools import lru_cache +from functools import partial +from functools import reduce +from types import CodeType + +from markupsafe import Markup + +from . import nodes +from .compiler import CodeGenerator +from .compiler import generate +from .defaults import BLOCK_END_STRING +from .defaults import BLOCK_START_STRING +from .defaults import COMMENT_END_STRING +from .defaults import COMMENT_START_STRING +from .defaults import DEFAULT_FILTERS # type: ignore[attr-defined] +from .defaults import DEFAULT_NAMESPACE +from .defaults import DEFAULT_POLICIES +from .defaults import DEFAULT_TESTS # type: ignore[attr-defined] +from .defaults import KEEP_TRAILING_NEWLINE +from .defaults import LINE_COMMENT_PREFIX +from .defaults import LINE_STATEMENT_PREFIX +from .defaults import LSTRIP_BLOCKS +from .defaults import NEWLINE_SEQUENCE +from .defaults import TRIM_BLOCKS +from .defaults import VARIABLE_END_STRING +from .defaults import VARIABLE_START_STRING +from .exceptions import TemplateNotFound +from .exceptions import TemplateRuntimeError +from .exceptions import TemplatesNotFound +from .exceptions import TemplateSyntaxError +from .exceptions import UndefinedError +from .lexer import get_lexer +from .lexer import Lexer +from .lexer import TokenStream +from .nodes import EvalContext +from .parser import Parser +from .runtime import Context +from .runtime import new_context +from .runtime import Undefined +from .utils import _PassArg +from .utils import concat +from .utils import consume +from .utils import import_string +from .utils import internalcode +from .utils import LRUCache +from .utils import missing + +if t.TYPE_CHECKING: + import typing_extensions as te + + from .bccache import BytecodeCache + from .ext import Extension + from .loaders import BaseLoader + +_env_bound = t.TypeVar("_env_bound", bound="Environment") + + +# for direct template usage we have up to ten living environments +@lru_cache(maxsize=10) +def get_spontaneous_environment(cls: t.Type[_env_bound], *args: t.Any) -> _env_bound: + """Return a new spontaneous environment. A spontaneous environment + is used for templates created directly rather than through an + existing environment. + + :param cls: Environment class to create. + :param args: Positional arguments passed to environment. + """ + env = cls(*args) + env.shared = True + return env + + +def create_cache( + size: int, +) -> t.Optional[t.MutableMapping[t.Tuple["weakref.ref[t.Any]", str], "Template"]]: + """Return the cache class for the given size.""" + if size == 0: + return None + + if size < 0: + return {} + + return LRUCache(size) # type: ignore + + +def copy_cache( + cache: t.Optional[t.MutableMapping[t.Any, t.Any]], +) -> t.Optional[t.MutableMapping[t.Tuple["weakref.ref[t.Any]", str], "Template"]]: + """Create an empty copy of the given cache.""" + if cache is None: + return None + + if type(cache) is dict: # noqa E721 + return {} + + return LRUCache(cache.capacity) # type: ignore + + +def load_extensions( + environment: "Environment", + extensions: t.Sequence[t.Union[str, t.Type["Extension"]]], +) -> t.Dict[str, "Extension"]: + """Load the extensions from the list and bind it to the environment. + Returns a dict of instantiated extensions. + """ + result = {} + + for extension in extensions: + if isinstance(extension, str): + extension = t.cast(t.Type["Extension"], import_string(extension)) + + result[extension.identifier] = extension(environment) + + return result + + +def _environment_config_check(environment: _env_bound) -> _env_bound: + """Perform a sanity check on the environment.""" + assert issubclass( + environment.undefined, Undefined + ), "'undefined' must be a subclass of 'jinja2.Undefined'." + assert ( + environment.block_start_string + != environment.variable_start_string + != environment.comment_start_string + ), "block, variable and comment start strings must be different." + assert environment.newline_sequence in { + "\r", + "\r\n", + "\n", + }, "'newline_sequence' must be one of '\\n', '\\r\\n', or '\\r'." + return environment + + +class Environment: + r"""The core component of Jinja is the `Environment`. It contains + important shared variables like configuration, filters, tests, + globals and others. Instances of this class may be modified if + they are not shared and if no template was loaded so far. + Modifications on environments after the first template was loaded + will lead to surprising effects and undefined behavior. + + Here are the possible initialization parameters: + + `block_start_string` + The string marking the beginning of a block. Defaults to ``'{%'``. + + `block_end_string` + The string marking the end of a block. Defaults to ``'%}'``. + + `variable_start_string` + The string marking the beginning of a print statement. + Defaults to ``'{{'``. + + `variable_end_string` + The string marking the end of a print statement. Defaults to + ``'}}'``. + + `comment_start_string` + The string marking the beginning of a comment. Defaults to ``'{#'``. + + `comment_end_string` + The string marking the end of a comment. Defaults to ``'#}'``. + + `line_statement_prefix` + If given and a string, this will be used as prefix for line based + statements. See also :ref:`line-statements`. + + `line_comment_prefix` + If given and a string, this will be used as prefix for line based + comments. See also :ref:`line-statements`. + + .. versionadded:: 2.2 + + `trim_blocks` + If this is set to ``True`` the first newline after a block is + removed (block, not variable tag!). Defaults to `False`. + + `lstrip_blocks` + If this is set to ``True`` leading spaces and tabs are stripped + from the start of a line to a block. Defaults to `False`. + + `newline_sequence` + The sequence that starts a newline. Must be one of ``'\r'``, + ``'\n'`` or ``'\r\n'``. The default is ``'\n'`` which is a + useful default for Linux and OS X systems as well as web + applications. + + `keep_trailing_newline` + Preserve the trailing newline when rendering templates. + The default is ``False``, which causes a single newline, + if present, to be stripped from the end of the template. + + .. versionadded:: 2.7 + + `extensions` + List of Jinja extensions to use. This can either be import paths + as strings or extension classes. For more information have a + look at :ref:`the extensions documentation `. + + `optimized` + should the optimizer be enabled? Default is ``True``. + + `undefined` + :class:`Undefined` or a subclass of it that is used to represent + undefined values in the template. + + `finalize` + A callable that can be used to process the result of a variable + expression before it is output. For example one can convert + ``None`` implicitly into an empty string here. + + `autoescape` + If set to ``True`` the XML/HTML autoescaping feature is enabled by + default. For more details about autoescaping see + :class:`~markupsafe.Markup`. As of Jinja 2.4 this can also + be a callable that is passed the template name and has to + return ``True`` or ``False`` depending on autoescape should be + enabled by default. + + .. versionchanged:: 2.4 + `autoescape` can now be a function + + `loader` + The template loader for this environment. + + `cache_size` + The size of the cache. Per default this is ``400`` which means + that if more than 400 templates are loaded the loader will clean + out the least recently used template. If the cache size is set to + ``0`` templates are recompiled all the time, if the cache size is + ``-1`` the cache will not be cleaned. + + .. versionchanged:: 2.8 + The cache size was increased to 400 from a low 50. + + `auto_reload` + Some loaders load templates from locations where the template + sources may change (ie: file system or database). If + ``auto_reload`` is set to ``True`` (default) every time a template is + requested the loader checks if the source changed and if yes, it + will reload the template. For higher performance it's possible to + disable that. + + `bytecode_cache` + If set to a bytecode cache object, this object will provide a + cache for the internal Jinja bytecode so that templates don't + have to be parsed if they were not changed. + + See :ref:`bytecode-cache` for more information. + + `enable_async` + If set to true this enables async template execution which + allows using async functions and generators. + """ + + #: if this environment is sandboxed. Modifying this variable won't make + #: the environment sandboxed though. For a real sandboxed environment + #: have a look at jinja2.sandbox. This flag alone controls the code + #: generation by the compiler. + sandboxed = False + + #: True if the environment is just an overlay + overlayed = False + + #: the environment this environment is linked to if it is an overlay + linked_to: t.Optional["Environment"] = None + + #: shared environments have this set to `True`. A shared environment + #: must not be modified + shared = False + + #: the class that is used for code generation. See + #: :class:`~jinja2.compiler.CodeGenerator` for more information. + code_generator_class: t.Type["CodeGenerator"] = CodeGenerator + + concat = "".join + + #: the context class that is used for templates. See + #: :class:`~jinja2.runtime.Context` for more information. + context_class: t.Type[Context] = Context + + template_class: t.Type["Template"] + + def __init__( + self, + block_start_string: str = BLOCK_START_STRING, + block_end_string: str = BLOCK_END_STRING, + variable_start_string: str = VARIABLE_START_STRING, + variable_end_string: str = VARIABLE_END_STRING, + comment_start_string: str = COMMENT_START_STRING, + comment_end_string: str = COMMENT_END_STRING, + line_statement_prefix: t.Optional[str] = LINE_STATEMENT_PREFIX, + line_comment_prefix: t.Optional[str] = LINE_COMMENT_PREFIX, + trim_blocks: bool = TRIM_BLOCKS, + lstrip_blocks: bool = LSTRIP_BLOCKS, + newline_sequence: "te.Literal['\\n', '\\r\\n', '\\r']" = NEWLINE_SEQUENCE, + keep_trailing_newline: bool = KEEP_TRAILING_NEWLINE, + extensions: t.Sequence[t.Union[str, t.Type["Extension"]]] = (), + optimized: bool = True, + undefined: t.Type[Undefined] = Undefined, + finalize: t.Optional[t.Callable[..., t.Any]] = None, + autoescape: t.Union[bool, t.Callable[[t.Optional[str]], bool]] = False, + loader: t.Optional["BaseLoader"] = None, + cache_size: int = 400, + auto_reload: bool = True, + bytecode_cache: t.Optional["BytecodeCache"] = None, + enable_async: bool = False, + ): + # !!Important notice!! + # The constructor accepts quite a few arguments that should be + # passed by keyword rather than position. However it's important to + # not change the order of arguments because it's used at least + # internally in those cases: + # - spontaneous environments (i18n extension and Template) + # - unittests + # If parameter changes are required only add parameters at the end + # and don't change the arguments (or the defaults!) of the arguments + # existing already. + + # lexer / parser information + self.block_start_string = block_start_string + self.block_end_string = block_end_string + self.variable_start_string = variable_start_string + self.variable_end_string = variable_end_string + self.comment_start_string = comment_start_string + self.comment_end_string = comment_end_string + self.line_statement_prefix = line_statement_prefix + self.line_comment_prefix = line_comment_prefix + self.trim_blocks = trim_blocks + self.lstrip_blocks = lstrip_blocks + self.newline_sequence = newline_sequence + self.keep_trailing_newline = keep_trailing_newline + + # runtime information + self.undefined: t.Type[Undefined] = undefined + self.optimized = optimized + self.finalize = finalize + self.autoescape = autoescape + + # defaults + self.filters = DEFAULT_FILTERS.copy() + self.tests = DEFAULT_TESTS.copy() + self.globals = DEFAULT_NAMESPACE.copy() + + # set the loader provided + self.loader = loader + self.cache = create_cache(cache_size) + self.bytecode_cache = bytecode_cache + self.auto_reload = auto_reload + + # configurable policies + self.policies = DEFAULT_POLICIES.copy() + + # load extensions + self.extensions = load_extensions(self, extensions) + + self.is_async = enable_async + _environment_config_check(self) + + def add_extension(self, extension: t.Union[str, t.Type["Extension"]]) -> None: + """Adds an extension after the environment was created. + + .. versionadded:: 2.5 + """ + self.extensions.update(load_extensions(self, [extension])) + + def extend(self, **attributes: t.Any) -> None: + """Add the items to the instance of the environment if they do not exist + yet. This is used by :ref:`extensions ` to register + callbacks and configuration values without breaking inheritance. + """ + for key, value in attributes.items(): + if not hasattr(self, key): + setattr(self, key, value) + + def overlay( + self, + block_start_string: str = missing, + block_end_string: str = missing, + variable_start_string: str = missing, + variable_end_string: str = missing, + comment_start_string: str = missing, + comment_end_string: str = missing, + line_statement_prefix: t.Optional[str] = missing, + line_comment_prefix: t.Optional[str] = missing, + trim_blocks: bool = missing, + lstrip_blocks: bool = missing, + newline_sequence: "te.Literal['\\n', '\\r\\n', '\\r']" = missing, + keep_trailing_newline: bool = missing, + extensions: t.Sequence[t.Union[str, t.Type["Extension"]]] = missing, + optimized: bool = missing, + undefined: t.Type[Undefined] = missing, + finalize: t.Optional[t.Callable[..., t.Any]] = missing, + autoescape: t.Union[bool, t.Callable[[t.Optional[str]], bool]] = missing, + loader: t.Optional["BaseLoader"] = missing, + cache_size: int = missing, + auto_reload: bool = missing, + bytecode_cache: t.Optional["BytecodeCache"] = missing, + enable_async: bool = missing, + ) -> "te.Self": + """Create a new overlay environment that shares all the data with the + current environment except for cache and the overridden attributes. + Extensions cannot be removed for an overlayed environment. An overlayed + environment automatically gets all the extensions of the environment it + is linked to plus optional extra extensions. + + Creating overlays should happen after the initial environment was set + up completely. Not all attributes are truly linked, some are just + copied over so modifications on the original environment may not shine + through. + + .. versionchanged:: 3.1.5 + ``enable_async`` is applied correctly. + + .. versionchanged:: 3.1.2 + Added the ``newline_sequence``, ``keep_trailing_newline``, + and ``enable_async`` parameters to match ``__init__``. + """ + args = dict(locals()) + del args["self"], args["cache_size"], args["extensions"], args["enable_async"] + + rv = object.__new__(self.__class__) + rv.__dict__.update(self.__dict__) + rv.overlayed = True + rv.linked_to = self + + for key, value in args.items(): + if value is not missing: + setattr(rv, key, value) + + if cache_size is not missing: + rv.cache = create_cache(cache_size) + else: + rv.cache = copy_cache(self.cache) + + rv.extensions = {} + for key, value in self.extensions.items(): + rv.extensions[key] = value.bind(rv) + if extensions is not missing: + rv.extensions.update(load_extensions(rv, extensions)) + + if enable_async is not missing: + rv.is_async = enable_async + + return _environment_config_check(rv) + + @property + def lexer(self) -> Lexer: + """The lexer for this environment.""" + return get_lexer(self) + + def iter_extensions(self) -> t.Iterator["Extension"]: + """Iterates over the extensions by priority.""" + return iter(sorted(self.extensions.values(), key=lambda x: x.priority)) + + def getitem( + self, obj: t.Any, argument: t.Union[str, t.Any] + ) -> t.Union[t.Any, Undefined]: + """Get an item or attribute of an object but prefer the item.""" + try: + return obj[argument] + except (AttributeError, TypeError, LookupError): + if isinstance(argument, str): + try: + attr = str(argument) + except Exception: + pass + else: + try: + return getattr(obj, attr) + except AttributeError: + pass + return self.undefined(obj=obj, name=argument) + + def getattr(self, obj: t.Any, attribute: str) -> t.Any: + """Get an item or attribute of an object but prefer the attribute. + Unlike :meth:`getitem` the attribute *must* be a string. + """ + try: + return getattr(obj, attribute) + except AttributeError: + pass + try: + return obj[attribute] + except (TypeError, LookupError, AttributeError): + return self.undefined(obj=obj, name=attribute) + + def _filter_test_common( + self, + name: t.Union[str, Undefined], + value: t.Any, + args: t.Optional[t.Sequence[t.Any]], + kwargs: t.Optional[t.Mapping[str, t.Any]], + context: t.Optional[Context], + eval_ctx: t.Optional[EvalContext], + is_filter: bool, + ) -> t.Any: + if is_filter: + env_map = self.filters + type_name = "filter" + else: + env_map = self.tests + type_name = "test" + + func = env_map.get(name) # type: ignore + + if func is None: + msg = f"No {type_name} named {name!r}." + + if isinstance(name, Undefined): + try: + name._fail_with_undefined_error() + except Exception as e: + msg = f"{msg} ({e}; did you forget to quote the callable name?)" + + raise TemplateRuntimeError(msg) + + args = [value, *(args if args is not None else ())] + kwargs = kwargs if kwargs is not None else {} + pass_arg = _PassArg.from_obj(func) + + if pass_arg is _PassArg.context: + if context is None: + raise TemplateRuntimeError( + f"Attempted to invoke a context {type_name} without context." + ) + + args.insert(0, context) + elif pass_arg is _PassArg.eval_context: + if eval_ctx is None: + if context is not None: + eval_ctx = context.eval_ctx + else: + eval_ctx = EvalContext(self) + + args.insert(0, eval_ctx) + elif pass_arg is _PassArg.environment: + args.insert(0, self) + + return func(*args, **kwargs) + + def call_filter( + self, + name: str, + value: t.Any, + args: t.Optional[t.Sequence[t.Any]] = None, + kwargs: t.Optional[t.Mapping[str, t.Any]] = None, + context: t.Optional[Context] = None, + eval_ctx: t.Optional[EvalContext] = None, + ) -> t.Any: + """Invoke a filter on a value the same way the compiler does. + + This might return a coroutine if the filter is running from an + environment in async mode and the filter supports async + execution. It's your responsibility to await this if needed. + + .. versionadded:: 2.7 + """ + return self._filter_test_common( + name, value, args, kwargs, context, eval_ctx, True + ) + + def call_test( + self, + name: str, + value: t.Any, + args: t.Optional[t.Sequence[t.Any]] = None, + kwargs: t.Optional[t.Mapping[str, t.Any]] = None, + context: t.Optional[Context] = None, + eval_ctx: t.Optional[EvalContext] = None, + ) -> t.Any: + """Invoke a test on a value the same way the compiler does. + + This might return a coroutine if the test is running from an + environment in async mode and the test supports async execution. + It's your responsibility to await this if needed. + + .. versionchanged:: 3.0 + Tests support ``@pass_context``, etc. decorators. Added + the ``context`` and ``eval_ctx`` parameters. + + .. versionadded:: 2.7 + """ + return self._filter_test_common( + name, value, args, kwargs, context, eval_ctx, False + ) + + @internalcode + def parse( + self, + source: str, + name: t.Optional[str] = None, + filename: t.Optional[str] = None, + ) -> nodes.Template: + """Parse the sourcecode and return the abstract syntax tree. This + tree of nodes is used by the compiler to convert the template into + executable source- or bytecode. This is useful for debugging or to + extract information from templates. + + If you are :ref:`developing Jinja extensions ` + this gives you a good overview of the node tree generated. + """ + try: + return self._parse(source, name, filename) + except TemplateSyntaxError: + self.handle_exception(source=source) + + def _parse( + self, source: str, name: t.Optional[str], filename: t.Optional[str] + ) -> nodes.Template: + """Internal parsing function used by `parse` and `compile`.""" + return Parser(self, source, name, filename).parse() + + def lex( + self, + source: str, + name: t.Optional[str] = None, + filename: t.Optional[str] = None, + ) -> t.Iterator[t.Tuple[int, str, str]]: + """Lex the given sourcecode and return a generator that yields + tokens as tuples in the form ``(lineno, token_type, value)``. + This can be useful for :ref:`extension development ` + and debugging templates. + + This does not perform preprocessing. If you want the preprocessing + of the extensions to be applied you have to filter source through + the :meth:`preprocess` method. + """ + source = str(source) + try: + return self.lexer.tokeniter(source, name, filename) + except TemplateSyntaxError: + self.handle_exception(source=source) + + def preprocess( + self, + source: str, + name: t.Optional[str] = None, + filename: t.Optional[str] = None, + ) -> str: + """Preprocesses the source with all extensions. This is automatically + called for all parsing and compiling methods but *not* for :meth:`lex` + because there you usually only want the actual source tokenized. + """ + return reduce( + lambda s, e: e.preprocess(s, name, filename), + self.iter_extensions(), + str(source), + ) + + def _tokenize( + self, + source: str, + name: t.Optional[str], + filename: t.Optional[str] = None, + state: t.Optional[str] = None, + ) -> TokenStream: + """Called by the parser to do the preprocessing and filtering + for all the extensions. Returns a :class:`~jinja2.lexer.TokenStream`. + """ + source = self.preprocess(source, name, filename) + stream = self.lexer.tokenize(source, name, filename, state) + + for ext in self.iter_extensions(): + stream = ext.filter_stream(stream) # type: ignore + + if not isinstance(stream, TokenStream): + stream = TokenStream(stream, name, filename) + + return stream + + def _generate( + self, + source: nodes.Template, + name: t.Optional[str], + filename: t.Optional[str], + defer_init: bool = False, + ) -> str: + """Internal hook that can be overridden to hook a different generate + method in. + + .. versionadded:: 2.5 + """ + return generate( # type: ignore + source, + self, + name, + filename, + defer_init=defer_init, + optimized=self.optimized, + ) + + def _compile(self, source: str, filename: str) -> CodeType: + """Internal hook that can be overridden to hook a different compile + method in. + + .. versionadded:: 2.5 + """ + return compile(source, filename, "exec") + + @typing.overload + def compile( + self, + source: t.Union[str, nodes.Template], + name: t.Optional[str] = None, + filename: t.Optional[str] = None, + raw: "te.Literal[False]" = False, + defer_init: bool = False, + ) -> CodeType: ... + + @typing.overload + def compile( + self, + source: t.Union[str, nodes.Template], + name: t.Optional[str] = None, + filename: t.Optional[str] = None, + raw: "te.Literal[True]" = ..., + defer_init: bool = False, + ) -> str: ... + + @internalcode + def compile( + self, + source: t.Union[str, nodes.Template], + name: t.Optional[str] = None, + filename: t.Optional[str] = None, + raw: bool = False, + defer_init: bool = False, + ) -> t.Union[str, CodeType]: + """Compile a node or template source code. The `name` parameter is + the load name of the template after it was joined using + :meth:`join_path` if necessary, not the filename on the file system. + the `filename` parameter is the estimated filename of the template on + the file system. If the template came from a database or memory this + can be omitted. + + The return value of this method is a python code object. If the `raw` + parameter is `True` the return value will be a string with python + code equivalent to the bytecode returned otherwise. This method is + mainly used internally. + + `defer_init` is use internally to aid the module code generator. This + causes the generated code to be able to import without the global + environment variable to be set. + + .. versionadded:: 2.4 + `defer_init` parameter added. + """ + source_hint = None + try: + if isinstance(source, str): + source_hint = source + source = self._parse(source, name, filename) + source = self._generate(source, name, filename, defer_init=defer_init) + if raw: + return source + if filename is None: + filename = "